(SoftFilter) Makefile - can compile filters now on OSX

This commit is contained in:
twinaphex 2014-04-19 20:46:05 +02:00
parent 0e45b11246
commit cc8bca68fc

View File

@ -1,18 +1,36 @@
compiler := gcc compiler := gcc
extra_flags := extra_flags :=
use_neon := 0 use_neon := 0
release := release release := release
DYLIB := so
ifndef platform ifeq ($(platform),)
platform := $(shell $(compiler) -dumpmachine) platform = unix
ifeq ($(shell uname -a),)
platform = win
else ifneq ($(findstring MINGW,$(shell uname -a)),)
platform = win
else ifneq ($(findstring Darwin,$(shell uname -a)),)
platform = osx
arch = intel
ifeq ($(shell uname -p),powerpc)
arch = ppc
endif
else ifneq ($(findstring win,$(shell uname -a)),)
platform = win
endif
endif endif
ifneq (,$(findstring armv7,$(platform))) ifeq ($(platform),gcc)
extra_rules_gcc := $(shell $(compiler) -dumpmachine)
endif
ifneq (,$(findstring armv7,$(extra_rules_gcc)))
extra_flags += -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon extra_flags += -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon
use_neon := 1 use_neon := 1
endif endif
ifneq (,$(findstring hardfloat,$(platform))) ifneq (,$(findstring hardfloat,$(extra_rules_gcc)))
extra_flags += -mfloat-abi=hard extra_flags += -mfloat-abi=hard
endif endif
@ -24,11 +42,23 @@ ifeq (debug,$(build))
extra_flags += -O0 -g extra_flags += -O0 -g
endif endif
cc := $(compiler) ldflags := -shared -Wl,--version-script=link.T
cpp := $(subst cc,++,$(compiler)) -std=gnu++0x
ifeq ($(platform), unix)
DYLIB = so
else ifeq ($(platform), osx)
compiler := $(CC)
DYLIB = dylib
ldflags := -dynamiclib
else
extra_flags += -static-libgcc -static-libstdc++
DYLIB = dll
endif
CC := $(compiler)
CXX := $(subst CC,++,$(compiler)) -std=gnu++0x
flags := -fPIC $(extra_flags) flags := -fPIC $(extra_flags)
asflags := -fPIC $(extra_flags) asflags := -fPIC $(extra_flags)
ldflags := -shared -Wl,--version-script=link.T
objects := objects :=
flags += -std=c99 flags += -std=c99
@ -38,24 +68,24 @@ ASMFLAGS := -INEON/asm
asflags += -mfpu=neon asflags += -mfpu=neon
endif endif
objects += epx.so 2xsai.so super2xsai.so supereagle.so 2xbr.so darken.so scale2x.so objects += epx.$(DYLIB) 2xsai.$(DYLIB) super2xsai.$(DYLIB) supereagle.$(DYLIB) 2xbr.$(DYLIB) darken.$(DYLIB) scale2x.$(DYLIB)
all: build; all: build;
%.o: %.S %.o: %.S
$(cc) -c -o $@ $(asflags) $(ASMFLAGS) $< $(CC) -c -o $@ $(asflags) $(ASMFLAGS) $<
%.o: %.c %.o: %.c
$(cc) -c -o $@ $(flags) $< $(CC) -c -o $@ $(flags) $<
%.so: %.o %.$(DYLIB): %.o
$(cc) -o $@ $(ldflags) $(flags) $^ $(CC) -o $@ $(ldflags) $(flags) $^
build: $(objects) build: $(objects)
clean: clean:
rm -f *.o rm -f *.o
rm -f *.so rm -f *.$(DYLIB)
strip: strip:
strip -s *.so strip -s *.$(DYLIB)