2 # Makefile to prepare releases and run tests
5 DISTOPS
= dist distclean dist-all dist-bzip2 dist-gzip dist-tar dist-zip
6 .PHONY
: all clean check $(DISTOPS
) distcheck
install
10 VERSION
=luajson-
$(shell git describe
--abbrev
=4 HEAD
2>/dev
/null
)
14 INSTALL_TOP
= $(PREFIX
)
16 INSTALL_LMOD
= $(INSTALL_TOP
)/share
/lua
/5.1
17 INSTALL_CMOD
= $(INSTALL_TOP
)/lib
/lua
/5.1
20 @echo Building nothing
- no binaries
23 @echo Cleaning nothing
- no binaries
26 $(MAKE
) $(MFLAGS
) -C
dist $@
28 # Config to make sure that Lua uses the contained Lua code
29 LUA_PATH_SETUP
=LUA_PATH
="?/init.lua;../lua/?.lua;../lua/?/init.lua;$(LUA_PATH);"
30 LUA_SETUP
=LUA_OLD_INIT
="$(LUA_INIT)" LUA_INIT
="@hook_require.lua" $(LUA_PATH_SETUP
)
33 cd tests
&& $(LUA_SETUP
) $(LUA_BIN
) regressionTest.lua
35 cd tests
&& $(LUA_SETUP
) $(LUNIT_BIN
) --interpreter
$(LUA_BIN
) lunit-
*.lua
37 check: check-regression check-unit
39 distcheck-tar
: dist-tar
41 tar -C tmp
-xf
dist/$(VERSION
).
tar
42 cd tmp
/$(VERSION
) && make
check
45 distcheck-zip
: dist-zip
47 unzip
-q
-d tmp
dist/$(VERSION
).zip
48 cd tmp
/$(VERSION
) && make
check
51 distcheck
: distcheck-zip distcheck-tar
55 $(MKDIR
) $(DESTDIR
)$(INSTALL_LMOD
)
56 cp
-p
-r lua
/* $(DESTDIR
)$(INSTALL_LMOD
)