Browse Source

Update makefile

gh-pages
falkTX 10 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) ../libdgl.a: $(OBJS)
rm -f $@ rm -f $@
ar crs $@ $^
$(AR) crs $@ $^


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


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

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

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

+ 20
- 16
dgl/Makefile.mk View File

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


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


@@ -19,38 +20,41 @@ endif
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 endif
LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections -Wl,--strip-all


ifeq ($(MACOS),true) ifeq ($(MACOS),true)
# MacOS linker flags # MacOS linker flags
LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-dead_strip -Wl,-dead_strip_dylibs 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 endif


ifeq ($(RASPPI),true) 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 LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all
endif endif


ifeq ($(PANDORA),true) 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 LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all
endif endif


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

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


Loading…
Cancel
Save