diff options
| author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-10-01 10:50:00 +0200 |
|---|---|---|
| committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-10-01 10:50:00 +0200 |
| commit | 412c497d49acbdb66a92e0a9db6c921e8169cfd2 (patch) | |
| tree | 0eb3a2c429694d3afa07c5c4b0a134734ec5455f /src | |
| parent | 414c9302bdff7bd7900246240acd05666e2692e0 (diff) | |
| download | lanes-412c497d49acbdb66a92e0a9db6c921e8169cfd2.tar.gz lanes-412c497d49acbdb66a92e0a9db6c921e8169cfd2.tar.bz2 lanes-412c497d49acbdb66a92e0a9db6c921e8169cfd2.zip | |
Makefile fixes for g++/mingw
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/Makefile b/src/Makefile index 5c6b016..11bb90b 100644 --- a/src/Makefile +++ b/src/Makefile | |||
| @@ -7,6 +7,8 @@ | |||
| 7 | 7 | ||
| 8 | MODULE=lanes | 8 | MODULE=lanes |
| 9 | 9 | ||
| 10 | CC= g++ -std=c++20 | ||
| 11 | |||
| 10 | SRC=_pch.cpp cancel.cpp compat.cpp deep.cpp intercopycontext.cpp keeper.cpp lane.cpp lanes.cpp linda.cpp lindafactory.cpp nameof.cpp state.cpp threading.cpp tools.cpp tracker.cpp universe.cpp | 12 | SRC=_pch.cpp cancel.cpp compat.cpp deep.cpp intercopycontext.cpp keeper.cpp lane.cpp lanes.cpp linda.cpp lindafactory.cpp nameof.cpp state.cpp threading.cpp tools.cpp tracker.cpp universe.cpp |
| 11 | 13 | ||
| 12 | OBJ=$(SRC:.cpp=.o) | 14 | OBJ=$(SRC:.cpp=.o) |
| @@ -15,7 +17,7 @@ OBJ=$(SRC:.cpp=.o) | |||
| 15 | # | 17 | # |
| 16 | LIBFLAG=-shared | 18 | LIBFLAG=-shared |
| 17 | 19 | ||
| 18 | OPT_FLAGS=-O2 -std=c++20 | 20 | OPT_FLAGS=-O2 |
| 19 | # -O0 -g | 21 | # -O0 -g |
| 20 | 22 | ||
| 21 | _SO=so | 23 | _SO=so |
| @@ -32,10 +34,14 @@ ifeq "$(LUAROCKS)" "" | |||
| 32 | # - %MSCVR80% must be the full pathname of 'msvcr80.dll' | 34 | # - %MSCVR80% must be the full pathname of 'msvcr80.dll' |
| 33 | # | 35 | # |
| 34 | ifeq "$(LUA_DEV)" "" | 36 | ifeq "$(LUA_DEV)" "" |
| 35 | $(error LUA_DEV not defined - try i.e. 'make LUA_DEV=/c/Program\ Files/Lua/5.1') | 37 | $(warning LUA_DEV not defined - try i.e. 'make LUA_DEV=/c/Program\ Files/Lua/5.1') |
| 38 | # this assumes Lua was built and installed from source and everything is located in default folders (/usr/local/include and /usr/local/bin) | ||
| 39 | LUA_FLAGS:=-I "/usr/local/include" | ||
| 40 | LUA_LIBS:=$(word 1,$(shell which lua54.$(_SO)) $(shell which lua53.$(_SO)) $(shell which lua52.$(_SO)) $(shell which lua51$(_SO))) | ||
| 41 | else | ||
| 42 | LUA_FLAGS:=-I "$(LUA_DEV)/include" | ||
| 43 | LUA_LIBS:="$(LUA_DEV)/lua5.1.dll" -lgcc | ||
| 36 | endif | 44 | endif |
| 37 | LUA_FLAGS:=-I "$(LUA_DEV)/include" | ||
| 38 | LUA_LIBS:="$(LUA_DEV)/lua5.1.dll" -lgcc | ||
| 39 | LIBFLAG=-shared -Wl,-Map,lanes.map | 45 | LIBFLAG=-shared -Wl,-Map,lanes.map |
| 40 | else | 46 | else |
| 41 | # Autodetect LUA_FLAGS and/or LUA_LIBS | 47 | # Autodetect LUA_FLAGS and/or LUA_LIBS |
| @@ -119,7 +125,11 @@ MODULE_DIR=$(MODULE) | |||
| 119 | #--- | 125 | #--- |
| 120 | all: $(MODULE)/core.$(_SO) | 126 | all: $(MODULE)/core.$(_SO) |
| 121 | 127 | ||
| 122 | %.o: %.cpp *.h Makefile | 128 | _pch.h.gch: _pch.h |
| 129 | $(CC) $(CFLAGS) -x c++-header _pch.h -o _pch.h.gch | ||
| 130 | |||
| 131 | %.o: %.cpp _pch.h.gch *.h Makefile | ||
| 132 | $(CC) $(CFLAGS) -c $< | ||
| 123 | 133 | ||
| 124 | # Note: Don't put $(LUA_LIBS) ahead of $^; MSYS will not like that (I think) | 134 | # Note: Don't put $(LUA_LIBS) ahead of $^; MSYS will not like that (I think) |
| 125 | # | 135 | # |
