diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 46 |
1 files changed, 6 insertions, 40 deletions
@@ -18,8 +18,10 @@ NUMRUNS?=10 PROG?=$(BUILDDIR)/src/cmark BENCHINP?=README.md JSMODULES=$(wildcard js/lib/*.js) +VERSION?=$(SPECVERSION) +RELEASE?=CommonMark-$(VERSION) -.PHONY: all spec leakcheck clean fuzztest dingus upload jshint test testjs benchjs update-site upload-site check npm debug mingw archive tarball ziparchive testarchive testtarball testziparchive testlib bench astyle +.PHONY: all spec leakcheck clean fuzztest dingus upload jshint test testjs benchjs update-site upload-site check npm debug mingw archive tarball ziparchive testtarball testziparchive testlib bench astyle all: $(PROG) man/man3/cmark.3 @echo "Binaries can be found in $(BUILDDIR)/src" @@ -53,28 +55,9 @@ mingw: man/man3/cmark.3: src/cmark.h | $(PROG) python3 man/make_man_page.py $< > $@ \ -archive: spec.html - @rm -rf $(PKGDIR); \ - mkdir -p $(PKGDIR)/$(SRCDIR) \ - $(PKGDIR)/api_test $(PKGDIR)/man/man1 $(PKGDIR)/man/man3 \ - $(PKGDIR)/test $(PKGDIR)/data ; \ - srcfiles=`git ls-tree --full-tree -r HEAD --name-only $(SRCDIR) test api_test`; \ - for f in $$srcfiles; \ - do cp -a $$f $(PKGDIR)/$$f; \ - done; \ - cp -a $(SRCDIR)/scanners.c $(PKGDIR)/$(SRCDIR)/; \ - cp -a man/CMakeLists.txt man/make_man_page.py $(PKGDIR)/man;\ - cp -a man/man1/cmark.1 $(PKGDIR)/man/man1;\ - cp -a man/man3/cmark.3 $(PKGDIR)/man/man3;\ - cp -a data/CaseFolding-3.2.0.txt $(PKGDIR)/data/;\ - cp CMakeLists.txt $(PKGDIR); \ - perl -ne '$$p++ if /^### JavaScript/; print if (!$$p)' Makefile > $(PKGDIR)/Makefile; \ - cp -a Makefile.nmake nmake.bat $(PKGDIR); \ - cp -a README.md COPYING spec.txt spec.html $(PKGDIR)/; \ - tar czf $(TARBALL) $(PKGDIR); \ - zip -q -r $(ZIPARCHIVE) $(PKGDIR); \ - rm -rf $(PKGDIR) ; \ - echo "Created $(TARBALL) and $(ZIPARCHIVE)." +archive: + git archive --prefix=$(RELEASE)/ -o $(RELEASE).tar.gz HEAD + git archive --prefix=$(RELEASE)/ -o $(RELEASE).zip HEAD clean: rm -rf $(BUILDDIR) $(MINGW_BUILDDIR) $(MINGW_INSTALLDIR) $(TARBALL) $(ZIPARCHIVE) $(PKGDIR) @@ -102,23 +85,6 @@ $(TARBALL): archive $(ZIPARCHIVE): archive -testarchive: testtarball testziparchive - rm -rf $(PKGDIR) - -testtarball: $(TARBALL) - rm -rf $(PKGDIR); \ - tar xvzf $(TARBALL); \ - cd $(PKGDIR); \ - mkdir build && cd build && cmake .. && make -j2 && \ - (ctest || (cat build/Testing/Temporary/LastTest.log && exit 1)) - -testziparchive: $(ZIPARCHIVE) - rm -rf $(PKGDIR); \ - unzip $(ZIPARCHIVE); \ - cd $(PKGDIR); \ - mkdir build && cd build && cmake .. && make -j2 && \ - (ctest || (cat build/Testing/Temporary/LastTest.log && exit 1)) - $(ALLTESTS): spec.txt python3 test/spec_tests.py --spec $< --dump-tests | python3 -c 'import json; import sys; tests = json.loads(sys.stdin.read()); print("\n".join([test["markdown"] for test in tests]))' > $@ |