forked from stackimpact/stackimpact-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (24 loc) · 688 Bytes
/
Makefile
File metadata and controls
31 lines (24 loc) · 688 Bytes
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
CPP=g++
CPPFLAGS=-O2 -std=c++11 -fno-omit-frame-pointer
INCLUDES=-I$(JAVA_HOME)/include
JAVAC=$(JAVA_HOME)/bin/javac
JAR=$(JAVA_HOME)/bin/jar
OS:=$(shell uname -s)
ifeq ($(OS), Darwin)
CPPFLAGS += -Wl,-undefined,dynamic_lookup
INCLUDES += -I$(JAVA_HOME)/include/darwin
OS_TAG=macos
else
CPPFLAGS += -static-libstdc++
INCLUDES += -I$(JAVA_HOME)/include/linux
OS_TAG=linux
endif
LIB_VERSION=1.0.6
LIB_NAME=libstackimpact-$(LIB_VERSION)-$(OS_TAG)-x64.so
.PHONY: test build clean
build: src/*.cpp src/*.h
mkdir -p build
rm -f build/libstackimpact-*-$(OS_TAG)-x64.so
$(CPP) $(CPPFLAGS) $(INCLUDES) -fPIC -shared -o build/$(LIB_NAME) src/*.cpp -ldl -lpthread
test: build
clean: