#This requires GNU Make and may use lots of specific features! #Steffen Dettmer -- GPL may be applied WML=/usr/bin/wml WMLOPTS=-DBASE~`pwd` -D WML_GEN_USERNAME=steffen -D "WML_GEN_REALNAME=Steffen Dettmer" -D "WML_SRC_REALNAME=Steffen Dettmer" -D WML_SRC_USERNAME=steffen #This rule makes `all' recursive if SUBDIRS is defined (automake-alike) all: all-recursive all-recursive: @DIRS="$(SUBDIRS)" ; \ if [ ! -z "$$DIRS" ] ; then \ for dir in $$DIRS ; do \ make -C "$$dir" all || exit 5; \ done ; \ fi clean: clean-recursive clean-recursive: @DIRS="$(SUBDIRS)" ; \ if [ ! -z "$$DIRS" ] ; then \ for dir in $$DIRS ; do \ make -C "$$dir" clean || exit 5; \ done \ fi #create file lists #contains all .jpg files: JPEGS=$(shell ls *.jpg) #contains small/LO.jpg for EACH .jpg (from JPEGS) # $(patsubst %.o,%.c,$(objects)) JPEG_SMALL=$(patsubst %.jpg,small/%LO.jpg, $(JPEGS)) #contains a HTML file .html for EACH JPEG file (from JPEGS) # patsubst?? Or even shorter! this: "$(objects:.o=.c)" # (http://cip.physik.uni-wuerzburg.de/virtualmanuals/root-doku/make/make_74.html) JPEG_PAGES=$(JPEGS:.jpg=.html) #A rule to create a thumbnail automatically from a JPEG file small/%LO.jpg: %.jpg @#thumbnail creation: @test -d small || mkdir small @echo "Creating thumbnail small/$*LO.jpg" convert -size 120 +profile "*" -resize 120 -quality 75 $*.jpg small/$*LO.jpg #A rule to create a HTML wrapper for a JPEG to get rudimentary scaling support %.html: %.jpg jpg_page.wml @#a page around image; this is the same idea as in: @#echo '' > $@ @#but somewhat more nice :) $(WML) -DNAME=$* -DFILE=$< $(WMLOPTS) -o $@ jpg_page.wml #Generic WML --> HTML rule with simple syntax check %.html: %.wml @#make deps $(WML) -MD -o $@ $< $(WML) -DFILE=$* $(WMLOPTS) -o $@ $< @echo -n "checking $@: " @cat $@ \ | tidy -q -e 2>&1 @echo "OK"