Files
fsfe-website/Makefile
T

41 lines
1.2 KiB
Makefile
Raw Normal View History

2008-12-08 17:54:36 +00:00
.PHONY: all
2008-12-08 17:54:36 +00:00
all: subdirs localmenus
2008-12-08 17:54:36 +00:00
# -----------------------------------------------------------------------------
# Dive into subdirectories
# -----------------------------------------------------------------------------
2008-12-08 17:54:36 +00:00
SUBDIRS := $(shell find */* -name "Makefile" | xargs --max-args=1 dirname)
2008-12-08 17:54:36 +00:00
.PHONY: subdirs $(SUBDIRS)
subdirs: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@
2008-12-08 17:54:36 +00:00
# -----------------------------------------------------------------------------
# Handle local menus
# -----------------------------------------------------------------------------
HELPERFILE := menuhelper
SELECT := '<localmenu.*</localmenu>'
STYLESHEET := ./tools/buildmenu.xsl
2008-12-09 20:40:40 +00:00
FIND := ./\(.*/\)*\(.*\)\.\([a-z][a-z]\)\.xhtml:[ \t]*\(.*\)
2015-10-29 15:43:28 +00:00
REPLACE := <menuitem language="\3"><dir>/\1</dir><link>\2.html</link>\4</menuitem>
2008-12-08 17:54:36 +00:00
sources := $(shell grep -l -R --include='*.xhtml' $(SELECT) . )
.PHONY: localmenus
localmenus: localmenuinfo.en.xml
2008-12-08 17:54:36 +00:00
2015-10-29 15:43:28 +00:00
localmenuinfo.en.xml: $(sources) $(STYLESHEET)
2008-12-08 17:54:36 +00:00
echo \<localmenuset\> > $(HELPERFILE)
grep -R --include='*.xhtml' $(SELECT) .| sed -e 's,$(FIND),$(REPLACE),' >> $(HELPERFILE)
echo \</localmenuset\> >> $(HELPERFILE)
xsltproc -o $@ $(STYLESHEET) $(HELPERFILE)
rm $(HELPERFILE)