2 # Makefile to prepare releases and run tests
5 .PHONY
: all clean check dist dist-all dist-bzip2 dist-gzip dist-zip distcheck
12 @echo Building nothing
- no binaries
15 @echo Cleaning nothing
- no binaries
18 dist dist-all
: distdir dist-bzip2 dist-gzip dist-zip
23 VERSION
=luajson-
$(shell git describe
--abbrev
=4 HEAD
2>/dev
/null
)
25 git archive
--format
=tar --prefix=$(VERSION
)/ HEAD | bzip2
-9v
> $(DIST_DIR
)/$(VERSION
).
tar.bz2
27 git archive
--format
=tar --prefix=$(VERSION
)/ HEAD | gzip
-9v
> $(DIST_DIR
)/$(VERSION
).
tar.gz
29 git archive
--format
=zip
--prefix=$(VERSION
)/ HEAD
> $(DIST_DIR
)/$(VERSION
).zip
31 # Config to make sure that Lua uses the contained Lua code
32 LUA_PATH_SETUP
=LUA_PATH
="?/init.lua;../lua/?.lua;../lua/?/init.lua;$(LUA_PATH);"
33 LUA_SETUP
=LUA_OLD_INIT
="$(LUA_INIT)" LUA_INIT
="@hook_require.lua" $(LUA_PATH_SETUP
)
35 cd tests
&& $(LUA_SETUP
) lua regressionTest.lua
37 cd tests
&& $(LUA_SETUP
) lunit lunit-
*.lua
38 check: check-regression check-unit
43 tar -C tmp
-xf
$(DIST_DIR
)/$(VERSION
).
tar.bz2
44 cd tmp
/$(VERSION
) && make
check