.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.en.xml localmenuinfo.en.xml: $(sources) $(STYLESHEET) echo \ > $(HELPERFILE) grep -R --include='*.xhtml' $(SELECT) .| sed -e 's,$(FIND),$(REPLACE),' >> $(HELPERFILE) echo \ >> $(HELPERFILE) xsltproc -o $@ $(STYLESHEET) $(HELPERFILE) rm $(HELPERFILE)