diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2025-03-14 09:23:23 +0100 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2025-03-14 09:23:23 +0100 |
commit | 536a64557c82c350fd73ea64c6d4dd1737896579 (patch) | |
tree | d90e1f2ba846090be20242925182ee5208828e15 /Makefile | |
parent | c39cb92325ba7280dae175ec5a32a97d0668981e (diff) | |
download | lanes-536a64557c82c350fd73ea64c6d4dd1737896579.tar.gz lanes-536a64557c82c350fd73ea64c6d4dd1737896579.tar.bz2 lanes-536a64557c82c350fd73ea64c6d4dd1737896579.zip |
More makefile tweaks
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 25 |
1 files changed, 13 insertions, 12 deletions
@@ -47,39 +47,40 @@ $(info _UNITTEST_TARGET: $(_UNITTEST_TARGET)) | |||
47 | _DUE_TARGET := deep_userdata_example/deep_userdata_example.$(_SO) | 47 | _DUE_TARGET := deep_userdata_example/deep_userdata_example.$(_SO) |
48 | $(info _DUE_TARGET: $(_DUE_TARGET)) | 48 | $(info _DUE_TARGET: $(_DUE_TARGET)) |
49 | 49 | ||
50 | _PREFIX := LUA_CPATH="./src/?.$(_SO)" LUA_PATH="./src/?.lua;./tests/?.lua" | 50 | # setup LUA_PATH and LUA_CPATH so that requiring lanes and deep_userdata_example work without having to install them |
51 | _PREFIX := LUA_CPATH="./src/?.$(_SO);./deep_userdata_example/?.$(_SO)" LUA_PATH="./src/?.lua;./tests/?.lua" | ||
51 | 52 | ||
52 | .PHONY: all unit_tests | 53 | .PHONY: all build_lanes build_unit_tests build_DUE |
53 | 54 | ||
54 | # only build lanes itself by default | 55 | # only build lanes itself by default |
55 | all: $(_LANES_TARGET) | 56 | all: build_lanes |
56 | |||
57 | # build the unit_tests and the side deep_userdata_example module | ||
58 | # also run the test that shows whether lanes is successfully loaded or not | ||
59 | unit_tests: $(_UNITTEST_TARGET) $(_DUE_TARGET) | ||
60 | cd deep_userdata_example && $(MAKE) -f DUE.makefile LUA_LIBDIR=$(LUA_LIBDIR) install | ||
61 | $(_UNITTEST_TARGET) "lanes.require 'lanes'" | ||
62 | 57 | ||
63 | #--- | 58 | #--- |
64 | 59 | ||
65 | $(_LANES_TARGET): src/*.lua src/*.cpp src/*.h src/*.hpp | 60 | build_lanes: |
66 | @echo ========================================================================================= | 61 | @echo ========================================================================================= |
67 | cd src && $(MAKE) -f Lanes.makefile LUA=$(LUA) | 62 | cd src && $(MAKE) -f Lanes.makefile LUA=$(LUA) |
68 | @echo ==================== $(_LANES_TARGET): DONE! | 63 | @echo ==================== $(_LANES_TARGET): DONE! |
69 | @echo | 64 | @echo |
70 | 65 | ||
71 | $(_UNITTEST_TARGET): $(_LANES_TARGET) | 66 | build_unit_tests: |
72 | @echo ========================================================================================= | 67 | @echo ========================================================================================= |
73 | cd unit_tests && $(MAKE) -f UnitTests.makefile | 68 | cd unit_tests && $(MAKE) -f UnitTests.makefile |
74 | @echo ==================== $(_UNITTEST_TARGET): DONE! | 69 | @echo ==================== $(_UNITTEST_TARGET): DONE! |
75 | @echo | 70 | @echo |
76 | 71 | ||
77 | $(_DUE_TARGET): | 72 | build_DUE: |
78 | @echo ========================================================================================= | 73 | @echo ========================================================================================= |
79 | cd deep_userdata_example && $(MAKE) -f DUE.makefile | 74 | cd deep_userdata_example && $(MAKE) -f DUE.makefile |
80 | @echo ==================== $(_DUE_TARGET): DONE! | 75 | @echo ==================== $(_DUE_TARGET): DONE! |
81 | @echo | 76 | @echo |
82 | 77 | ||
78 | # build the unit_tests and the side deep_userdata_example module | ||
79 | # also run a test that shows whether lanes is successfully loaded or not | ||
80 | run_unit_tests: build_lanes build_unit_tests build_DUE | ||
81 | @echo ========================================================================================= | ||
82 | $(_PREFIX) $(_UNITTEST_TARGET) "lanes.require 'lanes'" | ||
83 | |||
83 | clean: | 84 | clean: |
84 | cd src && $(MAKE) -f Lanes.makefile clean | 85 | cd src && $(MAKE) -f Lanes.makefile clean |
85 | cd unit_tests && $(MAKE) -f UnitTests.makefile clean | 86 | cd unit_tests && $(MAKE) -f UnitTests.makefile clean |