GNUmakefile 651 B

12345678910111213141516171819202122232425262728293031
  1. ################################################################
  2. # GNU Make Makefile. Building the doc using XML-tools
  3. LANGS = en ru
  4. CHECKS := $(addprefix check-,$(LANGS))
  5. # Oracle tools
  6. #XSLTPROC = xsl
  7. #XMLVALIDATOR = xml
  8. # libxml2/libxslt
  9. XSLTPROC = xsltproc
  10. XMLVALIDATOR = xmllint --valid -noout
  11. .PHONY: all check $(LANGS) $(CHECKS) clean
  12. all: $(LANGS) ;
  13. check: $(CHECKS) ;
  14. define lang_template =
  15. $(1): $(1).html ;
  16. $(1).html: html.xsl $(1)/*.xml
  17. (cd $(1) && $(XSLTPROC) ../html.xsl index.xml) > $$@
  18. check-$(1):
  19. cd $(1) && $(XMLVALIDATOR) index.xml
  20. endef
  21. $(foreach lang,$(LANGS),$(eval $(call lang_template,$(lang))))
  22. clean:
  23. rm -rf *.html