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.

Makefile 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # -----------------------------------------------------------------------------
  2. # Makefile for FSFE website build, preparation for events subdirectory
  3. # -----------------------------------------------------------------------------
  4. .PHONY: all
  5. .SECONDEXPANSION:
  6. # -----------------------------------------------------------------------------
  7. # Copy event archive template to each of the years
  8. # -----------------------------------------------------------------------------
  9. # All years for which a subdirectory exists
  10. ARCH_YEARS := $(sort $(wildcard [0-9][0-9][0-9][0-9]))
  11. # No archive for the current year
  12. ARCH_YEARS := $(filter-out $(lastword $(ARCH_YEARS)),$(ARCH_YEARS))
  13. # ... and the year before
  14. ARCH_YEARS := $(filter-out $(lastword $(ARCH_YEARS)),$(ARCH_YEARS))
  15. # Languages in which the template exists
  16. ARCH_LANGS := $(suffix $(basename $(wildcard archive-template.??.xhtml)))
  17. # .xhtml files to generate
  18. ARCH_XHTML := $(foreach year,$(ARCH_YEARS),$(foreach lang,$(ARCH_LANGS),$(year)/index$(lang).xhtml))
  19. all: $(ARCH_XHTML)
  20. $(ARCH_XHTML): %.xhtml: archive-template$$(suffix $$*).xhtml
  21. @echo "* Creating $@"
  22. @# $(dir $@) returns YYYY/, we abuse the slash for closing the sed command
  23. @sed 's/:YYYY:/$(dir $@)g' $< > $@
  24. # .sources files to generate
  25. ARCH_SOURCES := $(foreach year,$(ARCH_YEARS),$(year)/index.sources)
  26. all: $(ARCH_SOURCES)
  27. $(ARCH_SOURCES): %.sources:
  28. @echo "* Creating $@"
  29. @echo "events/$(dir $@)event-*:[]\nevents/$(dir $@).event-*:[]\nlocalmenuinfo:[]\n" > $@
  30. # .xsl files to generate
  31. ARCH_XSL := $(foreach year,$(ARCH_YEARS),$(year)/index.xsl)
  32. all: $(ARCH_XSL)
  33. $(ARCH_XSL): %.xsl: events.xsl
  34. @echo "* Creating $@"
  35. @sed -r 's/(import href=")/\1..\//; s/(\.\.\/about)/..\/\1/' $< > $@