|
|
@@ -4,48 +4,60 @@ |
|
|
|
# Created by falkTX |
|
|
|
# |
|
|
|
|
|
|
|
AR ?= ar |
|
|
|
RM ?= rm -f |
|
|
|
|
|
|
|
CC ?= gcc |
|
|
|
CXX ?= g++ |
|
|
|
|
|
|
|
# -------------------------------------------------------------- |
|
|
|
# Fallback to Linux if no other OS defined |
|
|
|
|
|
|
|
ifneq ($(HAIKU),true) |
|
|
|
ifneq ($(MACOS),true) |
|
|
|
ifneq ($(WIN32),true) |
|
|
|
LINUX=true |
|
|
|
endif |
|
|
|
endif |
|
|
|
endif |
|
|
|
|
|
|
|
# -------------------------------------------------------------- |
|
|
|
# Common build and link flags |
|
|
|
|
|
|
|
BASE_FLAGS = -Wall -Wextra -fPIC -DPIC -pipe -DREAL_BUILD |
|
|
|
BASE_OPTS = -O3 -ffast-math -mtune=generic -msse -msse2 -mfpmath=sse |
|
|
|
BASE_FLAGS = -Wall -Wextra -pipe |
|
|
|
BASE_OPTS = -O2 -ffast-math -mtune=generic -msse -msse2 -mfpmath=sse -fdata-sections -ffunction-sections |
|
|
|
LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections -Wl,--strip-all |
|
|
|
|
|
|
|
ifeq ($(MACOS),true) |
|
|
|
# MacOS linker flags |
|
|
|
LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-dead_strip -Wl,-dead_strip_dylibs |
|
|
|
endif |
|
|
|
|
|
|
|
ifeq ($(RASPPI),true) |
|
|
|
# Raspberry-Pi optimization flags |
|
|
|
BASE_OPTS = -O3 -ffast-math -march=armv6 -mfpu=vfp -mfloat-abi=hard |
|
|
|
BASE_OPTS = -O2 -ffast-math -march=armv6 -mfpu=vfp -mfloat-abi=hard |
|
|
|
LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all |
|
|
|
endif |
|
|
|
|
|
|
|
ifneq ($(WIN32),true) |
|
|
|
# not needed for Windows |
|
|
|
BASE_FLAGS += -fPIC -DPIC |
|
|
|
endif |
|
|
|
|
|
|
|
ifeq ($(DEBUG),true) |
|
|
|
BASE_FLAGS += -DDEBUG -O0 -g |
|
|
|
LINK_OPTS = |
|
|
|
else |
|
|
|
BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden |
|
|
|
CXXFLAGS += -fvisibility-inlines-hidden |
|
|
|
LINK_OPTS += -Wl,--strip-all |
|
|
|
endif |
|
|
|
|
|
|
|
BUILD_C_FLAGS = $(BASE_FLAGS) -std=gnu99 $(CFLAGS) |
|
|
|
BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=gnu++0x $(CXXFLAGS) |
|
|
|
BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) |
|
|
|
BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++0x -std=gnu++0x $(CXXFLAGS) |
|
|
|
LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) |
|
|
|
|
|
|
|
ifeq ($(MACOS),true) |
|
|
|
# Get rid of most options for old gcc4.2 |
|
|
|
# No C++11 support |
|
|
|
BUILD_CXX_FLAGS = $(BASE_FLAGS) $(CXXFLAGS) |
|
|
|
LINK_FLAGS = $(LDFLAGS) |
|
|
|
LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) |
|
|
|
endif |
|
|
|
|
|
|
|
# -------------------------------------------------------------- |
|
|
|