web

A collection of scripts used to generate this website
git clone https://erai.gay/code/web/
Log | Files | Refs | LICENSE

Makefile (754B)


      1 SOURCES:=$(shell \
      2 	find \
      3 		. \
      4 		-not \( \
      5 			\( \
      6 				-name .git \
      7 				-or -name build \
      8 			\) -prune \
      9 		\) \
     10 		\( \
     11 			-name '*.ico' \
     12 			-or -name '*.png' \
     13 			-or -name '*.jpg' \
     14 			-or -name '*.html' \
     15 			-or -name '*.txt' \
     16 		\) \
     17 )
     18 TARGETS:=$(SOURCES:%=build/%)
     19 TARGETS+=build/sitemap.txt
     20 
     21 all: $(TARGETS)
     22 
     23 clean:
     24 	rm -rf build/
     25 
     26 .PHONY: all clean
     27 .SUFFIXES:
     28 
     29 build/%.html: %.html render.sh css/style.css
     30 	@mkdir -p $(dir $@)
     31 	./render.sh $< > $@
     32 	@gzip -9fk $@
     33 
     34 build/sitemap.txt: $(SOURCES)
     35 	@mkdir -p $(dir $@)
     36 	@printf 'https://omiltem.net/%s\n' $^ | grep '\.html$$' | sed -e 's/\/index.html$$/\//' > $@
     37 	@echo 'map > sitemap.txt'
     38 
     39 build/%.txt: %.txt
     40 	@mkdir -p $(dir $@)
     41 	cp $< $@
     42 	@gzip -9fk $@
     43 
     44 build/%: %
     45 	@mkdir -p $(dir $@)
     46 	cp $< $@