-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (41 loc) · 1.93 KB
/
Makefile
File metadata and controls
60 lines (41 loc) · 1.93 KB
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
57
58
59
60
SHELL = /bin/sh
CC=gcc
LCPP=g++ -v
W64CPP=x86_64-w64-mingw32-g++
W32CPP=i686-w64-mingw32-g++
C64FLAGS = -O3 -m64 -fPIC -pthread -DLINUX -D_LP64=1
W64FLAGS = -O3 -m64 -pthread -DWINDOWS -D_LP64=1
W32FLAGS = -O3 -m32 -pthread -DWINDOWS -D_LP32=1
C32FLAGS = -Wall -O3 -m32 -fPIC -pthread -DLINUX -D_LP32=1
#-fPIC -g #-pedantic -Wall -Wextra -march=native -ggdb3
LDFLAGS = -shared
#LDFLAGS = -static-libgcc -shared -lc
DEBUGFLAGS = -O0 -D _DEBUG
RELEASEFLAGS = -O2 -D NDEBUG -combine -fwhole-program
INCLUDES = -I $(JAVA_HOME)/include -I $(JAVA_HOME)/include/linux
DISTDIR = ./target/native
L64TARGET = -o ${DISTDIR}/linux64/liboifagent.so
L32TARGET = -o ${DISTDIR}/linux32/liboifagent.so
W64TARGET = -o ${DISTDIR}/win64/oifagent.dll
W32TARGET = -o ${DISTDIR}/win32/oifagent.dll
# /usr/bin/i686-w64-mingw32-c++
# /usr/bin/x86_64-w64-mingw32-g++
linux_native-agent-64: ./src/main/cpp/native-agent.cpp distdirl64
${LCPP} ${C64FLAGS} ${LDFLAGS} ${INCLUDES} ${L64TARGET} ./src/main/cpp/native-agent.cpp
linux_native-agent-32: ./src/main/cpp/native-agent.cpp distdirl32
${LCPP} ${C32FLAGS} ${LDFLAGS} ${INCLUDES} ${L32TARGET} ./src/main/cpp/native-agent.cpp
windows_native-agent-64: ./src/main/cpp/native-agent.cpp distdirw64
${W64CPP} ${W64FLAGS} ${LDFLAGS} -static-libstdc++ -static-libgcc ${INCLUDES} ${W64TARGET} ./src/main/cpp/native-agent.cpp
windows_native-agent-32: ./src/main/cpp/native-agent.cpp distdirw32
${W32CPP} ${W32FLAGS} ${LDFLAGS} ${INCLUDES} ${W32TARGET} ./src/main/cpp/native-agent.cpp
all: linux_native-agent-64 linux_native-agent-32 windows_native-agent-64 windows_native-agent-32
distdirl64:
test -d ${DISTDIR}/linux64 || mkdir -p ${DISTDIR}/linux64
distdirl32:
test -d ${DISTDIR}/linux32 || mkdir -p ${DISTDIR}/linux32
distdirw64:
test -d ${DISTDIR}/win64 || mkdir -p ${DISTDIR}/win64
distdirw32:
test -d ${DISTDIR}/win32 || mkdir -p ${DISTDIR}/win32
clean:
rm -rf ./target/native