.PHONY: all all: subdirs localmenus # ----------------------------------------------------------------------------- # Dive into subdirectories # ----------------------------------------------------------------------------- SUBDIRS := $(shell find */* -name "Makefile" | xargs --max-args=1 dirname) .PHONY: subdirs $(SUBDIRS) subdirs: $(SUBDIRS) $(SUBDIRS): $(MAKE) -C $@ # ----------------------------------------------------------------------------- # Handle local menus # ----------------------------------------------------------------------------- HELPERFILE := menuhelper SELECT := '' STYLESHEET := ./tools/buildmenu.xsl FIND := ./\(.*/\)*\(.*\)\.\([a-z][a-z]\)\.xhtml:[ \t]*\(.*\) REPLACE := \1\2.html\4 sources := $(shell grep -l -R --include='*.xhtml' $(SELECT) . ) .PHONY: localmenus localmenus: localmenuinfo.xml $(HELPERFILE) : rm -f $(HELPERFILE) echo \ > $(HELPERFILE) grep -R --include='*.xhtml' $(SELECT) .| sed -e 's,$(FIND),$(REPLACE),' >> $(HELPERFILE) echo \ >> $(HELPERFILE) localmenuinfo.xml: $(HELPERFILE) $(sources) xsltproc -o $@ $(STYLESHEET) $(HELPERFILE) rm -f $(HELPERFILE) %.html : %.xhtml $(HELPERFILE) perl tools/bogus-build.pl $< | xsltproc -o $@ fsfeurope.xsl -