aboutsummaryrefslogtreecommitdiff
path: root/Makefile.nmake
blob: 54034c40d3c253b0fc526372089b7103d71749a4 (plain)
  1. SRCDIR=src
  2. DATADIR=data
  3. BUILDDIR=build
  4. INSTALLDIR=windows
  5. SPEC=spec.txt
  6. PROG=$(BUILDDIR)\src\cmark.exe
  7. GENERATOR=NMake Makefiles
  8. all: $(BUILDDIR)
  9. @pushd $(BUILDDIR) && $(MAKE) /nologo && popd
  10. $(BUILDDIR):
  11. @cmake --version > nul || (echo "You need cmake to build this program: http://www.cmake.org/download/" && exit 1)
  12. -mkdir $(BUILDDIR) 2> nul
  13. pushd $(BUILDDIR) && \
  14. cmake \
  15. -G "$(GENERATOR)" \
  16. -D CMAKE_BUILD_TYPE=$(BUILD_TYPE) \
  17. -D CMAKE_INSTALL_PREFIX=$(INSTALLDIR) \
  18. .. && \
  19. popd
  20. install: all
  21. @pushd $(BUILDDIR) && $(MAKE) /nologo install && popd
  22. clean:
  23. -rmdir /s /q $(BUILDDIR) $(MINGW_INSTALLDIR) 2> nul
  24. $(SRCDIR)\case_fold_switch.inc: $(DATADIR)\CaseFolding-3.2.0.txt
  25. perl mkcasefold.pl < $? > $@
  26. man\man1\cmark.1: man\cmark.1.md
  27. pandoc $? -o $@ -s -t man
  28. test: $(SPEC) all
  29. @pushd $(BUILDDIR) && $(MAKE) /nologo test ARGS="-V" && popd
  30. distclean: clean
  31. del /q src\scanners.c 2> nul
  32. del /q spec.md spec.html 2> nul
  33. ### Spec ###
  34. spec.md: $(SPEC)
  35. perl spec2md.pl < $? > $@
  36. spec.html: spec.md template.html
  37. pandoc --no-highlight --number-sections --template template.html -s --toc -S $? | \
  38. perl -pe "s/a href=\"@([^"]*)\"/a id=\"\\1\" href=\"#\\1\" class=\"definition\"/g" | \
  39. perl -pe "s/\\x{2423}/<span class=\"space\"> <\\/span>/g" \
  40. > $@
  41. spec.pdf: spec.md template.tex specfilter.hs
  42. pandoc -s $? --template template.tex \
  43. --filter specfilter.hs -o $@ --latex-engine=xelatex --toc \
  44. --number-sections -V documentclass=report -V tocdepth=2 \
  45. -V classoption=twosides