aboutsummaryrefslogtreecommitdiff
path: root/Makefile.nmake
blob: 0436bc6154e2d4086385a3dc748b427346bec0d7 (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. perl runtests.pl $(SPEC) $(PROG)
  30. testlib: $(SPEC) all
  31. perl runtests.pl $(SPEC) .\wrapper.py
  32. distclean: clean
  33. del /q src\scanners.c 2> nul
  34. del /q spec.md spec.html 2> nul
  35. ### Spec ###
  36. spec.md: $(SPEC)
  37. perl spec2md.pl < $? > $@
  38. spec.html: spec.md template.html
  39. pandoc --no-highlight --number-sections --template template.html -s --toc -S $? | \
  40. perl -pe "s/a href=\"@([^"]*)\"/a id=\"\\1\" href=\"#\\1\" class=\"definition\"/g" | \
  41. perl -pe "s/\\x{2423}/<span class=\"space\"> <\\/span>/g" \
  42. > $@
  43. spec.pdf: spec.md template.tex specfilter.hs
  44. pandoc -s $? --template template.tex \
  45. --filter specfilter.hs -o $@ --latex-engine=xelatex --toc \
  46. --number-sections -V documentclass=report -V tocdepth=2 \
  47. -V classoption=twosides