summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile36
1 files changed, 24 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index f0eb157..6f3ba14 100644
--- a/Makefile
+++ b/Makefile
@@ -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: ;