-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.vars
78 lines (65 loc) · 2.13 KB
/
Makefile.vars
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
ifndef JAVA_HOME
$(error Set JAVA_HOME environment variable)
endif
ifeq ($(os),)
ifeq ($(shell uname),Darwin)
os := Darwin
endif
ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
os := Win
endif
ifeq ($(findstring MINGW,$(shell uname)),MINGW)
os := Win
endif
endif
ifeq ($(os),)
os := Default
endif
# Windows uses different path separators, because they hate me
ifeq ($(os),Win)
sep := ;
else
sep := :
endif
ifeq ($(arch),)
arch := $(shell uname -m)
endif
ifneq (0,$(shell expr match $(arch) 'i.*86'))
arch := x86
endif
leveldb := leveldb
jleveldb := jleveldb-v$(shell cat VERSION)
libjunit := $(wildcard lib/junit-*.jar)
JAVA := $$JAVA_HOME/bin/java
JAVAC := $$JAVA_HOME/bin/javac -Xbootclasspath/p:$(libjdbc)
java_sources = $(wildcard src/com/anvisics/jleveldb/*.java) $(wildcard src/com/anvisics/jleveldb/ext/*.java)
java_classes = $(java_sources:src/%.java=build/%.class)
java_classlist = $(subst $$,\$$,$(patsubst build/%, %, $(wildcard $(java_classes:%.class=%*))))
test_sources = $(wildcard src/test/*.java)
test_classes = $(test_sources:src/%.java=build/%.class)
tests = $(subst /,.,$(patsubst build/%.class,%,$(test_classes)))
# os=Default is meant to be generic unix/linux
Default_CC := gcc
Default_STRIP := strip
Default_CFLAGS := -c -fpic -I$(JAVA_HOME)/include
Default_LINKFLAGS := -shared
Default_LIBNAME := jleveldb-linux-$(arch).lib
Support10_4 := -isysroot /Developer/SDKs/MacOSX10.4u.sdk
Darwin_CC := gcc -arch $(arch) -mmacosx-version-min=10.4 $(Support10_4)
Darwin_STRIP := strip -x
Darwin_CFLAGS := -c fpic -I$(JAVA_HOME)/include
Darwin_LINKFLAGS := -dynamiclib $(Support10_4)
Darwin_LIBNAME := jleveldb-mac-universal.lib
Win_CC := $(arch)-mingw32msvc-gcc
Win_STRIP := $(arch)-mingw32msvc-strip
Win_CFLAGS := -D_JNI_IMPLEMENTATION_ -Ilib/inc_win -I$(JAVA_HOME)/include -O
Win_LINKFLAGS := -Wl,--kill-at -shared
Win_LIBNAME := jleveldb-win-$(arch).lib
CC := $($(os)_CC)
STRIP := $($(os)_STRIP)
CFLAGS := $($(os)_CFLAGS)
LINKFLAGS := $($(os)_LINKFLAGS)
LIBNAME := $($(os)_LIBNAME)
ifneq ($(jni_include),)
#CFLAGS := $(CFLAGS) -I$(jni_include)
endif