Source files of fsfe.org, pdfreaders.org, freeyourandroid.org, ilovefs.org, drm.info, and test.fsfe.org. Contribute: https://fsfe.org/contribute/web/ https://fsfe.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

47 lines
1.3 KiB

.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 := '<localmenu.*</localmenu>'
STYLESHEET := ./tools/buildmenu.xsl
FIND := ./\(.*/\)*\(.*\)\.\([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: localmenus
localmenus: localmenuinfo.xml
$(HELPERFILE) :
rm -f $(HELPERFILE)
echo \<localmenuset\> > $(HELPERFILE)
grep -R --include='*.xhtml' $(SELECT) .| sed -e 's,$(FIND),$(REPLACE),' >> $(HELPERFILE)
echo \</localmenuset\> >> $(HELPERFILE)
localmenuinfo.xml: $(HELPERFILE) $(sources)
xsltproc -o $@ $(STYLESHEET) $(HELPERFILE)
rm -f $(HELPERFILE)
%.html : %.xhtml $(HELPERFILE)
perl tools/bogus-build.pl $< | xsltproc -o $@ fsfeurope.xsl -