summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile13
1 files changed, 12 insertions, 1 deletions
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 '$@'