-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (24 loc) · 826 Bytes
/
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
.PHONY: all run
JAVA_HOME := $(shell /usr/libexec/java_home)
all:
@echo "Java Home: ${JAVA_HOME}"
@echo "Cleaning target directory"
@rm -rf target/
@mkdir -p target/lib target/classes
@javac -d ./target/classes $(shell find src/main/java -name "*.java")
@echo "Generating header files"
@javah -o src/main/c/WKHtmlToPdfImpl.h -classpath ./target/classes com.github.inikolaev.WKHtmlToPdf
@echo "Compiling sources"
@gcc -o target/lib/libWKHtmlToPdfJavaBinding.jnilib \
-lc -shared \
-I./src/main/c/ \
-I${JAVA_HOME}/include \
-I${JAVA_HOME}/include/darwin \
-I/usr/local/include/ \
-L/usr/local/lib -lwkhtmltox \
./src/main/c/WKHtmlToPdfImpl.c
@echo "Done"
run:
@echo "Running example"
@java -Djava.library.path=./target/lib -cp ./target/classes examples.WKHtmlToPdfExample
@echo "Done"