Changed/added files to automatically build local menus

svn path=/trunk/; revision=11491
This commit is contained in:
rolf_camps 2008-12-07 01:49:05 +00:00
parent 3744f75510
commit 99215f7040
2 changed files with 25 additions and 0 deletions

23
Make_local_menus Normal file
View File

@ -0,0 +1,23 @@
HELPERFILE := menuhelper
SELECT := '<localmenu.*</localmenu>'
STYLESHEET := ./tools/buildmenu.xsl
FIND := ./\(.*/\)\?\(\w*\)\.\([a-z][a-z]\)\.xhtml:[ \t]*\(.*\)
REPLACE := <menuitem language="\3"><dir>\1</dir><link>\2.html</link>\4</menuitem>
sources := $(shell grep -l -R --include='*.xhtml' $(SELECT) . )
.PHONY: all
all: localmenuinfo.xml
localmenuinfo.xml: $(sources)
rm -f $(HELPERFILE)
echo \<localmenuset\> > $(HELPERFILE)
grep -R --include='*.xhtml' $(SELECT) .| sed -e 's,$(FIND),$(REPLACE),' >> $(HELPERFILE)
echo \</localmenuset\> >> $(HELPERFILE)
xsltproc -o $@ $(STYLESHEET) $(HELPERFILE)
rm -f $(HELPERFILE)

View File

@ -1,5 +1,7 @@
subdirs := $(shell find */* -name "Makefile" | xargs --max-args=1 dirname)
include Make_local_menus
.PHONY: subdirs $(subdirs)
subdirs: $(subdirs)