-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathmakefile.macosx
50 lines (39 loc) · 1.25 KB
/
makefile.macosx
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
OUT_PATH = lib
SRC_PATH = jni
INC_PATH = $(SRC_PATH)/include
ifneq ($(PREFIX),)
INSTALL_DIR = $(DESTDIR)$(PREFIX)
else
INSTALL_DIR = $(DESTDIR)/usr/local
endif
ifeq ($(LIBDIR),)
LIBDIR=lib
endif
ifeq ($(INSTALL),)
INSTALL=install
endif
ifeq ($(WOLFSSL_LIBNAME),)
WOLFSSL_LIBNAME=wolfssl
endif
OBJ_LIST = jni_fips.o jni_native_struct.o jni_pwdbased.o jni_aes.o \
jni_aesgcm.o jni_des3.o jni_md5.o jni_sha.o jni_hmac.o jni_rng.o \
jni_rsa.o jni_dh.o jni_ecc.o jni_ed25519.o jni_curve25519.o \
jni_chacha.o jni_error.o jni_asn.o jni_logging.o \
jni_feature_detect.o jni_wolfobject.o jni_wolfcrypt.o \
jni_wolfssl_cert_manager.o jni_jce_wolfsslkeystore.o
OBJS = $(patsubst %,$(OUT_PATH)/%,$(OBJ_LIST))
TARGET = $(OUT_PATH)/libwolfcryptjni.dylib
JAVA_HOME ?= $(shell /usr/libexec/java_home)
CC = gcc
override CCFLAGS += -Wall -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/darwin \
-I$(INC_PATH) -I$(INSTALL_DIR)/include
override LDFLAGS += -dynamiclib -L$(INSTALL_DIR)/$(LIBDIR) -l$(WOLFSSL_LIBNAME)
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $^
$(OUT_PATH)/%.o: $(SRC_PATH)/%.c
@mkdir -p $(OUT_PATH)
$(CC) $(CCFLAGS) -c -o $@ $<
.PHONY: clean
clean:
rm -f $(OUT_PATH)/*.o $(TARGET)