-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
platform.mk
40 lines (27 loc) · 876 Bytes
/
platform.mk
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
PLAT ?= none
PLATS = linux freebsd macosx
CC ?= gcc
.PHONY : none $(PLATS) clean all cleanall
#ifneq ($(PLAT), none)
.PHONY : default
default :
$(MAKE) $(PLAT)
#endif
none :
@echo "Please do 'make PLATFORM' where PLATFORM is one of these:"
@echo " $(PLATS)"
SKYNET_LIBS := -lpthread -lm
SHARED := -fPIC --shared
EXPORT := -Wl,-E
linux : PLAT = linux
macosx : PLAT = macosx
freebsd : PLAT = freebsd
macosx : SHARED := -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup
macosx : EXPORT :=
macosx linux : SKYNET_LIBS += -ldl
linux freebsd : SKYNET_LIBS += -lrt
# Turn off jemalloc and malloc hook on macosx
macosx : MALLOC_STATICLIB :=
macosx : SKYNET_DEFINES :=-DNOUSE_JEMALLOC
linux macosx freebsd :
$(MAKE) all PLAT=$@ SKYNET_LIBS="$(SKYNET_LIBS)" SHARED="$(SHARED)" EXPORT="$(EXPORT)" MALLOC_STATICLIB="$(MALLOC_STATICLIB)" SKYNET_DEFINES="$(SKYNET_DEFINES)"