base: fixes travis
[luajson.git] / Makefile
blob37a7e22b42175e216834b9bde716ef4b997d195e
2 # Makefile to prepare releases and run tests
5 .PHONY: all clean check dist dist-all dist-bzip2 dist-gzip dist-zip distcheck
7 DIST_DIR=dist
8 LUA_BIN=lua
9 LUNIT_BIN=lunit
12 all:
13 @echo Building nothing - no binaries
15 clean:
16 @echo Cleaning nothing - no binaries
19 dist dist-all: distdir dist-bzip2 dist-gzip dist-zip
21 distdir:
22 mkdir -p dist
24 VERSION=luajson-$(shell git describe --abbrev=4 HEAD 2>/dev/null)
25 dist-bzip2: distdir
26 git archive --format=tar --prefix=$(VERSION)/ HEAD | bzip2 -9v > $(DIST_DIR)/$(VERSION).tar.bz2
27 dist-gzip: distdir
28 git archive --format=tar --prefix=$(VERSION)/ HEAD | gzip -9v > $(DIST_DIR)/$(VERSION).tar.gz
29 dist-zip: distdir
30 git archive --format=zip --prefix=$(VERSION)/ HEAD > $(DIST_DIR)/$(VERSION).zip
32 # Config to make sure that Lua uses the contained Lua code
33 LUA_PATH_SETUP=LUA_PATH="?/init.lua;../lua/?.lua;../lua/?/init.lua;$(LUA_PATH);"
34 LUA_SETUP=LUA_OLD_INIT="$(LUA_INIT)" LUA_INIT="@hook_require.lua" $(LUA_PATH_SETUP)
35 check-regression:
36 cd tests && $(LUA_SETUP) lua regressionTest.lua
37 check-unit:
38 cd tests && $(LUA_SETUP) $(LUNIT_BIN) --interpreter $(LUA_BIN) lunit-*.lua
40 check: check-regression check-unit
43 distcheck: dist-bzip2
44 mkdir -p tmp
45 tar -C tmp -xf $(DIST_DIR)/$(VERSION).tar.bz2
46 cd tmp/$(VERSION) && make check
47 rm -rf tmp