From ae11895c01e95136f8253db6e4f53f74b893d49b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 4 Mar 2015 17:39:38 -0500 Subject: Makefile: add support for `file|` specs --- Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3c2e808..a2d93c6 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ top := $(shell pwd) CAT = cat -CPR = cp -dR --preserve=mode,ownership +CP = cp -d --preserve=mode,ownership +CPR = $(CP) -R ECHO = echo EXISTS = test -e FAIL = exit 1 @@ -107,6 +108,10 @@ build/download/tar/%: .tokens/network $(MKDIRS) '$(@D)' $(WGET) -c -O '$@' '$(call file2,url,tar/$*)' $(TOUCH) '$@' +build/download/file/%: .tokens/network + $(MKDIRS) '$(@D)' + $(WGET) -c -O '$@' '$(call file2,url,file/$*)' + $(TOUCH) '$@' # extract ###################################################################### @@ -148,6 +153,12 @@ build/extract/tar/%: # magic foreach loop ( cd '$(_tar_basedir)' && $(TAR) -m $(if $(filter $(_tar_basedir),$(tarbombs)),,--strip-components 1) -xf '$(top)/$<' ); \ } || { $(RM) -r '$(_tar_basedir)'; $(FAIL); } +build/extract/file/%: build/download/file/% + $(RM) -r '$@' + $(MKDIRS) '$@' + $(CP) -T '$<' '$@/$(notdir $(call file2,url,file/$*))' || { $(RM) -r '$@'; $(FAIL); } + $(TOUCH) '$@' + # union build/extract/union/%: # magic foreach loop $(RM) -r '$@' -- cgit v1.2.2