-
Notifications
You must be signed in to change notification settings - Fork 30
/
Makefile
56 lines (42 loc) · 1.57 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
DFHACKVER ?= 0.44.12-r2
DFVERNUM = `echo $(DFHACKVER) | sed -e s/-.*// -e s/\\\\.//g`
TWBT_VER ?= "6.xx"
DF ?= /Users/vit/Downloads/df_44_12_osx
DH ?= /Users/vit/Downloads/buildagent/workspace/root/dfhack/0.44
SRC = twbt.cpp
DEP = renderer.hpp config.hpp dungeonmode.hpp dwarfmode.hpp renderer_twbt.h commands.hpp plugin.hpp tileupdate_text.hpp tileupdate_map.hpp patches.hpp zoomfix.hpp buildings.hpp items.hpp units.hpp Makefile legacy/renderer_legacy.hpp legacy/twbt_legacy.hpp
ifeq ($(shell uname -s), Darwin)
ifneq (,$(findstring 0.34,$(DFHACKVER)))
EXT = so
else
EXT = dylib
endif
else
EXT = so
endif
OUT = dist/$(DFHACKVER)/twbt.plug.$(EXT)
INC = -I"$(DH)/library/include" -I"$(DH)/library/proto" -I"$(DH)/depends/protobuf" -I"$(DH)/depends/lua/include"
LIB = -L"$(DH)/build/library" -ldfhack -ldfhack-version
CXX ?= c++
CFLAGS = $(INC) -m64 -DLINUX_BUILD -O3 -D_GLIBCXX_USE_CXX11_ABI=0
LDFLAGS = $(LIB) -shared
ifeq ($(shell uname -s), Darwin)
export MACOSX_DEPLOYMENT_TARGET=10.6
CXX = g++-7
CFLAGS += -std=gnu++0x #-stdlib=libstdc++
CFLAGS += -Wno-tautological-compare -I/usr/local/include
LDFLAGS += -framework OpenGL -mmacosx-version-min=10.6 -undefined dynamic_lookup
else
CFLAGS += -std=c++0x -fPIC
endif
all: $(OUT)
$(OUT): $(SRC) $(DEP)
-@mkdir -p `dirname $(OUT)`
$(CXX) $(SRC) -o $(OUT) -DDFHACK_VERSION=\"$(DFHACKVER)\" -DDF_$(DFVERNUM) -DTWBT_VER=\"$(TWBT_VER)\" $(CFLAGS) $(LDFLAGS)
inst: $(OUT)
cp $(OUT) "$(DF)/hack/plugins/"
inst_all:
make inst
cd plugins && DFHACKVER=$(DFHACKVER) DF=$(DF) DH=$(DH) PLUGIN=mousequery make inst
clean:
-rm $(OUT)