2 # Makefile to prepare releases and run tests
5 .PHONY
: all clean check dist dist-all dist-bzip2 dist-gzip dist-zip distcheck
13 @echo Building nothing
- no binaries
16 @echo Cleaning nothing
- no binaries
19 dist dist-all
: distdir dist-bzip2 dist-gzip dist-zip
24 VERSION
=luajson-
$(shell git describe
--abbrev
=4 HEAD
2>/dev
/null
)
26 git archive
--format
=tar --prefix=$(VERSION
)/ HEAD | bzip2
-9v
> $(DIST_DIR
)/$(VERSION
).
tar.bz2
28 git archive
--format
=tar --prefix=$(VERSION
)/ HEAD | gzip
-9v
> $(DIST_DIR
)/$(VERSION
).
tar.gz
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
)
36 cd tests
&& $(LUA_SETUP
) lua regressionTest.lua
38 cd tests
&& $(LUA_SETUP
) $(LUNIT_BIN
) --interpreter
$(LUA_BIN
) lunit-
*.lua
40 check: check-regression check-unit
45 tar -C tmp
-xf
$(DIST_DIR
)/$(VERSION
).
tar.bz2
46 cd tmp
/$(VERSION
) && make
check