Commit f356049f authored by thomas's avatar thomas
Browse files

updated build system for OSX

git-svn-id: https://svn.grrrr.org/ext/trunk@934 4d9ac71a-51e6-0310-8455-cad1006bcd31
parent c917889e
# where is the STK installation?
# (uncomment the line with # to disable STK support)
#STK=/usr/local/lib/stk
# where is the Sndobjs installation?
# (uncomment the line with # to disable SNDOBJ support)
#SNDOBJ=/usr/local/lib/sndobj
ifdef SNDOBJ
SRCS+=$(SRCS_SNDOBJ)
HDRS+=$(HDRS_SNDOBJ)
INCPATH+=-I$(SNDOBJ)
LIBS+=-lsndobj
endif
ifdef STK
SRCS+=$(SRCS_STK)
HDRS+=$(HDRS_STK)
INCPATH+=-I$(STK)
LIBS+=-lstk
endif
......@@ -3,7 +3,19 @@
INCPATH += -I$(FLEXTINC)
LIBPATH += -L$(FLEXTLIB) -L$(FLEXTSHLIB)
LIBS += -l$(FLEXTNAME)
# obviously header precompilation os still buggy with gcc 3.3
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)))
......@@ -25,22 +37,26 @@ $(OBJPATH):
$(TARGETPATH):
-mkdir -p $@
$(OBJPATH)/%.opp : $(SRCDIR)/%.cpp
$(PRECOMDST) : $(PRECOMSRC)
$(CXX) -c $(CFLAGS) $(DEFS) $(INCPATH) $< -o $@
$(OBJPATH)/%.opp : $(SRCDIR)/%.cpp
$(CXX) -c $(CFLAGS) $(DEFS) $(PRECOMINC) $(INCPATH) $< -o $@
$(OBJPATH)/%.o : $(SRCDIR)/%.c
$(CC) -c $(CFLAGS) $(DEFS) $(INCPATH) $< -o $@
$(TARGET) :: $(OBJPATH) $(TARGETPATH)
$(TARGET) :: $(COBJS) $(CPPOBJS)
$(TARGET) :: $(PRECOMDST) $(COBJS) $(CPPOBJS)
$(CXX) $(LDFLAGS) $(LIBPATH) -o $@ $(COBJS) $(CPPOBJS) $(LIBS)
chmod 755 $@
##############################################
_clean_:
rm $(COBJS) $(CPPOBJS) $(TARGET)
-rm -r $(TARGETPATH)
-rm -r $(OBJPATH)
##############################################
......@@ -48,4 +64,4 @@ $(INSTPATH):
-mkdir -p $@
_install_:: $(INSTPATH)
install $(TARGET) $(INSTPATH)
cp -R $(INSTTARGET) $(INSTPATH)
# build class specific settings
#LDFLAGS += -dylib_install_name $(FLEXTSHLIB)
ifdef SHARED
#LDFLAGS += -dylib_install_name $(FLEXTSHLIB)/$(OUTNAME).$(EXT)
endif
##############################################
CSRCS=$(patsubst %.c,$(SRCDIR)/%.c,$(filter %.c,$(SRCS)))
......@@ -20,16 +22,25 @@ $(OBJPATH):
$(TARGETPATH):
-mkdir -p $@
ifdef PRECOMPILE
PRECOMSRC=$(SRCDIR)/$(PRECOMPILE)
PRECOMDST=$(OBJPATH)/$(notdir $(PRECOMSRC)).gch
PRECOMINC = -include $(OBJPATH)/$(notdir $(PRECOMSRC))
endif
$(PRECOMDST): $(PRECOMSRC)
$(CXX) -c $(CFLAGS) $(DEFS) $(INCPATH) $< -o $@
$(OBJPATH)/%.opp : $(SRCDIR)/%.cpp
$(CXX) -c $(CFLAGS) $(DEFS) $(INCPATH) $< -o $@
$(CXX) -c $(CFLAGS) $(DEFS) $(PRECOMINC) $(INCPATH) $< -o $@
$(OBJPATH)/%.o : $(SRCDIR)/%.c
$(CC) -c $(CFLAGS) $(DEFS) $(INCPATH) $< -o $@
$(TARGET) :: $(OBJPATH) $(TARGETPATH)
$(TARGET) :: $(COBJS) $(CPPOBJS)
$(TARGET) :: $(PRECOMDST) $(COBJS) $(CPPOBJS)
ifdef SHARED
$(CXX) $(LDFLAGS) $(LIBPATH) -o $@ $(COBJS) $(CPPOBJS) $(LIBS)
chmod 755 $@
......@@ -40,7 +51,8 @@ endif
##############################################
_clean_:
rm $(COBJS) $(CPPOBJS) $(TARGET)
-rm -r $(TARGETPATH)
-rm -r $(OBJPATH)
##############################################
......@@ -59,6 +71,7 @@ $(FLEXTLIBINST):
_install_: $(FLEXTINC) $(FLEXTLIBINST)
install $(TARGET) $(FLEXTLIBINST)
ifndef SHARED
ranlib $(FLEXTLIBINST)/$(OUTNAME).$(EXT) # have to rerun ranlib at install dir ?!
# have to rerun ranlib at install dir ?!
ranlib $(FLEXTLIBINST)/$(notdir $(TARGET))
endif
install $(patsubst %,$(SRCDIR)/%,$(HDRS)) $(FLEXTINC)
......@@ -4,7 +4,7 @@ LDFLAGS += -dynamic -Wl,-x -framework ApplicationServices -framework vecLib
##############################################
ifndef DEBUG
ifdef DEBUG
CFLAGS += -g -D_DEBUG
else
CFLAGS += $(OFLAGS) -DNDEBUG
......
......@@ -19,7 +19,7 @@ FLEXTSHLIB=$(FLEXTLIB)
OUTPATH=max-darwin
# where should the external be installed?
INSTPATH=/Library/Application\ Support/Cycling\ \'74/externals
INSTPATH=/Library/Application\ Support/Cycling\ \'74/externals/flext
###############################################################
......
......@@ -4,5 +4,6 @@ EXT=mxo
OBJPATH=$(OUTPATH)/$(OUTSUB)
TARGETPATH=$(OBJPATH)/$(OUTNAME).$(EXT)/Contents/MacOS
INSTTARGET=$(OBJPATH)/$(OUTNAME).$(EXT)
TARGETPATH=$(INSTTARGET)/Contents/MacOS
TARGET=$(TARGETPATH)/$(OUTNAME)
......@@ -7,6 +7,8 @@ endif
##############################################
OBJPATH=$(OUTPATH)/$(OUTSUB)
TARGETPATH=$(OBJPATH)
TARGET=$(TARGETPATH)/$(OUTNAME).$(EXT)
INSTTARGET=$(TARGET)
EXT=pd_darwin
LDFLAGS += -bundle -bundle_loader $(PDBIN)
......@@ -3,3 +3,5 @@ EXT=dylib
else
EXT=a
endif
LDFLAGS += -dynamiclib -flat_namespace -undefined suppress
......@@ -3,11 +3,8 @@ DEFS += -DFLEXT_SYS=2
INCPATH += -I$(PDPATH)/src
LIBPATH += -L$(PDPATH)/bin
LDFLAGS += -bundle -bundle_loader $(PDBIN)
##############################################
OBJPATH=$(OUTPATH)/$(OUTSUB)
TARGETPATH=$(OBJPATH)
TARGET=$(TARGETPATH)/$(OUTNAME).$(EXT)
......@@ -3,8 +3,10 @@ NAME=flext
BUILDCLASS=flext
BUILDMODE=all
BUILDTYPE=all
SRCDIR=source
SRCDIR=source
PRECOMPILE=flext.h
SRCS= \
flbase.cpp flext.cpp flbuf.cpp fldsp.cpp fllib.cpp \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment