Makefile (1693B)
1 NAME = divzero 2 TARG = /var/www/$(NAME) 3 BASE = "/" 4 #BASE = "$(PWD)/" # uncomment for devel only 5 6 MENUPAGES = home.html lectures.html guides.html radio.html links.html donations.html 7 PAGES = $(MENUPAGES) \ 8 lectures/lecture0.html \ 9 lectures/lecture1.html \ 10 lectures/lecture2.html \ 11 guides/openvpn.html \ 12 guides/icecast.html \ 13 guides/git.html \ 14 guides/sunsparc.html \ 15 guides/proxy.html \ 16 guides/trunk.html \ 17 guides/ipsec.html \ 18 guides/netbsd-linode.html \ 19 guides/rpi-tv.html \ 20 guides/irix-sgi-o2.html \ 21 guides/openbsd-httpd-cgit.html \ 22 guides/openbsd-gateway.html \ 23 guides/openbsd-dedibox.html \ 24 guides/irc-notify.html 25 EXTRA = css divzerokey.png favicon.ico index.html \ 26 lectures/resources 27 28 all: $(PAGES) 29 ln -sf home.html index.html 30 31 package: all 32 tar -cvzf $(NAME).tar.gz $(PAGES) $(EXTRA) 33 34 install: package 35 mkdir -p $(TARG) 36 tar -xzf $(NAME).tar.gz -C $(TARG) 37 38 clean: 39 rm -f $(PAGES) $(NAME).tar.gz index.html 40 41 .SUFFIXES: .dhtml .shtml .md .html 42 43 DHEADER = header.dhtml 44 DFOOTER = footer.dhtml 45 SHEADER = header.shtml 46 SFOOTER = footer.shtml 47 48 .shtml.html: $(DHEADER) $(DFOOTER) 49 cat $(DHEADER) | ./config.sh $@ $(BASE) $(MENUPAGES) > $(SHEADER) 50 cat $(DFOOTER) | ./config.sh $@ $(BASE) $(MENUPAGES) > $(SFOOTER) 51 cat $(SHEADER) $< $(SFOOTER) > $@ 52 rm $(SHEADER) $(SFOOTER) 53 54 .md.html: $(DHEADER) $(DFOOTER) 55 cat $(DHEADER) | ./config.sh $@ $(BASE) $(MENUPAGES) > $(SHEADER) 56 cat $(DFOOTER) | ./config.sh $@ $(BASE) $(MENUPAGES) > $(SFOOTER) 57 markdown_py $< | cat $(SHEADER) - $(SFOOTER) > $@ 58 rm $(SHEADER) $(SFOOTER) 59 60 .PHONY: all package install clean