make/common/MakeBase.gmk
changeset 27595 cff167b3bfa2
parent 27592 af7df0dd5ff7
child 28600 09dd1740f176
child 28602 51c0dcf51b67
child 28901 5acc0ec03d06
equal deleted inserted replaced
27594:e425f93c3dda 27595:cff167b3bfa2
   403   # Cp has to operate in recursive mode to allow for -P flag, to preserve soft links. If the
   403   # Cp has to operate in recursive mode to allow for -P flag, to preserve soft links. If the
   404   # name of the target file differs from the source file, rename after copy.
   404   # name of the target file differs from the source file, rename after copy.
   405   # If the source and target parent directories are the same, recursive copy doesn't work
   405   # If the source and target parent directories are the same, recursive copy doesn't work
   406   # so we fall back on regular copy, which isn't preserving symlinks.
   406   # so we fall back on regular copy, which isn't preserving symlinks.
   407   define install-file
   407   define install-file
   408 	$(MKDIR) -p $(@D)
   408 	$(MKDIR) -p '$(@D)'
   409 	$(RM) '$@'
   409 	$(RM) '$@'
   410 	if [ "$(@D)" != "$(<D)" ]; then \
   410 	if [ "$(@D)" != "$(<D)" ]; then \
   411 	  $(CP) -f -r -P '$<' '$(@D)'; \
   411 	  $(CP) -f -r -P '$<' '$(@D)'; \
   412 	  if [ "$(@F)" != "$(<F)" ]; then \
   412 	  if [ "$(@F)" != "$(<F)" ]; then \
   413 	    $(MV) '$(@D)/$(<F)' '$@'; \
   413 	    $(MV) '$(@D)/$(<F)' '$@'; \
   425   # cause the creation of ._* files which confuses testing. Clear these with xattr if
   425   # cause the creation of ._* files which confuses testing. Clear these with xattr if
   426   # set. Some files get their write permissions removed after being copied to the
   426   # set. Some files get their write permissions removed after being copied to the
   427   # output dir. When these are copied again to images, xattr would fail. By only clearing
   427   # output dir. When these are copied again to images, xattr would fail. By only clearing
   428   # attributes when they are present, failing on this is avoided.
   428   # attributes when they are present, failing on this is avoided.
   429   define install-file
   429   define install-file
   430 	$(MKDIR) -p $(@D)
   430 	$(MKDIR) -p '$(@D)'
   431 	$(CP) -fRP '$<' '$@'
   431 	$(CP) -fRP '$<' '$@'
   432 	if [ -n "`$(XATTR) -l '$@'`" ]; then $(XATTR) -c '$@'; fi
   432 	if [ -n "`$(XATTR) -l '$@'`" ]; then $(XATTR) -c '$@'; fi
   433   endef
   433   endef
   434 else
   434 else
   435   # Running mkdir and cp in the same shell speeds up copy intensive tasks in Cygwin
   435   # Running mkdir and cp in the same shell speeds up copy intensive tasks in Cygwin
   436   # significantly.
   436   # significantly.
   437   define install-file
   437   define install-file
   438 	$(MKDIR) -p $(@D) && $(CP) -fP '$<' '$@'
   438 	$(MKDIR) -p '$(@D)' && $(CP) -fP '$<' '$@'
   439   endef
   439   endef
   440 endif
   440 endif
   441 
   441 
   442 # Convenience functions for working around make's limitations with $(filter ).
   442 # Convenience functions for working around make's limitations with $(filter ).
   443 containing = $(strip $(foreach v,$(strip $2),$(if $(findstring $(strip $1),$v),$v)))
   443 containing = $(strip $(foreach v,$(strip $2),$(if $(findstring $(strip $1),$v),$v)))