From 28f175a6d63a20ebf2c783e8990ec6a0176f5871 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 --- .gitignore | 3 ++ Makefile | 18 ++++++++-- img/swoosh.svg | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+), 2 deletions(-) create mode 100644 img/swoosh.svg diff --git a/.gitignore b/.gitignore index 639f69d..3c706a1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,9 @@ # ignore everyting * # but these: +!.gitignore +!img +img/* !img/swoosh.svg !style.scss !header.php.patch 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))) diff --git a/img/swoosh.svg b/img/swoosh.svg new file mode 100644 index 0000000..7c47d78 --- /dev/null +++ b/img/swoosh.svg @@ -0,0 +1,107 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + -- cgit v1.2.3