Commit c917889e authored by thomas's avatar thomas
Browse files

updated build system

git-svn-id: https://svn.grrrr.org/ext/trunk@933 4d9ac71a-51e6-0310-8455-cad1006bcd31
parent 01899ce3
......@@ -25,8 +25,7 @@ else
echo platform ... win / lnx / mac
echo system ..... pd / max
echo compiler ... msvc / gcc / mingw / cygwin / bcc / icc
echo target ..... all \(default\) / all-debug / all-shared / all-shared-debug /
echo ............ clean / install
echo target ..... build \(default\) / clean / install
echo
echo Please make sure that your make program and compiler can be accessed with the
echo system path and that all relevant environment variables are properly set.
......
......@@ -12,10 +12,7 @@ _build_: $(TARGET)
$(CSRCS) $(CPPSRCS): $(patsubst %,$(SRCDIR)/%,$(HDRS))
touch $@
$(OUTPATH):
mkdir -p $@
$(TARGETPATH): $(OUTPATH)
$(TARGETPATH):
mkdir -p $@
$(TARGETPATH)/%.opp : $(SRCDIR)/%.cpp
......
......@@ -8,10 +8,7 @@ _build_: $(TARGET)
$(CSRCS) $(CPPSRCS): $(patsubst %,$(SRCDIR)/%,$(HDRS))
touch $@
$(OUTPATH):
-mkdir -p $@
$(TARGETPATH): $(OUTPATH)
$(TARGETPATH):
-mkdir -p $@
$(TARGETPATH)/%.opp : $(SRCDIR)/%.cpp
......
ifndef FLEXTBUILD
INCPATH += -I$(FLEXTPATH)
LIBPATH += -L$(FLEXTPATH)
LIBS+=$(FLEXTPATH)/$(FLEXTNAME).a
endif
LDFLAGS += -Wl,-x -framework ApplicationServices -framework vecLib -dynamiclib -dynamic
##############################################
ifndef DEBUG
CFLAGS += -g -D_DEBUG
else
CFLAGS += $(OFLAGS) -DNDEBUG
LDFLAGS += -Wl,-S
endif
##############################################
ifdef FLEXTBUILD
OUTNAME=$(FLEXTNAME)
ifdef SHARED
EXT=dylib
else
EXT=a
BUILDLIB=1
endif
else
OUTNAME=$(NAME)
endif
##############################################
OBJPATH=$(OUTPATH)/$(OUTSUB)
ifdef FLEXTBUILD
TARGETPATH=$(OBJPATH)
TARGET=$(TARGETPATH)/$(OUTNAME).$(EXT)
else
TARGETPATH=$(OBJPATH)/$(OUTNAME).$(EXT)/Contents/MacOS
TARGET=$(TARGETPATH)/$(OUTNAME)
endif
# build class specific settings
#LDFLAGS += -dylib_install_name $(FLEXTSHLIB)
##############################################
......@@ -51,7 +10,7 @@ COBJS=$(patsubst %.c,$(OBJPATH)/%.o,$(filter %.c,$(SRCS)))
CPPOBJS=$(patsubst %.cpp,$(OBJPATH)/%.opp,$(filter %.cpp,$(SRCS)))
# default target
_all_: $(TARGET)
_build_: $(TARGET)
$(CSRCS) $(CPPSRCS): $(patsubst %,$(SRCDIR)/%,$(HDRS))
touch $@
......@@ -71,14 +30,13 @@ $(OBJPATH)/%.o : $(SRCDIR)/%.c
$(TARGET) :: $(OBJPATH) $(TARGETPATH)
$(TARGET) :: $(COBJS) $(CPPOBJS)
ifdef BUILDLIB
libtool -static -o $@ $(COBJS) $(CPPOBJS)
else
# $(CXX) $(LDFLAGS) $(LIBPATH) -dylib_install_name $(INSTPATH)/$(notdir $@) -o $@ $(COBJS) $(CPPOBJS) $(LIBS)
ifdef SHARED
$(CXX) $(LDFLAGS) $(LIBPATH) -o $@ $(COBJS) $(CPPOBJS) $(LIBS)
chmod 755 $@
else
libtool -static -o $@ $(COBJS) $(CPPOBJS)
endif
##############################################
_clean_:
......@@ -86,17 +44,21 @@ _clean_:
##############################################
$(INSTPATH):
-mkdir -p $@
ifdef SHARED
FLEXTLIBINST=$(FLEXTSHLIB)
else
FLEXTLIBINST=$(FLEXTLIB)
endif
$(FLEXTPATH):
$(FLEXTINC):
-mkdir -p $@
_install_:: $(INSTPATH) $(FLEXTPATH)
$(FLEXTLIBINST):
-mkdir -p $@
_install_:: $(TARGET)
ifdef FLEXTBUILD
cp $(TARGET) $(patsubst %,$(SRCDIR)/%,$(HDRS)) $(FLEXTPATH)
else
install $(TARGET) $(INSTPATH)
_install_: $(FLEXTINC) $(FLEXTLIBINST)
install $(TARGET) $(FLEXTLIBINST)
ifndef SHARED
ranlib $(FLEXTLIBINST)/$(OUTNAME).$(EXT) # have to rerun ranlib at install dir ?!
endif
install $(patsubst %,$(SRCDIR)/%,$(HDRS)) $(FLEXTINC)
EXT=mxo
##############################################
OBJPATH=$(OUTPATH)/$(OUTSUB)
TARGETPATH=$(OBJPATH)/$(OUTNAME).$(EXT)/Contents/MacOS
TARGET=$(TARGETPATH)/$(OUTNAME)
......@@ -4,3 +4,9 @@ else
EXT=a
endif
##############################################
OBJPATH=$(OUTPATH)/$(OUTSUB)
TARGETPATH=$(OBJPATH)
TARGET=$(TARGETPATH)/$(OUTNAME).$(EXT)
......@@ -3,10 +3,5 @@ DEFS += -DFLEXT_SYS=1
INCPATH += -I$(MAXSDKPATH)/max-includes -I$(MAXSDKPATH)/msp-includes
LDFLAGS += -framework MaxAPI -framework MaxAudioAPI
LDFLAGS += -dynamiclib
##############################################
OBJPATH=$(OUTPATH)/$(OUTSUB)
TARGETPATH=$(OBJPATH)/$(OUTNAME).$(EXT)/Contents/MacOS
TARGET=$(TARGETPATH)/$(OUTNAME)
......@@ -8,6 +8,6 @@ LDFLAGS += -bundle -bundle_loader $(PDBIN)
##############################################
OBJPATH=$(OUTPATH)/$(OUTSUB)
TARGETPATH=$(OBJPATH)
TARGET=$(TARGETPATH)/$(OUTNAME).$(EXT)
TARGETPATH=$(OBJPATH)/$(OUTNAME).$(EXT)/Contents/MacOS
TARGET=$(TARGETPATH)/$(OUTNAME)
......@@ -12,10 +12,7 @@ _build_: $(TARGET)
$(CSRCS) $(CPPSRCS): $(patsubst %,$(SRCDIR)/%,$(HDRS))
touch $@
$(OUTPATH):
-mkdir -p $@
$(TARGETPATH): $(OUTPATH)
$(TARGETPATH):
-mkdir -p $@
$(TARGETPATH)/%.opp : $(SRCDIR)/%.cpp
......
......@@ -8,10 +8,7 @@ _build_: $(TARGET)
$(CSRCS) $(CPPSRCS): $(patsubst %,$(SRCDIR)/%,$(HDRS))
touch $@
$(OUTPATH):
-mkdir -p $@
$(TARGETPATH): $(OUTPATH)
$(TARGETPATH):
-mkdir -p $@
$(TARGETPATH)/%.opp : $(SRCDIR)/%.cpp
......
......@@ -6,7 +6,7 @@
# CXX=g++-3.3
# where are the PD header files? (m_pd.h, m_imp.h, g_canvas.h)
PDPATH=/Applications/Pd-0.38-0test10.app/Contents/Resources/src
PDPATH=/Applications/audio/Pd-0.38-0test13.app/Contents/Resources/src
# where is the SndObj include directory?
# (leave blank or comment out to disable SndObj support)
......@@ -21,7 +21,7 @@ TARGDIR=./pd-darwin
# where should flext libraries be installed?
# (leave blank to omit installation)
INSTDIR=/Applications/Pd-0.38-0test10.app/Contents/Resources/flext
INSTDIR=/Applications/audio/Pd-0.38-0test10.app/Contents/Resources/flext
# additional compiler flags
# (check if they fit for your system!)
......
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