Browse Source

Update makefile

gh-pages
falkTX 9 years ago
parent
commit
e7e3e9f2e5
2 changed files with 25 additions and 17 deletions
  1. +5
    -1
      dgl/Makefile
  2. +20
    -16
      dgl/Makefile.mk

+ 5
- 1
dgl/Makefile View File

@@ -43,7 +43,7 @@ all: $(TARGET)

../libdgl.a: $(OBJS)
rm -f $@
ar crs $@ $^
$(AR) crs $@ $^

../libdgl.dll: $(OBJS)
# -Wl,--output-def,$@.def,--out-implib,$@.a
@@ -78,3 +78,7 @@ debug:
$(MAKE) DEBUG=true

# --------------------------------------------------------------

-include $(OBJS:%.o=%.d)

# --------------------------------------------------------------

+ 20
- 16
dgl/Makefile.mk View File

@@ -4,6 +4,7 @@
# Created by falkTX
#

AR ?= ar
CC ?= gcc
CXX ?= g++

@@ -19,38 +20,41 @@ endif
endif

# --------------------------------------------------------------
# Common build and link flags
# Set build and link flags

BASE_FLAGS = -Wall -Wextra -pipe
BASE_OPTS = -O2 -ffast-math -fdata-sections -ffunction-sections
ifneq ($(NOOPT),true)
BASE_OPTS += -mtune=generic -msse -msse2 -mfpmath=sse
BASE_FLAGS = -Wall -Wextra -pipe -MD -MP
BASE_OPTS = -O2 -ffast-math -mtune=generic -msse -msse2 -fdata-sections -ffunction-sections

ifneq ($(MACOS),true)
# MacOS doesn't support this
BASE_OPTS += -mfpmath=sse
endif
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
else
# Common linker flags
LINK_OPTS = -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,-O1 -Wl,--as-needed -Wl,--strip-all
endif

ifeq ($(RASPPI),true)
# Raspberry-Pi flags
BASE_OPTS = -O2 -ffast-math
ifneq ($(NOOPT),true)
BASE_OPTS += -march=armv6 -mfpu=vfp -mfloat-abi=hard
endif
# Raspberry-Pi optimization flags
BASE_OPTS = -O2 -ffast-math -march=armv6 -mfpu=vfp -mfloat-abi=hard
LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all
endif

ifeq ($(PANDORA),true)
# OpenPandora flags
BASE_OPTS = -O2 -ffast-math
ifneq ($(NOOPT),true)
BASE_OPTS += -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
endif
# OpenPandora optimization flags
BASE_OPTS = -O2 -ffast-math -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all
endif

ifneq ($(NOOPT),true)
# No optimization flags
BASE_OPTS = -O2 -ffast-math -fdata-sections -ffunction-sections
endif

ifneq ($(WIN32),true)
# not needed for Windows
BASE_FLAGS += -fPIC -DPIC


Loading…
Cancel
Save