Source files of fsfe.org, pdfreaders.org, freeyourandroid.org, ilovefs.org, drm.info, and test.fsfe.org. Contribute: https://fsfe.org/contribute/web/
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

Makefile 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. .PHONY: all .FORCE
  2. .FORCE:
  3. all:
  4. # -----------------------------------------------------------------------------
  5. # Dive into subdirectories
  6. # -----------------------------------------------------------------------------
  7. SUBDIRS := $(shell find */* -name "Makefile" | xargs dirname)
  8. $(SUBDIRS): .FORCE
  9. $(MAKE) -j -k -C $@ || true
  10. all: $(SUBDIRS)
  11. # -----------------------------------------------------------------------------
  12. # Handle local menus
  13. # -----------------------------------------------------------------------------
  14. MENUSOURCES := $(shell find -name '*.xhtml' |xargs grep -l '<localmenu.*</localmenu>' )
  15. localmenuinfo.en.xml: ./tools/buildmenu.xsl $(MENUSOURCES)
  16. { printf '<localmenuset>'; \
  17. grep -E '<localmenu.*</localmenu>' $^ \
  18. | sed -r 's;(.*/)?(.+)\.([a-z][a-z])\.xhtml:(.+);\
  19. <menuitem language="\3"><dir>/\1</dir><link>\2.html</link>\4</menuitem>;'; \
  20. printf '</localmenuset>'; \
  21. } | xsltproc -o $@ $< -
  22. all: localmenuinfo.en.xml
  23. # -----------------------------------------------------------------------------
  24. # Timestamp files for regular jobs and XML inclusion in various places
  25. # -----------------------------------------------------------------------------
  26. YEAR := <?xml version="1.0" encoding="utf-8"?><dateset><date year="$(shell date +%Y)" /></dateset>
  27. MONTH := <?xml version="1.0" encoding="utf-8"?><dateset><date month="$(shell date +%Y-%m)" /></dateset>
  28. DAY := <?xml version="1.0" encoding="utf-8"?><dateset><date day="$(shell date +%Y-%m-%d)" /></dateset>
  29. d_day.en.xml: $(if $(findstring $(DAY),$(shell cat d_day.en.xml)),,.FORCE)
  30. printf %s\\n '$(DAY)' >$@
  31. d_month.en.xml: $(if $(findstring $(MONTH),$(shell cat d_month.en.xml)),,.FORCE)
  32. printf %s\\n '$(MONTH)' >$@
  33. d_year.en.xml: $(if $(findstring $(YEAR),$(shell cat d_year.en.xml)),,.FORCE)
  34. printf %s\\n '$(YEAR)' >$@
  35. all: d_year.en.xml d_month.en.xml d_day.en.xml
  36. # -----------------------------------------------------------------------------
  37. # Update .sources files
  38. # -----------------------------------------------------------------------------
  39. # use shell globbing to work around faulty globbing in gnu make
  40. SOURCEDIRS = $(shell sed -rn 's;^(.*/)[^/]*:(\[\]|global)$$;\1;gp' $@ )
  41. SOURCEREQS = $(shell ./build/source_globber.sh sourceglobs $@ |sed 's;$$;.??.xml;g' )
  42. all: $(shell find ./ -name '*.sources')
  43. # -----------------------------------------------------------------------------
  44. # generate tag maps
  45. # -----------------------------------------------------------------------------
  46. TAGMAP := $(shell find ./ -name '*.xml' \
  47. | xargs ./build/source_globber.sh map_tags \
  48. | sed -r "s;';'\'';g; s;[^ ]+;'&';g;" \
  49. )
  50. TAGNAMES := $(shell printf '%s\n' $(TAGMAP) \
  51. | sed '/\...\.xml$$/d' \
  52. | grep -vE '[\$%/:()]' \
  53. | sort -u \
  54. )
  55. MAPNAMES := $(shell printf 'tools/tagmaps/%s.map ' $(TAGNAMES))
  56. INDEXNAMES := $(shell printf 'tags/tagged-%s.en.xhtml ' $(TAGNAMES))
  57. INDEXSOURCES := $(shell printf 'tags/tagged-%s.sources ' $(TAGNAMES))
  58. all: $(INDEXNAMES)
  59. tags/tagged-%.en.xhtml: tags/tagged.en.xhtml
  60. cp $< $@
  61. all: $(INDEXSOURCES)
  62. tags/tagged-%.sources:
  63. printf '%s:[$*]\n' 'news/*/news' news/generated_xml/ news/nl/nl 'events/*/event' >$@
  64. printf 'd_day:[]' >>$@
  65. MAPREQS = $(shell printf '%s ' $(TAGMAP) \
  66. | sed -r 's;[^ ]+\...\.xml;\n&;g' \
  67. | grep ' $*' \
  68. | cut -d' ' -f1 \
  69. )
  70. all: $(MAPNAMES)
  71. # -----------------------------------------------------------------------------
  72. # Second Expansion rules
  73. # -----------------------------------------------------------------------------
  74. .SECONDEXPANSION:
  75. %.sources: $$(SOURCEDIRS) $$(SOURCEREQS) | $(MAPNAMES) $(INDEXSOURCES)
  76. touch $@
  77. tools/tagmaps/%.map: $$(MAPREQS) | $(SUBDIRS)
  78. printf '%s\n' $^ > $@