diff options
Diffstat (limited to 'externals/grill/flext/buildsys/mac')
8 files changed, 138 insertions, 112 deletions
diff --git a/externals/grill/flext/buildsys/mac/gnumake-gcc-ext.inc b/externals/grill/flext/buildsys/mac/gnumake-gcc-ext.inc index 2f277625..bbcdf4ad 100644 --- a/externals/grill/flext/buildsys/mac/gnumake-gcc-ext.inc +++ b/externals/grill/flext/buildsys/mac/gnumake-gcc-ext.inc @@ -4,49 +4,10 @@ INCPATH += -I$(FLEXTINC) LIBPATH += -L$(FLEXTLIB) LIBS += -l$(FLEXTNAME) -# obviously header precompilation os still buggy with gcc 3.3 +# common compilation stuff +include $(BUILDPATH)$(PLATFORM)/gnumake-gcc-targets.inc -ifdef PRECOMPILE -#PRECOMSRC=$(SRCDIR)/$(PRECOMPILE) -else -#PRECOMSRC=$(FLEXTINC)/flext.h -endif -ifdef PRECOMSRC -PRECOMDST=$(OBJPATH)/$(notdir $(PRECOMSRC)).gch -PRECOMINC = -include $(OBJPATH)/$(notdir $(PRECOMSRC)) -endif - -############################################## - -CSRCS=$(patsubst %.c,$(SRCDIR)/%.c,$(filter %.c,$(SRCS))) -CPPSRCS=$(patsubst %.cpp,$(SRCDIR)/%.cpp,$(filter %.cpp,$(SRCS))) -COBJS=$(patsubst %.c,$(OBJPATH)/%.o,$(filter %.c,$(SRCS))) -CPPOBJS=$(patsubst %.cpp,$(OBJPATH)/%.opp,$(filter %.cpp,$(SRCS))) - -############################################## - -# default target -_build_: $(TARGET) - -$(CSRCS) $(CPPSRCS): $(patsubst %,$(SRCDIR)/%,$(HDRS)) - touch $@ - -# Attention: $@ doesn't work for paths with spaces.... -$(OBJPATH): - -mkdir -p $(OBJPATH) - -# Attention: $@ doesn't work for paths with spaces.... -$(TARGETPATH): - -mkdir -p $(TARGETPATH) - -$(PRECOMDST) : $(PRECOMSRC) $(patsubst %,$(SRCDIR)/%,$(HDRS)) - $(CXX) -c $(CFLAGS) $(DEFS) $(INCPATH) $(PRECOMSRC) -o $@ - -$(OBJPATH)/%.opp : $(SRCDIR)/%.cpp - $(CXX) -c $(CFLAGS) $(DEFS) $(PRECOMINC) $(INCPATH) $< -o $@ - -$(OBJPATH)/%.o : $(SRCDIR)/%.c - $(CC) -c $(CFLAGS) $(DEFS) $(INCPATH) $< -o $@ +##### linking ################### $(TARGET) :: $(OBJPATH) $(TARGETPATH) @@ -65,13 +26,7 @@ ifdef TARGETPOST $(TARGET) :: $(TARGETPOST) endif -############################################## - -_clean_: - -rm -r $(TARGETPATH) - -rm -r $(OBJPATH) - -############################################## +################################### # Attention: $@ doesn't work for paths with spaces.... $(INSTPATH): diff --git a/externals/grill/flext/buildsys/mac/gnumake-gcc-flext.inc b/externals/grill/flext/buildsys/mac/gnumake-gcc-flext.inc index 6ed4990f..916e21cc 100644 --- a/externals/grill/flext/buildsys/mac/gnumake-gcc-flext.inc +++ b/externals/grill/flext/buildsys/mac/gnumake-gcc-flext.inc @@ -7,39 +7,10 @@ LDFLAGS += -compatibility_version $(FLEXTMAJOR).$(FLEXTMINOR) LDFLAGS += -preload -seg1addr 0xd0000000 endif -############################################## +# common compilation stuff +include $(BUILDPATH)$(PLATFORM)/gnumake-gcc-targets.inc -CSRCS=$(patsubst %.c,$(SRCDIR)/%.c,$(filter %.c,$(SRCS))) -CPPSRCS=$(patsubst %.cpp,$(SRCDIR)/%.cpp,$(filter %.cpp,$(SRCS))) -COBJS=$(patsubst %.c,$(OBJPATH)/%.o,$(filter %.c,$(SRCS))) -CPPOBJS=$(patsubst %.cpp,$(OBJPATH)/%.opp,$(filter %.cpp,$(SRCS))) - -# default target -_build_: $(TARGET) - -$(CSRCS) $(CPPSRCS): $(patsubst %,$(SRCDIR)/%,$(HDRS)) - touch $@ - -$(OBJPATH): - -mkdir -p $@ - -$(TARGETPATH): - -mkdir -p $@ - -ifdef PRECOMPILE -PRECOMSRC=$(SRCDIR)/$(PRECOMPILE) -PRECOMDST=$(OBJPATH)/$(notdir $(PRECOMSRC)).gch -PRECOMINC = -include $(OBJPATH)/$(notdir $(PRECOMSRC)) -endif - -$(PRECOMDST): $(PRECOMSRC) $(patsubst %,$(SRCDIR)/%,$(HDRS)) - $(CXX) -c $(CFLAGS) $(DEFS) $(INCPATH) $(PRECOMSRC) -o $@ - -$(OBJPATH)/%.opp : $(SRCDIR)/%.cpp - $(CXX) -c $(CFLAGS) $(DEFS) $(PRECOMINC) $(INCPATH) $< -o $@ - -$(OBJPATH)/%.o : $(SRCDIR)/%.c - $(CC) -c $(CFLAGS) $(DEFS) $(INCPATH) $< -o $@ +##### linking ################### $(TARGET) :: $(OBJPATH) $(TARGETPATH) @@ -58,13 +29,11 @@ else libtool -static -o $@ $(COBJS) $(CPPOBJS) endif -############################################## - -_clean_: - -rm -r $(TARGETPATH) - -rm -r $(OBJPATH) +ifdef TARGETPOST +$(TARGET) :: $(TARGETPOST) +endif -############################################## +################################### $(FLEXTINC): -mkdir -p $@ diff --git a/externals/grill/flext/buildsys/mac/gnumake-gcc-targets.inc b/externals/grill/flext/buildsys/mac/gnumake-gcc-targets.inc new file mode 100644 index 00000000..c8804667 --- /dev/null +++ b/externals/grill/flext/buildsys/mac/gnumake-gcc-targets.inc @@ -0,0 +1,70 @@ +############################################## + +CSRCS := $(patsubst %.c,$(SRCDIR)/%.c,$(filter %.c,$(SRCS))) +CPPSRCS := $(patsubst %.cpp,$(SRCDIR)/%.cpp,$(filter %.cpp,$(SRCS))) +COBJS := $(patsubst %.c,$(OBJPATH)/%.o,$(filter %.c,$(SRCS))) +CPPOBJS := $(patsubst %.cpp,$(OBJPATH)/%.opp,$(filter %.cpp,$(SRCS))) + +############################################## + +# default target +_build_: $(TARGET) + +$(CSRCS) $(CPPSRCS): $(patsubst %,$(SRCDIR)/%,$(HDRS)) + touch $@ + +# Attention: $@ doesn't work for paths with spaces.... +$(OBJPATH): + -mkdir -p $(OBJPATH) + +# Attention: $@ doesn't work for paths with spaces.... +$(TARGETPATH): + -mkdir -p $(TARGETPATH) + +##### precompiled header file ################### + +ifdef PRECOMPILE +PRECOMSRC := $(SRCDIR)/$(PRECOMPILE) +else +PRECOMSRC := $(FLEXTINC)/flext.h +endif + +ifdef PRECOMSRC +PRECOMDST := $(OBJPATH)/$(notdir $(PRECOMSRC)).gch +PRECOMINC := -I $(OBJPATH) +endif + +$(PRECOMDST) : $(PRECOMSRC) $(patsubst %,$(SRCDIR)/%,$(HDRS)) + -mkdir -p $(dir $@) + $(CXX) -c $(DEFS) $(INCPATH) $(PRECOMSRC) -o $@ + +##### architecture-specific compilation ################### + +define ARCH_COMPILE +$(OBJPATH)/%.opp_$(1) : $(SRCDIR)/%.cpp + -mkdir -p $(dir $$@) + $(CXX) -c $(CFLAGS) -arch $(1) $$(CFLAGS_$(1)) $(DEFS) $(PRECOMINC) $(INCPATH) $$^ -o $$@ + +$(OBJPATH)/%.o_$(1) : $(SRCDIR)/%.c + -mkdir -p $(dir $$@) + $(CC) -c $(CFLAGS) -arch $(1) $$(CFLAGS_$(1)) $(DEFS) $(INCPATH) $$^ -o $$@ +endef + +# implement for all archs in ARCH +$(foreach arch,$(ARCH),$(eval $(call ARCH_COMPILE,$(arch)))) + +##### make fat object file ################### + +$(OBJPATH)/%.opp : $(foreach arch,$(ARCH),$(OBJPATH)/%.opp_$(arch)) + lipo $^ -create -output $@ + +$(OBJPATH)/%.o : $(foreach arch,$(ARCH),$(OBJPATH)/%.o_$(arch)) + lipo $^ -create -output $@ + +############################################## + +_clean_: + -rm -r $(TARGETPATH) + -rm -r $(OBJPATH) + +############################################## diff --git a/externals/grill/flext/buildsys/mac/gnumake-gcc.inc b/externals/grill/flext/buildsys/mac/gnumake-gcc.inc index 67f41b9e..7572e455 100644 --- a/externals/grill/flext/buildsys/mac/gnumake-gcc.inc +++ b/externals/grill/flext/buildsys/mac/gnumake-gcc.inc @@ -1,32 +1,32 @@ ############################################## ifneq (,$(findstring Frameworks,$(FLEXTPREFIX))) -FLEXTFRAMEWORK=$(FLEXTPREFIX)/flext.framework +FLEXTFRAMEWORK := $(FLEXTPREFIX)/flext.framework endif ifdef FLEXTFRAMEWORK ifndef FLEXTLIB -FLEXTLIB=$(FLEXTFRAMEWORK) +FLEXTLIB := $(FLEXTFRAMEWORK) endif ifndef FLEXTINC -FLEXTINC=$(FLEXTFRAMEWORK)/Headers +FLEXTINC := $(FLEXTFRAMEWORK)/Headers endif ifndef FLEXTSYS -FLEXTSYS=$(FLEXTFRAMEWORK)/Resources +FLEXTSYS := $(FLEXTFRAMEWORK)/Resources endif else ifndef FLEXTLIB -FLEXTLIB=$(FLEXTPREFIX)/lib +FLEXTLIB := $(FLEXTPREFIX)/lib endif ifndef FLEXTINC -FLEXTINC=$(FLEXTPREFIX)/include/flext +FLEXTINC := $(FLEXTPREFIX)/include/flext endif ifndef FLEXTSYS -FLEXTSYS=$(FLEXTPREFIX)/lib/flext +FLEXTSYS := $(FLEXTPREFIX)/lib/flext endif endif -FLEXTBIN=$(FLEXTPREFIX)/bin +FLEXTBIN := $(FLEXTPREFIX)/bin ############################################## @@ -46,3 +46,11 @@ LDFLAGS += -Wl,-S endif endif +############################################## + +LDFLAGS += $(patsubst %,-arch %,$(ARCH)) + +ifdef OSXSDK +CFLAGS += -isysroot $(OSXSDK) +LDFLAGS += -isysroot $(OSXSDK) +endif diff --git a/externals/grill/flext/buildsys/mac/max/config-gcc.def b/externals/grill/flext/buildsys/mac/max/config-gcc.def index 66a8b990..5f9a1904 100644 --- a/externals/grill/flext/buildsys/mac/max/config-gcc.def +++ b/externals/grill/flext/buildsys/mac/max/config-gcc.def @@ -1,6 +1,6 @@ # where are the Max/MSP SDK header files? # you should have the latest version! -MAXSDKPATH=/Applications/MaxMSP\ 4.5/MaxMSP-SDK/4.5\ headers/c74support +MAXSDKPATH=/Applications/MaxMSP\ 4.5/MaxMSP-SDK/c74support ############################################################### @@ -28,12 +28,24 @@ HELPPATH=/Applications/MaxMSP\ 4.5/max-help/flext ############################################################### # user defined compiler flags -# (check if they match your system!) -UFLAGS=-faltivec -ffast-math +UFLAGS += -ffast-math # user defined optimization flags -# (check if they match your system!) -OFLAGS=-O3 -# optimizations for G4 -OFLAGS+=-mcpu=G4 +OFLAGS += -Os -ftree-vectorize + +# user defined debugging flags +DFLAGS += + +# architecture-specific flags (optional) +UFLAGS_ppc += -maltivec -faltivec +OFLAGS_ppc += -mtune=G4 +DFLAGS_ppc += + +UFLAGS_i386 += -mmmx -msse -msse2 -msse3 +OFLAGS_i386 += -mtune=prescott +DFLAGS_i386 += + +# cross-compilation (optional) +#ARCH=i386 ppc +#OSXSDK=/Developer/SDKs/MacOSX10.4u.sdk diff --git a/externals/grill/flext/buildsys/mac/max/gnumake-gcc.inc b/externals/grill/flext/buildsys/mac/max/gnumake-gcc.inc index cd5740f4..89ddf2d1 100644 --- a/externals/grill/flext/buildsys/mac/max/gnumake-gcc.inc +++ b/externals/grill/flext/buildsys/mac/max/gnumake-gcc.inc @@ -1,6 +1,6 @@ DEFS += -DFLEXT_SYS=1 -INCPATH += -I$(MAXSDKPATH)/max-includes -I$(MAXSDKPATH)/msp-includes +INCPATH += -I$(MAXSDKPATH)/max-includes -I$(MAXSDKPATH)/jit-includes -I$(MAXSDKPATH)/msp-includes LDFLAGS += -framework MaxAPI -framework MaxAudioAPI LDFLAGS += -dynamiclib diff --git a/externals/grill/flext/buildsys/mac/pd/config-gcc.def b/externals/grill/flext/buildsys/mac/pd/config-gcc.def index 925fdd9a..038fe1c1 100644 --- a/externals/grill/flext/buildsys/mac/pd/config-gcc.def +++ b/externals/grill/flext/buildsys/mac/pd/config-gcc.def @@ -24,13 +24,25 @@ INSTPATH=$(PDPATH)/extra ############################################################### +# user defined compiler flags +UFLAGS += -ffast-math + # user defined optimization flags -# (check if they match your system!) -UFLAGS=-faltivec -ffast-math +OFLAGS += -Os -ftree-vectorize -# user defined compiler flags -# (check if they match your system!) -OFLAGS=-O3 -# optimizations for G4 -OFLAGS+=-mcpu=G4 +# user defined debugging flags +DFLAGS += + +# architecture-specific flags (optional) +UFLAGS_ppc += -maltivec -faltivec +OFLAGS_ppc += -mtune=G4 +DFLAGS_ppc += + +UFLAGS_i386 += -mmmx -msse -msse2 -msse3 +OFLAGS_i386 += -mtune=prescott +DFLAGS_i386 += + +# cross-compilation (optional) +#ARCH=i386 ppc +#OSXSDK=/Developer/SDKs/MacOSX10.4u.sdk diff --git a/externals/grill/flext/buildsys/mac/pd/gnumake-gcc-ext.inc b/externals/grill/flext/buildsys/mac/pd/gnumake-gcc-ext.inc index 2e4f6995..a1712728 100644 --- a/externals/grill/flext/buildsys/mac/pd/gnumake-gcc-ext.inc +++ b/externals/grill/flext/buildsys/mac/pd/gnumake-gcc-ext.inc @@ -1,7 +1,7 @@ EXT=pd_darwin -#LDFLAGS += -bundle -bundle_loader $(PDBIN) -LDFLAGS += -dynamiclib -undefined dynamic_lookup +LDFLAGS += -bundle -bundle_loader $(PDBIN) +#LDFLAGS += -dynamiclib -undefined dynamic_lookup TARGET=$(TARGETPATH)/$(TARGETNAME) INSTTARGET=$(TARGET) |