summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-03-04 17:39:38 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-03-04 17:39:38 -0500
commitae11895c01e95136f8253db6e4f53f74b893d49b (patch)
tree45dc979cf9c2704a22d089b364ed8c30d000bd93
parent9d86494cb689ef6e8c04f6b569f0d19252731436 (diff)
Makefile: add support for `file|` specs
-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 '$@'