forked from DragonLi-Mi/JavaCallCSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (23 loc) · 860 Bytes
/
Makefile
File metadata and controls
30 lines (23 loc) · 860 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
OS_NAME = $(shell uname -s)
ifeq ($(OS_NAME), Darwin)
CXX = g++-6
ifeq (, $(shell which $(CPP)))
$(error "$(CPP) not found! You need to install gcc 6 to build this!")
endif
else
CXX = g++
endif
CXXFLAGS = -Wall -std=c++14 -m64 -fPIC
LDLIBS = -ldl -lstdc++fs
JAVALIB= -I/usr/lib/jvm/java-9-openjdk-amd64/include -I/usr/lib/jvm/java-9-openjdk-amd64/include/linux/
.PHONY: all clean
all: tar.so Makefile
tar.so: CoreCLRHost.cpp CoreCLRHost.hpp utils.hpp Sample1.h Makefile
git -C dynamicLinker pull || git clone https://github.com/Marqin/dynamicLinker
make -C dynamicLinker CXX=$(CXX)
$(CXX) $(JAVALIB) $(CXXFLAGS) CoreCLRHost.cpp -shared -o tar.so -LdynamicLinker/ -ldynamicLinker $(LDLIBS)
clean:
rm -rf tar.so
sh -c "stat dynamicLinker/ &> /dev/null && make -C dynamicLinker clean" || true
distclean: clean
rm -rf dynamicLinker/