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.3KB

12345678910111213141516171819202122232425262728293031323334
  1. .PHONY: all .FORCE
  2. .FORCE:
  3. all:
  4. # -----------------------------------------------------------------------------
  5. # remove xml files where original xhtml does not exist anymore
  6. # -----------------------------------------------------------------------------
  7. # note the reversal of target <-> prerequisite relationship
  8. # make will execute thew command for all xhtml files (targets) that
  9. # do not exist, in doing so it will not make the target, but rather
  10. # remove the xml file that generated it
  11. REMOVALS := $(subst ___,/,$(patsubst ./generated_xml/%.xml,../%.xhtml,$(wildcard ./generated_xml/*.xml)))
  12. ../%.xhtml:
  13. rm generated_xml/$(subst /,___,$*).xml
  14. all: $(REMOVALS)
  15. # -----------------------------------------------------------------------------
  16. # build includable xml files from all xhtml files that contain news
  17. # -----------------------------------------------------------------------------
  18. XMLNAMES := $(shell find ../ -name '*.xhtml' \
  19. | xargs grep -l "<html newsdate" \
  20. | sed -r 's;/;___;g; s;^\.\.___(.+)\.xhtml$$;./generated_xml/\1.xml;;' \
  21. )
  22. XMLSOURCE = ../$(subst ___,/,$*).xhtml
  23. all: $(XMLNAMES)
  24. .SECONDEXPANSION:
  25. generated_xml/%.xml: $$(XMLSOURCE) #xhtml2xml.xsl
  26. xsltproc --stringparam link /$(subst ___,/,$(basename $*)).html xhtml2xml.xsl $< > $@