mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
move platform.mk out from makefile
This commit is contained in:
34
platform.mk
Normal file
34
platform.mk
Normal file
@@ -0,0 +1,34 @@
|
||||
PLAT ?= none
|
||||
PLATS = linux freebsd macosx
|
||||
|
||||
CC ?= gcc
|
||||
|
||||
.PHONY : none $(PLATS) clean all
|
||||
|
||||
ifneq ($(PLAT), none)
|
||||
|
||||
.PHONY : default
|
||||
|
||||
default :
|
||||
$(MAKE) $(PLAT)
|
||||
|
||||
endif
|
||||
|
||||
none :
|
||||
@echo "Please do 'make PLATFORM' where PLATFORM is one of these:"
|
||||
@echo " $(PLATS)"
|
||||
|
||||
LIBS := -lpthread -lm
|
||||
SHARED := -fPIC --shared
|
||||
EXPORT := -Wl,-E
|
||||
|
||||
$(PLATS) : all
|
||||
|
||||
linux : PLAT = linux
|
||||
macosx : PLAT = macosx
|
||||
freebsd : PLAT = freebsd
|
||||
|
||||
macosx linux : LIBS += -ldl
|
||||
macosx : SHARED := -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup
|
||||
macosx : EXPORT :=
|
||||
linux freebsd : LIBS += -lrt
|
||||
Reference in New Issue
Block a user