From 11d588e4abde45f0f7e9533ca626ea5581836434 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 25 Sep 2011 00:05:54 -0700 Subject: meh do stuff --- Makefile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..62429bb --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +RM = rm -f +CP = cp +PATCH = patch +SASS = sass +PHP = php5 + +srcfiles = \ + img/swoosh.png \ + style.scss \ + header.php.patch \ + Makefile \ + logo-style.scss.php \ + license.txt \ + css_shadow.php + +all: header.php style.css .gitignore + +style.css: logo-style.scss + +%: %.patch ../twentyeleven/% + $(RM) $@ + $(CP) ../twentyeleven/$@ $@ + $(PATCH) $@ < $@.patch + +%.css: %.scss + $(SASS) $< $@ + +%: %.php + $(PHP) -f $< > $@ + +.gitignore: Makefile + echo "# DO NOT EDIT, this file is automatically made by \`Makefile'" >$@ + echo '# ' >> '$@' + echo '# ignore everyting' >> '$@' + echo '*' >> '$@' + echo '# but these:' >> '$@' + for file in $(srcfiles); do echo !"$$file" >> '$@'; done -- cgit v1.2.3 From 66184aab11c86d4d6d6d05dbe7dd4e7f5110b3d2 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 25 Sep 2011 16:14:44 -0400 Subject: make swoosh.png from svg --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 62429bb..aad371c 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ SASS = sass PHP = php5 srcfiles = \ - img/swoosh.png \ + img/swoosh.svg \ style.scss \ header.php.patch \ Makefile \ @@ -13,7 +13,7 @@ srcfiles = \ license.txt \ css_shadow.php -all: header.php style.css .gitignore +all: header.php style.css img/swoosh.png .gitignore style.css: logo-style.scss @@ -28,6 +28,9 @@ style.css: logo-style.scss %: %.php $(PHP) -f $< > $@ +%.png: %.svg + rsvg-convert $< > $@ + .gitignore: Makefile echo "# DO NOT EDIT, this file is automatically made by \`Makefile'" >$@ echo '# ' >> '$@' -- cgit v1.2.3 From a7d01d7e2d8af20a4dd5ea5b15b1a2be197d10cd Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 6 Oct 2011 20:48:19 -0700 Subject: I ran magit to make my small commit, but noticed that apparently I hadn't commited in a while. So here. --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index aad371c..c782b9b 100644 --- a/Makefile +++ b/Makefile @@ -11,11 +11,12 @@ srcfiles = \ Makefile \ logo-style.scss.php \ license.txt \ - css_shadow.php + css_shadow.php \ + twentyeleven-fix.scss all: header.php style.css img/swoosh.png .gitignore -style.css: logo-style.scss +style.css: logo-style.scss twentyeleven-fix.scss %: %.patch ../twentyeleven/% $(RM) $@ @@ -29,7 +30,7 @@ style.css: logo-style.scss $(PHP) -f $< > $@ %.png: %.svg - rsvg-convert $< > $@ + rsvg-convert $< > $@.$$$$ && pngcrush $@.$$$$ $@ ; $(RM) $@.$$$$ .gitignore: Makefile echo "# DO NOT EDIT, this file is automatically made by \`Makefile'" >$@ -- cgit v1.2.3 From 592e7b2b8213cc74e7bcf812cbee7c6db812757d Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 27 Nov 2011 13:39:16 -0500 Subject: fix a few issues in Makefile * find the correct php executable * don't ignore .gitignore * fix problems with .gitignore and directories --- Makefile | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c782b9b..f0eb157 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,13 @@ +pathsearch = $(firstword $(wildcard $(addsuffix /$(1),$(subst :, ,$(PATH))))) + RM = rm -f CP = cp PATCH = patch SASS = sass -PHP = php5 +PHP := $(firstword $(call pathsearch,php5) $(call pathsearch,php)) srcfiles = \ + .gitignore \ img/swoosh.svg \ style.scss \ header.php.patch \ @@ -32,10 +35,21 @@ style.css: logo-style.scss twentyeleven-fix.scss %.png: %.svg rsvg-convert $< > $@.$$$$ && pngcrush $@.$$$$ $@ ; $(RM) $@.$$$$ + +in_dir = $(patsubst ./%,%,$(dir $1)) +my_dir = $(patsubst %/,%,$(dir $1)) +define gitignore_file +$(if $(in_dir), + $(call gitignore_file,$(my_dir)) + echo '$(my_dir)/*' >> '$@'; +) +echo '!$1' >> '$@'; +endef + .gitignore: Makefile echo "# DO NOT EDIT, this file is automatically made by \`Makefile'" >$@ echo '# ' >> '$@' echo '# ignore everyting' >> '$@' echo '*' >> '$@' echo '# but these:' >> '$@' - for file in $(srcfiles); do echo !"$$file" >> '$@'; done + $(foreach file,$(srcfiles),$(call gitignore_file,$(file))) -- cgit v1.2.3 From 7d6044395bdf9dbd4b06251f5e78c1016937e627 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 27 Nov 2011 15:24:25 -0500 Subject: move non-generic things into theme.mk, add `clean' and `distclean' rules --- Makefile | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) (limited to 'Makefile') 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: ; -- cgit v1.2.3 From 2b3122be7616032cef4be342b19395d0d59b3ff4 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 27 Nov 2011 15:24:56 -0500 Subject: turn rsvg-convert and pngcrush into variables --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 6f3ba14..e60e170 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ CP = cp PATCH = patch SASS = sass PHP := $(firstword $(call pathsearch,php5) $(call pathsearch,php)) +SVG2PNG = rsvg-convert +PNGCRUSH = $(firstword $(call pathsearch,pngcrush) $(call pathsearch,cp)) default: all @@ -25,7 +27,7 @@ all: .gitignore $(targets) $(PHP) -f $< > $@ %.png: %.svg - rsvg-convert $< > $@.$$$$ && pngcrush $@.$$$$ $@ ; $(RM) $@.$$$$ + $(SVG2PNG) $< > $@.$$$$ && $(PNGCRUSH) $@.$$$$ $@ ; $(RM) $@.$$$$ ################################################################################ -- cgit v1.2.3 From 44adf924df39a350f6a620331cf35e75954fdd6e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 27 Nov 2011 15:27:48 -0500 Subject: whoops, now .gitignore has to also depend on theme.mk --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e60e170..b17979b 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ $(if $(in_dir), echo '!$1' >> '$@'; endef -.gitignore: Makefile +.gitignore: Makefile theme.mk echo "# DO NOT EDIT, this file is automatically made by \`Makefile'" >$@ echo '# ' >> '$@' echo '# ignore everyting' >> '$@' -- cgit v1.2.3