diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2011-11-27 15:24:25 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2011-11-27 15:24:25 -0500 |
commit | 7d6044395bdf9dbd4b06251f5e78c1016937e627 (patch) | |
tree | 6d94e106e2ebd2e13d709120b81129808ea25b7f /Makefile | |
parent | 592e7b2b8213cc74e7bcf812cbee7c6db812757d (diff) |
move non-generic things into theme.mk, add `clean' and `distclean' rules
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 36 |
1 files changed, 24 insertions, 12 deletions
@@ -6,20 +6,12 @@ PATCH = patch SASS = sass PHP := $(firstword $(call pathsearch,php5) $(call pathsearch,php)) -srcfiles = \ - .gitignore \ - img/swoosh.svg \ - style.scss \ - header.php.patch \ - Makefile \ - logo-style.scss.php \ - license.txt \ - css_shadow.php \ - twentyeleven-fix.scss +default: all -all: header.php style.css img/swoosh.png .gitignore +include theme.mk +srcfiles += .gitignore theme.mk Makefile -style.css: logo-style.scss twentyeleven-fix.scss +all: .gitignore $(targets) %: %.patch ../twentyeleven/% $(RM) $@ @@ -35,6 +27,7 @@ style.css: logo-style.scss twentyeleven-fix.scss %.png: %.svg rsvg-convert $< > $@.$$$$ && pngcrush $@.$$$$ $@ ; $(RM) $@.$$$$ +################################################################################ in_dir = $(patsubst ./%,%,$(dir $1)) my_dir = $(patsubst %/,%,$(dir $1)) @@ -53,3 +46,22 @@ endef echo '*' >> '$@' echo '# but these:' >> '$@' $(foreach file,$(srcfiles),$(call gitignore_file,$(file))) + +################################################################################ + +git2make = $1 $(subst *,.*,$1) +gitignore_y = $(call git2make,$(shell sed -n 's/^[^\#!]/&/p' .gitignore)) +gitignore_n = $(call git2make,$(shell sed -n 's/^!//p' .gitignore)) +gitignore_i = . .. .git %/.. %/. +gitignore = $(filter-out $(gitignore_i) $(wildcard $(gitignore_n)),$(wildcard $(gitignore_y))) + +clean: .gitignore PHONY + $(RM) -r $(filter-out $(targets),$(gitignore)) +distclean: .gitignore PHONY + $(RM) -r $(gitignore) + +################################################################################ + +.PHONY: FORCE PHONY +FORCE: ; +PHONY: ; |