aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2025-03-13 16:09:03 +0100
committerBenoit Germain <benoit.germain@ubisoft.com>2025-03-13 16:09:03 +0100
commit24c8215fa05142cc2461efacc1187ef443450af9 (patch)
treecf03c78028abc7f0c0973328f9580e5acc7b4cc9 /src/Makefile
parent3ad53d3db2215aa50517a646296b9c25cb3155e3 (diff)
downloadlanes-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/Makefile70
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
8include ../Shared.mk
9
10MODULE=lanes
11
12CC:= g++ -std=c++20
13
14SRC:=$(wildcard *.cpp)
15
16OBJ:=$(SRC:.cpp=.o)
17
18
19MODULE_DIR=$(MODULE)
20
21#---
22all: $(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
36clean:
37 -rm -rf $(MODULE)/core.$(_SO) *.o *.map *.gch
38
39#---
40# NSLU2 "slug" Linux ARM
41#
42nslu2:
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#
55MINGW_GCC=mingw32-gcc
56# i686-pc-mingw32-gcc
57
58win32: $(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