blob: 01e01b8311ace3b6f47671a8f55dabeafbf71644 [file] [log] [blame]
Matthias Andreas Benkardf59e0972018-04-10 22:01:34 +02001# Copyright 2015 Andrew Gottemoller.
2#
3# This software is a copyrighted work licensed under the terms of the
4# Weld license. Please consult the file "WELD_LICENSE" for
5# details.
6
7# This makefile defines cmd specific functionality used throughout weld
8
9
10# Convert a native path name to a universal representation
11path_to_universal = $(subst \,/,$(1))
12
13# Convert a universtal path name to the native representation
14path_to_native = $(subst /,\,$(1))
15
16# Find all files of the specified name beneath the specified path
17find_files = $(strip $(call path_to_universal,$(shell dir /B /S $(call path_to_native,$(1)/$(2)))))
18
19# Windows doesn't support symlinking so soft and hard copy both
20# make copies'
21soft_copy = $(strip copy /V $(call path_to_native,$(1) $(2)) 1>NUL)
22hard_copy = $(strip copy /V $(call path_to_native,$(1) $(2)) 1>NUL)
23
24# Remove files which exist
25remove_files = $(strip $(if $(wildcard $(1)),del /Q /F $(call path_to_native,$(wildcard $(1))),))
26
27# Create a directory tree
28make_directory = $(strip $(if $(wildcard $(1)),,mkdir $(call path_to_native,$(1))))
29
30# Remove directory that exists
31remove_directory = $(strip $(if $(wildcard $(1)),rmdir /Q /S $(call path_to_native,$(wildcard $(1))),))
32
33# Print to stdout
34print = echo $(1)