diff options
author | 2015-01-21 16:29:01 -0800 | |
---|---|---|
committer | 2015-01-21 16:29:01 -0800 | |
commit | 96b49557ec34ed52ac067089a9b496b27d9a0218 (patch) | |
tree | e6044dad395e29da34299d87afa7c49985c1d030 /templates/Makefile.template | |
parent | d19d850357e6204484a1e57677705c6b973217db (diff) |
Sort out some more compile flags for Mac
Diffstat (limited to 'templates/Makefile.template')
-rw-r--r-- | templates/Makefile.template | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/templates/Makefile.template b/templates/Makefile.template index beb3a66fd7..b80e80ca81 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -19,6 +19,14 @@ return 'gens/' + m.group(1) + '.pb.cc' %> + +# Basic platform detection +HOST_SYSTEM = $(shell uname | cut -f 1 -d_) +ifeq ($(SYSTEM),) +SYSTEM = $(HOST_SYSTEM) +endif + + # Configurations VALID_CONFIG_opt = 1 @@ -132,10 +140,15 @@ LDFLAGS += $(LDFLAGS_$(CONFIG)) CFLAGS += -std=c89 -pedantic CXXFLAGS += -std=c++11 CPPFLAGS += -g -fPIC -Wall -Werror -Wno-long-long -LDFLAGS += -g -pthread -fPIC +LDFLAGS += -g -fPIC INCLUDES = . include gens +ifeq ($(SYSTEM),Darwin) +LIBS = m z +else LIBS = rt m z pthread +LDFLAGS += -pthread +endif LIBSXX = protobuf LIBS_PROTOC = protoc protobuf @@ -173,11 +186,6 @@ HOST_LDLIBS = $(LDLIBS) # These are automatically computed variables. # There shouldn't be any need to change anything from now on. -HOST_SYSTEM = $(shell uname | cut -f 1 -d_) -ifeq ($(SYSTEM),) -SYSTEM = $(HOST_SYSTEM) -endif - ifeq ($(SYSTEM),MINGW32) SHARED_EXT = dll endif |