3 # Creates _dir_ and its parent directories
6 # Ignore timestamps on directories: we only care if they exist.
9 # Don't create . or any directory already created.
10 if $(<:G=) != $(DOT) && ! $($(<)-mkdir) {
11 # Cheesy gate to prevent multiple invocations on same dir
12 # Arrange for jam dirs
13 # MkDir1 has the actions
18 # Recursively make parent directories.
19 # $(<:P) = $(<)'s parent, & we recurse until root
22 # Don't try to create A: or A:\ on windows
29 # handle "C:", "C:/", "/cygdrive" and "/cygdrive/" in Cygwin
30 if $(UNIX) && $(OS) = CYGWIN {
34 case "<dir>/cygdrive" : s = ;
35 case "<dir>/cygdrive/" : s = ;
40 # The parent is the same as the dir.
41 # We're at the root, which some OS's can't stat, so we mark
45 # There's a parent; recurse.
58 $(CHGRP) $(GROUP) $(<)
64 # (Unix and VMS only). Change file permissions on _target_ to target-specific
65 # $(MODE) value set by @Link, @File, @Install* and @Shell rules
68 if $(CHMOD) { Chmod1 $(<) ; }
77 $(CHOWN) $(OWNER) $(<)
81 # /HardLink target : source ;
83 # Makes _target_ a hard link to _source_, if it isn't one already
87 Depends files : $(<) ;
89 SEARCH on $(>) = $(SEARCH_SOURCE) ;
94 $(RM) $(<) && $(LN) $(>) $(<)
99 Depends files : $(<) ;
100 Depends $(<) : $(>) ;
101 SEARCH on $(>) = $(SEARCH_SOURCE) ;
106 $(RM) $(<) && $(LN) -s $(>) $(<)
111 Depends shell : $(<) ;
112 Depends $(<) : $(>) ;
113 SEARCH on $(>) = $(SEARCH_SOURCE) ;
114 MODE on $(<) = $(SHELLMODE) ;
122 NR == 1 { print "$(SHELLHEADER)" }
123 NR == 1 && /^[#:]/ { next }
132 MODE on [ FAppendSuffix $(<) : $(SUFEXE) ] = 4711 ;
136 # /File target : source ;
138 # Copies _source_ into _target_
141 Depends files : $(<) ;
142 Depends $(<) : $(>) ;
143 SEARCH on $(>) = $(SEARCH_SOURCE) ;
144 MODE on $(<) = $(FILEMODE) ;
153 # /Bulk directory : sources ;
155 # Copies _sources_ into _directory_
161 File $(i:D=$(<)) : $(i) ;
166 rule FileExists names {
167 local _fn _lst _dir _name ;
169 for _fn in $(names) {
170 _dir = [ Match "^(.*?)/[^/]+$" : $(_fn) ] ;
171 _name = [ Match "^.*?/([^/]+)$" : $(_fn) ] ;
172 if ! $(_dir) { _dir = . ; }
173 #Echo "_dir:" $(_dir) ;
174 #Echo "_name:" $(_name) ;
175 _lst = [ Glob $(_dir) : $(_name) : plain ] ;
176 #Echo "_lst:" $(_lst) ;
177 if ! $(_lst) { return "" ; }
183 rule BuildFileList dir : mask {
184 local _lst = [ Glob $(dir) : $(mask) : files-only ] ;
185 local _dirs = [ Glob $(dir) : "[^_.]*" : dirs-only ] ;
188 for _dn in $(_dirs) {
189 #Echo "dir:" $(_dn) ;
190 _l = [ BuildFileList $(_dn) : $(mask) ] ;