aboutsummaryrefslogtreecommitdiff
path: root/Makefile.nmake
blob: 3f3bbce889e81cd3792d2d7a5424fe272d1022aa (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. test: $(SPEC) all
  27. @pushd $(BUILDDIR) && $(MAKE) /nologo test ARGS="-V" && popd
  28. distclean: clean
  29. del /q src\scanners.c 2> nul
  30. del /q spec.md spec.html 2> nul
  31. ### Spec ###
  32. spec.html: spec.txt template.html $(PROG)
  33. python3 makespec.py html > $@
  34. spec.md: spec.txt
  35. python3 makespec.py markdown > $@
  36. spec.pdf: spec.md template.tex specfilter.hs
  37. pandoc -s $< --template template.tex \
  38. --filter ./specfilter.hs -o $@ --latex-engine=xelatex --toc \
  39. --number-sections -V documentclass=report -V tocdepth=2 \
  40. -V classoption=twosides