-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
54 lines (40 loc) · 1.1 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
UNAME := $(shell uname)
ifndef HASHLINK_SRC
HASHLINK_SRC = ../../../hashlink
endif
LIBHL=libhl.xxx
SDKVER=1.139.2
ifeq ($(UNAME),Darwin)
OS=osx
# universal lib in osx32 dir
LIBARCH=32
FNAME=DevelopmentKit_${SDKVER}_Darwin_universal
LIBHL=libhl.dylib
LFLAG_GALAXY=-lGalaxy
else
OS=linux
LIBARCH=64
FNAME=DevelopmentKit_${SDKVER}_Linux_GCC92_64bit
LIBHL=libhl.so
LFLAG_GALAXY=-lGalaxy64
endif
SDKVER=1.139.2
#SDKURL="http://cdn.gog.com/open/galaxy/sdk/${SDKVER}/Downloads/${FNAME}.tar.gz"
CFLAGS = -Wall --std=c++11 -O3 -I src -I ../sdk/Include -I native/include -fPIC
LFLAGS = -lhl $(LFLAG_GALAXY) -lstdc++ -L native/lib/$(OS)$(LIBARCH) -L ../sdk/Libraries
SRC = src/common.o
all: ${SRC}
${CC} ${CFLAGS} -shared -o gog.hdll ${SRC} ${LFLAGS}
prepare:
rm -rf native/lib/$(OS)$(LIBARCH)
mkdir -p native/include
mkdir -p native/lib/$(OS)$(LIBARCH)
cp $(HASHLINK_SRC)/src/hl.h native/include/
cp $(HASHLINK_SRC)/$(LIBHL) native/lib/$(OS)$(LIBARCH)/
.SUFFIXES : .cpp .o
.cpp.o :
${CC} ${CFLAGS} -o $@ -c $<
clean_o:
rm -f ${SRC}
clean: clean_o
rm -f gog.hdll