alexkarle.com

Source for alexkarle.com
git clone git://git.alexkarle.com/alexkarle.com.git
Log | Files | Refs | README | LICENSE

Makefile (883B) [raw]


      1 # alexkarle.com makefile
      2 DESTDIR = /var/www/htdocs
      3 CFLAGS = -g -O2 -Wall -Wpedantic -Wextra
      4 
      5 # Variables used to determine what to build (and clean)
      6 HTML != find www -name '*.txt' | sed 's@\([^\.]*\)\.txt@\1.html@g'
      7 SETS != find www/jam-tuesday -name '[0-9][0-9][0-9][0-9]-*'
      8 
      9 BUILT = $(HTML) \
     10 	www/atom.xml
     11 
     12 # Top level targets
     13 .PHONY: build
     14 build: $(BUILT)
     15 
     16 .PHONY: jams
     17 jams: www/jam-tuesday/index.html
     18 
     19 .PHONY: install
     20 install: build
     21 	pax -rw www $(DESTDIR)
     22 	gzip -k -f $(DESTDIR)/www/*.html $(DESTDIR)/www/*/*.html
     23 
     24 .PHONY: clean
     25 clean:
     26 	rm -f $(BUILT)
     27 
     28 # Individual files to build
     29 
     30 www/jam-tuesday/index.html: $(SETS) bin/jam-index.sh bin/jam-stats.sh
     31 	./bin/jam-index.sh > $@
     32 
     33 www/atom.xml: $(HTML) bin/genatom.sh
     34 	./bin/genatom.sh > $@
     35 
     36 # Inference rules (*.txt -> *.html)
     37 $(HTML): Makefile bin/genpage www/style.css
     38 
     39 .SUFFIXES: .txt .html
     40 .txt.html:
     41 	./bin/genpage $< > $@