vol_files = $(wildcard trainees*.xml) volunteers.xml vol_html = $(foreach file, $(vol_files), $(file:%.xml=%.html)) \ $(foreach file, $(vol_files), $(file:%.xml=%-full.html)) \ $(foreach class, medically_separated interrupted_service honor_roll resigned everyone, ${class}.html ${class}-full.html) \ ../links.html \ everyone-contact.html staff_guide.pdf check_list.pdf author = Will%20Holcomb%20%3Cwill@himinbi.org%3E empty:= space:=$(empty) $(empty) classpath := $(subst $(space),:,$(wildcard ../quarterly_report/fop/*.jar)) JAVA = $(shell readlink -f "$(shell which java)") ifeq ($(JAVA), "") JAVA = /usr/bin/java endif FOP = $(JAVA) -classpath $(classpath) org.apache.fop.apps.Fop # The idea here is that Makefiles in subdirectories with the requested # target take precedence MAKEFILES = $(foreach makefile, \ $(shell find -mindepth 2 -maxdepth 2 -name Makefile), \ $(if $(shell grep -e ^$(MAKECMDGOALS): $(makefile)), $(makefile))) SUBDIRS = $(foreach dir, $(MAKEFILES), $(dir:./%/Makefile=%)) .PHONY: all clean clean sync emails $(SUBDIRS) all: $(vol_html) $(SUBDIRS) $(SUBDIRS): $(MAKE) -C $@ $(if $(MAKEFLAGS), -$(MAKEFLAGS)) $(MAKECMDGOALS) $(vol_html): $(vol_style) volunteers.html: volunteers.xml $(wildcard trainees*.xml) volunteers-html.xslt xsltproc --xinclude \ --stringparam author $(author) \ --stringparam class active \ --stringparam fullfile volunteers-full.html \ $< > $@ volunteers-full.html: volunteers.xml $(wildcard trainees*.xml) volunteers-html.xslt xsltproc --xinclude \ --stringparam author $(author) \ --stringparam class active \ --stringparam type secret \ $< > $@ honor_roll.html: volunteers.xml $(wildcard trainees*.xml) volunteers-html.xslt xsltproc --xinclude \ --stringparam author $(author) \ --stringparam class cos \ --stringparam fullfile honor_roll-full.html \ $< > $@ honor_roll-full.html: volunteers.xml $(wildcard trainees*.xml) volunteers-html.xslt xsltproc --xinclude \ --stringparam author $(author) \ --stringparam class cos \ --stringparam type secret \ $< > $@ resigned.html: volunteers.xml $(wildcard trainees*.xml) volunteers-html.xslt xsltproc --xinclude \ --stringparam author $(author) \ --stringparam class et \ --stringparam fullfile resigned-full.html \ $< > $@ resigned-full.html: volunteers.xml $(wildcard trainees*.xml) volunteers-html.xslt xsltproc --xinclude \ --stringparam author $(author) \ --stringparam class et \ --stringparam type secret \ $< > $@ medically_separated.html: volunteers.xml $(wildcard trainees*.xml) volunteers-html.xslt xsltproc --xinclude \ --stringparam author $(author) \ --stringparam class ms \ --stringparam fullfile medically_separated-full.html \ $< > $@ medically_separated-full.html: volunteers.xml $(wildcard trainees*.xml) volunteers-html.xslt xsltproc --xinclude \ --stringparam author $(author) \ --stringparam class ms \ --stringparam type secret \ $< > $@ interrupted_service.html: volunteers.xml $(wildcard trainees*.xml) volunteers-html.xslt xsltproc --xinclude \ --stringparam author $(author) \ --stringparam class is \ --stringparam fullfile interrupted_service-full.html \ $< > $@ interrupted_service-full.html: volunteers.xml $(wildcard trainees*.xml) volunteers-html.xslt xsltproc --xinclude \ --stringparam author $(author) \ --stringparam class is \ --stringparam type secret \ $< > $@ everyone.html: volunteers.xml $(wildcard trainees*.xml) volunteers-html.xslt xsltproc --xinclude \ --stringparam author $(author) \ --stringparam fullfile everyone-full.html \ $< > $@ everyone-full.html: volunteers.xml $(wildcard trainees*.xml) volunteers-html.xslt xsltproc --xinclude \ --stringparam author $(author) \ --stringparam type secret \ $< > $@ everyone-contact.html: volunteers.xml $(wildcard trainees*.xml) volunteers-html.xslt xsltproc --xinclude \ --stringparam author $(author) \ --stringparam type private \ $< > $@ %.html: %.xml volunteers-html.xslt xsltproc --xinclude \ --stringparam author $(author) \ --stringparam fullfile $*-full.html \ $< > $@ # java -jar $(XALAN) -IN $^ -OUT $@ %-full.html: %.xml volunteers-html.xslt xsltproc --xinclude \ --stringparam author $(author) \ --stringparam type secret \ $< > $@ ../links.html: ../nonvolunteer_links.xhtml ../links.xslt volunteers.xml $(wildcard trainees_*.xml) xsltproc --xinclude ../links.xslt volunteers.xml > $@ # To keep mailman in sync, I sometimes need a list of all the email addresses # of the active volunteers emails: @echo ' \ \ \ \ ' | xsltproc --xinclude - volunteers.xml stagemails: @echo " \ \ \ \ " | xsltproc --xinclude - volunteers.xml staff_guide.fo: staff_guide.docbook volunteers.xml $(wildcard trainees_*.xml) $(wildcard staff/*.xml) staff_guide.xslt xsltproc --xinclude $< > $@ check_list.fo: volunteers.xml $(wildcard trainees_*.xml) check_list.xslt xsltproc --xinclude check_list.xslt $< > $@ %.pdf: %.fo $(FOP) $< $@ clean: @find -name "*~" -or -name ".*~" -or -name "*.html" | xargs $(RM) -v sync: clean $(SUBDIRS) $(RSYNC) $(foreach file, $(vol_html) $(SUBDIRS), --exclude=$(file)) \ . $(RSYNC_DEST) ssh will@himinbi.org make -k -C ~/pcvs.org/mr/