Skip to content
This repository was archived by the owner on Mar 1, 2018. It is now read-only.

Commit 7e8c8a1

Browse files
committed
Support Linux
1 parent c0ead51 commit 7e8c8a1

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/bin/libNailgunTest.jnilib
1+
/bin/libNailgunTest.*
22
/bin/NailgunTest.class
33
/closure-compiler/
44
/nailgun/

Makefile

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1-
install: bin/libNailgunTest.jnilib closure-compiler nailgun
1+
UNAME_S := $(shell uname -s)
2+
ifeq ($(UNAME_S),Linux)
3+
OUTFILE = libNailgunTest.so
4+
CCFLAGS = -fPIC -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux
5+
endif
6+
ifeq ($(UNAME_S),Darwin)
7+
OUTFILE = libNailgunTest.jnilib
8+
CCFLAGS = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/darwin
9+
endif
10+
11+
install: bin/$(OUTFILE) closure-compiler nailgun
12+
13+
bin/$(OUTFILE):
14+
cd bin && javac NailgunTest.java && gcc NailgunTest.c -shared -o $(OUTFILE) $(CCFLAGS)
215

3-
bin/libNailgunTest.jnilib:
4-
cd bin && javac NailgunTest.java && gcc NailgunTest.c -shared -o libNailgunTest.jnilib -I${JAVA_HOME}/include -I${JAVA_HOME}/include/darwin
516
closure-compiler:
617
rm -fr temp
718
mkdir temp
@@ -21,4 +32,4 @@ nailgun:
2132
rm -fr temp
2233

2334
clean:
24-
rm -rf bin/libNailgunTest.jnilib bin/libNailgunTest.class closure-compiler nailgun temp
35+
rm -rf bin/$(OUTFILE) bin/NailgunTest.class closure-compiler nailgun temp

0 commit comments

Comments
 (0)