diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2025-03-13 16:09:03 +0100 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2025-03-13 16:09:03 +0100 |
commit | 24c8215fa05142cc2461efacc1187ef443450af9 (patch) | |
tree | cf03c78028abc7f0c0973328f9580e5acc7b4cc9 /src/Makefile | |
parent | 3ad53d3db2215aa50517a646296b9c25cb3155e3 (diff) | |
download | lanes-24c8215fa05142cc2461efacc1187ef443450af9.tar.gz lanes-24c8215fa05142cc2461efacc1187ef443450af9.tar.bz2 lanes-24c8215fa05142cc2461efacc1187ef443450af9.zip |
More work on Makefiles
* renamed makefiles:
- Shared.mk → Shared.makefile
- src/Makefile → src/Lanes.makefile
- unit_tests/Makefile → unit_tests/UnitTests.makefile
- deep_userdata_example/Makefile → deep_userdata_example/DUE.makefile
* Add a makefile for deep_userdata_example
* added a target 'unit_tests' to build them (not running them yet)
* plus some minor internal improvements
Diffstat (limited to 'src/Makefile')
-rw-r--r-- | src/Makefile | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/src/Makefile b/src/Makefile deleted file mode 100644 index 39b98e6..0000000 --- a/src/Makefile +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | # | ||
2 | # Lanes/src/Makefile | ||
3 | # | ||
4 | # make Manual build | ||
5 | # make LUAROCKS=1 CFLAGS=... LIBFLAG=... LuaRocks automated build | ||
6 | # | ||
7 | |||
8 | include ../Shared.mk | ||
9 | |||
10 | MODULE=lanes | ||
11 | |||
12 | CC:= g++ -std=c++20 | ||
13 | |||
14 | SRC:=$(wildcard *.cpp) | ||
15 | |||
16 | OBJ:=$(SRC:.cpp=.o) | ||
17 | |||
18 | |||
19 | MODULE_DIR=$(MODULE) | ||
20 | |||
21 | #--- | ||
22 | all: $(MODULE)/core.$(_SO) | ||
23 | |||
24 | _pch.hpp.gch: _pch.hpp | ||
25 | $(CC) $(CFLAGS) -x c++-header _pch.hpp -o _pch.hpp.gch | ||
26 | |||
27 | %.o: %.cpp _pch.hpp.gch *.h *.hpp Makefile | ||
28 | $(CC) $(CFLAGS) -c $< | ||
29 | |||
30 | # Note: Don't put $(LUA_LIBS) ahead of $^; MSYS will not like that (I think) | ||
31 | # | ||
32 | $(MODULE_DIR)/core.$(_SO): $(OBJ) | ||
33 | mkdir -p $(MODULE_DIR) | ||
34 | $(CC) $(LIBFLAG) $^ $(LIBS) $(LUA_LIBS) -o $@ | ||
35 | |||
36 | clean: | ||
37 | -rm -rf $(MODULE)/core.$(_SO) *.o *.map *.gch | ||
38 | |||
39 | #--- | ||
40 | # NSLU2 "slug" Linux ARM | ||
41 | # | ||
42 | nslu2: | ||
43 | $(MAKE) all CFLAGS="$(CFLAGS) -I/opt/include -L/opt/lib -D_GNU_SOURCE -lpthread" | ||
44 | |||
45 | #--- | ||
46 | # Cross compiling to Win32 (MinGW on OS X Intel) | ||
47 | # | ||
48 | # Point WIN32_LUA51 to an extraction of LuaBinaries dll8 and dev packages. | ||
49 | # | ||
50 | # Note: Only works on platforms with same endianess (i.e. not from PowerPC OS X, | ||
51 | # since 'luac' uses the host endianess) | ||
52 | # | ||
53 | # EXPERIMENTAL; NOT TESTED OF LATE. | ||
54 | # | ||
55 | MINGW_GCC=mingw32-gcc | ||
56 | # i686-pc-mingw32-gcc | ||
57 | |||
58 | win32: $(WIN32_LUA51)/include/lua.h | ||
59 | $(MAKE) build CC=$(MINGW_GCC) \ | ||
60 | LUA_FLAGS=-I$(WIN32_LUA51)/include \ | ||
61 | LUA_LIBS="-L$(WIN32_LUA51) -llua51" \ | ||
62 | _SO=dll \ | ||
63 | SO_FLAGS=-shared | ||
64 | |||
65 | $(WIN32_LUA51)/include/lua.h: | ||
66 | @echo "Usage: make win32 WIN32_LUA51=<path of extracted LuaBinaries dll8 and dev packages>" | ||
67 | @echo " [MINGW_GCC=...mingw32-gcc]" | ||
68 | @false | ||
69 | |||
70 | .PHONY: all clean nslu2 win32 | ||