aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-11-12 12:26:40 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-11-12 12:26:40 -0800
commitc4047377582bfcd33c882b0126a234e7c30a2fb6 (patch)
tree2f50f38a2992648afc7e328fbb751e1bb9fcac44 /Makefile
parent7df8355125c1cf660093e1ebcf8f52d15423e23e (diff)
Improved tarball and testtarball targets.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 17 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index be45867..a608fc3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,16 @@
SRCDIR?=src
DATADIR?=data
-BENCHINP?=README.md
-JSMODULES=$(wildcard js/lib/*.js)
+BUILDDIR?=build
SPEC=spec.txt
SITE=_site
-PKGDIR=cmark-$(SPECVERSION)
-BUILDDIR=build
+PKGDIR?=cmark-$(SPECVERSION)
+SRCFILES=$(shell git ls-tree --full-tree -r HEAD --name-only $(SRCDIR))
+TARBALL?=cmark-$(SPECVERSION).tar.gz
FUZZCHARS?=2000000 # for fuzztest
PROG?=$(BUILDDIR)/src/cmark
SPECVERSION=$(shell grep version: $(SPEC) | sed -e 's/version: *//')
+BENCHINP?=README.md
+JSMODULES=$(wildcard js/lib/*.js)
.PHONY: all spec leakcheck clean fuzztest dingus upload jshint test testjs benchjs update-site upload-site check npm debug tarball
@@ -35,13 +37,14 @@ debug:
tarball: spec.html
rm -rf $(PKGDIR); \
mkdir -p $(PKGDIR)/man/man1; \
- cp -r src $(PKGDIR)/; \
+ mkdir -p $(PKGDIR)/$(SRCDIR)/html; \
+ for f in $(SRCFILES); do cp $$f $(PKGDIR)/$$f; done; \
cp spec.html $(PKGDIR); \
cp CMakeLists.txt $(PKGDIR); \
perl -ne '$$p++ if /^### JavaScript/; print if (!$$p)' Makefile > $(PKGDIR)/Makefile; \
cp man/man1/cmark.1 $(PKGDIR)/man/man1/; \
cp README.md LICENSE spec.txt runtests.pl $(PKGDIR)/; \
- tar czf cmark-$(SPECVERSION).tar.gz $(PKGDIR); \
+ tar czf $(TARBALL) $(PKGDIR); \
rm -rf $(PKGDIR)
clean:
@@ -61,6 +64,14 @@ test: $(SPEC)
testlib: $(SPEC)
perl runtests.pl $< ./wrapper.py
+testtarball: $(TARBALL)
+ rm -rf $(PKGDIR); \
+ tar xvzf $(TARBALL); \
+ cd $(PKGDIR); \
+ make && make test; \
+ cd .. ; \
+ rm -rf $(PKGDIR)
+
leakcheck: $(PROG)
cat leakcheck.md | valgrind --leak-check=full --dsymutil=yes $(PROG)