summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorNicolas Noble <nnoble@blizzard.com>2013-07-15 15:34:52 -0700
committerNicolas Noble <nnoble@blizzard.com>2013-07-15 15:34:52 -0700
commit702750622512b31e1805ee90cc598c428690d8a1 (patch)
tree1de108b3648d5d51da378bf88a48c8342a44da34 /Makefile
parenta9b37ee02ae425e7292d784675ad77812dfb9c23 (diff)
Simplifying Makefile into common.mk for general purpose code.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile50
1 files changed, 1 insertions, 49 deletions
diff --git a/Makefile b/Makefile
index ded238e..7ae4df2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,20 +1,4 @@
-ifeq ($(SYSTEM),)
- SYSTEM := $(shell uname | cut -f 1 -d_)
-endif
-
-TRUESYSTEM := $(shell uname)
-MACHINE := $(shell uname -m)
-DISTRIB := $(shell cat /etc/issue | cut -f 1 -d\ | head -1)
-
-CC = gcc
-CXX = g++
-LD = g++
-AS = gcc -c
-AR = ar rcs
-
-BINEXT = bin
-
-CPPFLAGS += -fno-strict-aliasing
+include common.mk
ifeq ($(DEBUG),)
CPPFLAGS += -g -O3 -DNDEBUG
@@ -29,50 +13,18 @@ LIBS = z
DEFINES = _LARGEFILE64_SOURCE
ifeq ($(SYSTEM),Darwin)
- CC = clang
- CXX = clang++
- CPPFLAGS += -fPIC
- LDFLAGS += -fPIC
LIBS += pthread iconv
CONFIG_H = darwin-config.h
- ARCH_FLAGS =
- LD = clang++
- STRIP = strip -x
endif
ifeq ($(SYSTEM),Linux)
- CPPFLAGS += -fPIC
- LDFLAGS += -fPIC -rdynamic
LIBS += pthread dl
CONFIG_H = linux-config.h
- ARCH_FLAGS =
- ASFLAGS =
- STRIP = strip --strip-unneeded
-
- GCC_VERSION := $(shell g++ -dumpversion)
- GCC_VERSION_4 := $(shell expr `g++ -dumpversion | cut -f1 -d.` \>= 4)
- GCC_VERSION_x_8 := $(shell expr `g++ -dumpversion | cut -f2 -d.` >= 8)
-
- ifneq ($(GCC_VERSION_4),1)
- USE_CLANG = true
- else
- ifneq ($(GCC_VERSION_x_8),1)
- USE_CLANG = true
- endif
- endif
-
- ifeq ($(USE_CLANG),true)
- CC = clang
- CXX = clang++
- LD = clang++
- endif
endif
CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) -fexceptions -imacros $(CONFIG_H)
CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) $(addprefix -D, $(DEFINES))
-CXXFLAGS += -Wno-deprecated -std=c++11
-
LDFLAGS += $(ARCH_FLAGS)
LDLIBS = $(addprefix -l, $(LIBS))