-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathplatform.mk
More file actions
41 lines (28 loc) · 925 Bytes
/
platform.mk
File metadata and controls
41 lines (28 loc) · 925 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
31
32
33
34
35
36
37
38
39
40
41
# PLAT ?= none
PLAT ?= linux
PLATS = linux freebsd macosx
CC ?= gcc
.PHONY : none $(PLATS)
#ifneq ($(PLAT), none)
.PHONY : default
default :
$(MAKE) $(PLAT)
#endif
none :
@echo "Please do 'make PLATFORM' where PLATFORM is one of these:"
@echo " $(PLATS)"
BNH_LIBS := -pthread -lm
SHARED := -fPIC --shared
linux : PLAT = linux
macosx : PLAT = macosx
freebsd : PLAT = freebsd
macosx : SHARED := -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup
macosx linux : BNH_LIBS += -ldl
linux freebsd : BNH_LIBS += -lrt
linux freebsd : CJSON_DEP :=
macosx : CJSON_DEP :=CJSON_LDFLAGS='-bundle -undefined dynamic_lookup'\
FPCONV_OBJS='g_fmt.o dtoa.o'
linux freebsd : OPEN_SSL_LIB :=
macosx : OPEN_SSL_LIB :=-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib
linux macosx freebsd :
$(MAKE) all PLAT=$(PLAT) BNH_LIBS="$(BNH_LIBS)" SHARED="$(SHARED)" CJSON_DEP="$(CJSON_DEP)" OPEN_SSL_LIB="$(OPEN_SSL_LIB)"