GNUmakefile 688 B

123456789101112131415161718192021222324252627282930313233
  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. RM := $(if $(PS1),rm -f,del /Q /F)
  12. .PHONY: all check $(LANGS) $(CHECKS) clean
  13. all: $(LANGS) ;
  14. check: $(CHECKS) ;
  15. define lang_template =
  16. $(1): $(1).html ;
  17. $(1).html: html.xsl $(1)/*.xml
  18. cd $(1) && $(XSLTPROC) ../html.xsl index.xml > ../$$@
  19. check-$(1):
  20. cd $(1) && $(XMLVALIDATOR) index.xml
  21. endef
  22. $(foreach lang,$(LANGS),$(eval $(call lang_template,$(lang))))
  23. clean:
  24. -$(RM) *.html