Source files of fsfe.org, pdfreaders.org, freeyourandroid.org, ilovefs.org, drm.info, and test.fsfe.org. Contribute: https://fsfe.org/contribute/web/
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.

Makefile 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. .PHONY: all
  2. all: subdirs localmenus date_today SOURCEUPDATES
  3. # -----------------------------------------------------------------------------
  4. # Dive into subdirectories
  5. # -----------------------------------------------------------------------------
  6. SUBDIRS := $(shell find */* -name "Makefile" | xargs --max-args=1 dirname)
  7. .PHONY: subdirs $(SUBDIRS)
  8. subdirs: $(SUBDIRS)
  9. $(SUBDIRS):
  10. $(MAKE) -k -C $@ || true
  11. # -----------------------------------------------------------------------------
  12. # Handle local menus
  13. # -----------------------------------------------------------------------------
  14. HELPERFILE := menuhelper
  15. SELECT := '<localmenu.*</localmenu>'
  16. STYLESHEET := ./tools/buildmenu.xsl
  17. FIND := ./\(.*/\)*\(.*\)\.\([a-z][a-z]\)\.xhtml:[ \t]*\(.*\)
  18. REPLACE := <menuitem language="\3"><dir>/\1</dir><link>\2.html</link>\4</menuitem>
  19. sources := $(shell grep -l -R --include='*.xhtml' $(SELECT) . )
  20. .PHONY: localmenus
  21. localmenus: localmenuinfo.en.xml
  22. localmenuinfo.en.xml: $(sources) $(STYLESHEET)
  23. echo \<localmenuset\> > $(HELPERFILE)
  24. grep -R --include='*.xhtml' $(SELECT) .| sed -e 's,$(FIND),$(REPLACE),' >> $(HELPERFILE)
  25. echo \</localmenuset\> >> $(HELPERFILE)
  26. xsltproc -o $@ $(STYLESHEET) $(HELPERFILE)
  27. rm $(HELPERFILE)
  28. YEAR := <?xml version="1.0" encoding="utf-8"?><dateset><date year="$(shell date +%Y)" /></dateset>
  29. MONTH := <?xml version="1.0" encoding="utf-8"?><dateset><date month="$(shell date +%Y-%m)" /></dateset>
  30. DAY := <?xml version="1.0" encoding="utf-8"?><dateset><date day="$(shell date +%Y-%m-%d)" /></dateset>
  31. .PHONY: date_today d_day.en.xml
  32. date_today: d_year.en.xml d_month.en.xml d_day.en.xml
  33. d_day.en.xml:
  34. grep -q '$(DAY)' $@ || echo '$(DAY)' >$@
  35. d_month.en.xml: d_day.en.xml
  36. grep -q '$(MONTH)' $@ || echo '$(MONTH)' >$@
  37. d_year.en.xml: d_month.en.xml
  38. grep -q '$(YEAR)' $@ || echo '$(YEAR)' >$@
  39. .PHONY: SOURCEUPDATES
  40. SOURCEUPDATES: $(shell find ./ -name '*.sources')
  41. SOURCEREQS = $(shell ./build/source_globber.sh sourceglobs $@ |sed -r 's;$$;.??.xml;g')
  42. SOURCEDIRS = $(shell sed -rn 's;^(.*/)[^/]*:(\[\]|global)$$;\1;gp' $@)
  43. .SECONDEXPANSION:
  44. %.sources: $$(SOURCEREQS)
  45. touch $@
  46. %.sources: $$(SOURCEDIRS)
  47. touch $@