Commit c37c623d4f8ad3ccc4f268161eb9e6b144acf994
1 parent
0067de2a
Better Makefile
Showing
1 changed file
with
8 additions
and
7 deletions
Show diff stats
Makefile
1 | BOOTSTRAPVER=3.3.2 | 1 | BOOTSTRAPVER=3.3.2 |
2 | JQUERYVER=2.1.1 | 2 | JQUERYVER=2.1.1 |
3 | +FONTS=robotech-gp.ttf robotaur.ttf | ||
4 | + | ||
5 | +BOOTSTRAPNEEDED=js/bootstrap.min.js css/bootstrap.min.css fonts/glyphicons-halflings-regular.* | ||
3 | 6 | ||
4 | REDIRS=$(shell cd pages; echo *.php) | 7 | REDIRS=$(shell cd pages; echo *.php) |
5 | BOOTSTRAPNAME=bootstrap-$(BOOTSTRAPVER)-dist | 8 | BOOTSTRAPNAME=bootstrap-$(BOOTSTRAPVER)-dist |
6 | 9 | ||
7 | -all: redirs $(BOOTSTRAPNEEDED) js/jquery.min.js | 10 | +all: redirs $(BOOTSTRAPNEEDED) js/jquery.min.js $(addprefix fonts/,$(FONTS)) |
8 | cd img; make | 11 | cd img; make |
9 | 12 | ||
13 | +# Redirs | ||
10 | %.php: pages/%.php | 14 | %.php: pages/%.php |
11 | echo "<?php require('index.php') ?>" > $@ | 15 | echo "<?php require('index.php') ?>" > $@ |
12 | 16 | ||
@@ -15,15 +19,12 @@ redirs: $(REDIRS) | @@ -15,15 +19,12 @@ redirs: $(REDIRS) | ||
15 | js/jquery.min.js: | 19 | js/jquery.min.js: |
16 | wget http://code.jquery.com/jquery-$(JQUERYVER).min.js -O $@ | 20 | wget http://code.jquery.com/jquery-$(JQUERYVER).min.js -O $@ |
17 | 21 | ||
18 | -bootstrap: | 22 | +$(BOOTSTRAPNEEDED): |
19 | wget https://github.com/twbs/bootstrap/releases/download/v$(BOOTSTRAPVER)/$(BOOTSTRAPNAME).zip -O $(BOOTSTRAPNAME).zip | 23 | wget https://github.com/twbs/bootstrap/releases/download/v$(BOOTSTRAPVER)/$(BOOTSTRAPNAME).zip -O $(BOOTSTRAPNAME).zip |
20 | - unzip $(BOOTSTRAPNAME).zip $(BOOTSTRAPNAME)/fonts/* $(BOOTSTRAPNAME)/css/bootstrap.min.css $(BOOTSTRAPNAME)/js/bootstrap.min.js | 24 | + unzip $(BOOTSTRAPNAME).zip $(addprefix $(BOOTSTRAPNAME),$(BOOTSTRAPNEEDED)) |
21 | cp -rf $(BOOTSTRAPNAME)/* . | 25 | cp -rf $(BOOTSTRAPNAME)/* . |
22 | rm -rf $(BOOTSTRAPNAME)* | 26 | rm -rf $(BOOTSTRAPNAME)* |
23 | 27 | ||
24 | -bootstrapClean: | ||
25 | - rm -rf fonts/glyphicons* */bootstrap* | ||
26 | - | ||
27 | fonts/robotech-gp.ttf: | 28 | fonts/robotech-gp.ttf: |
28 | wget http://dl.dafont.com/dl/?f=robotech_gp -O robotech_gp.zip | 29 | wget http://dl.dafont.com/dl/?f=robotech_gp -O robotech_gp.zip |
29 | unzip robotech_gp.zip ROBOTECH\ GP.ttf | 30 | unzip robotech_gp.zip ROBOTECH\ GP.ttf |
@@ -37,4 +38,4 @@ fonts/robotaur.ttf: | @@ -37,4 +38,4 @@ fonts/robotaur.ttf: | ||
37 | 38 | ||
38 | clean: bootstrapClean | 39 | clean: bootstrapClean |
39 | cd img; make clean | 40 | cd img; make clean |
40 | - rm -rf $(REDIRS) js/jquery.min.js fonts/robot*.ttf | 41 | + rm -rf $(REDIRS) $(BOOTSTRAPNEEDED) $(addprefix fonts/,$(FONTS)) js/jquery.min.js |