From 69c6a83d79f17af81497d48dd4c159175266c7b0 Mon Sep 17 00:00:00 2001 From: "B. Bogart" Date: Thu, 2 Oct 2003 19:04:06 +0000 Subject: Changed to the build system from pool for Darwin and Linux svn path=/trunk/externals/bbogart/; revision=1062 --- pso/makefile.pd-linux | 79 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 51 insertions(+), 28 deletions(-) (limited to 'pso/makefile.pd-linux') diff --git a/pso/makefile.pd-linux b/pso/makefile.pd-linux index aa6a721..0bd5193 100644 --- a/pso/makefile.pd-linux +++ b/pso/makefile.pd-linux @@ -1,64 +1,82 @@ # PSO - Particle Swarm Optimizer - Copyright Ben Bogart 2003 -# makefile adapted from prepend - Copyright (c) 2002 Thomas Grill (xovo@gmx.net) +# makefile adapted from pool - Copyright (c) 2002 Thomas Grill (xovo@gmx.net) # -# Makefile for gcc +# Makefile for gcc @ linux # -# usage: make -f makefile.pd-linux +# usage: +# to build run "make -f makefile.pd-linux" +# to install (as root), do "make -f makefile.pd-linux install" # -# --------------------------------------------- -NAME=pso +CONFIG=config-pd-linux.txt + +include $(CONFIG) + +# compiler+linker stuff +INCLUDES=$(PDPATH) +FLAGS=-DFLEXT_SYS=2 +CFLAGS=-O2 $(UFLAGS) +LIBS= -# where to build -TARGDIR=./pd-linux +ifdef FLEXT_SHARED +CFLAGS+=-shared -DFLEXT_SHARED +LDFLAGS+=-L $(FLEXTPATH) -# where to install ### EDIT! ### -INSTDIR= +ifeq ($(CXX),icc) +LDFLAGS+=-i_dynamic +else +LDFLAGS+=-Wl,-Bdynamic +endif -# flext stuff ### EDIT! ### -FLEXTPATH=/usr/local/lib/pd/flext -FLEXTLIB=$(FLEXTPATH)/flext.a +FLEXTLIB=-lflext -# compiler+linker stuff ### EDIT! ### -INCLUDES=/usr/lib/pd/include -FLAGS=-DPD -CFLAGS=-O6 -mcpu=pentium -LIBS=m +else +FLEXTLIB=$(FLEXTPATH)/flext_t.a +endif + + +# --------------------------------------------- # the rest can stay untouched # ---------------------------------------------- +NAME=pso + # all the source files from the package -SRCS=main.cpp +SRCS=main.cpp HDRS= +DIR=. + TARGET=$(TARGDIR)/$(NAME).pd_linux # default target all: $(TARGDIR) $(TARGET) -$(SRCS): $(HDRS) +$(patsubst %,$(DIR)/%,$(SRCS)): $(patsubst %,$(DIR)/%,$(HDRS)) $(CONFIG) touch $@ $(TARGDIR): mkdir $(TARGDIR) -$(TARGDIR)/%.o : %.cpp +$(TARGDIR)/%.o : $(DIR)/%.cpp $(CXX) -c $(CFLAGS) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(FLEXTPATH)) $< -o $@ -$(TARGET) : $(patsubst %.cpp,$(TARGDIR)/%.o,$(SRCS)) $(FLEXTLIB) - $(CXX) $(LDFLAGS) -shared $^ $(patsubst %,-l%,$(LIBS)) -o $@ +$(TARGET) : $(patsubst %.cpp,$(TARGDIR)/%.o,$(SRCS)) + $(CXX) -shared $(LDFLAGS) -o $@ $^ $(FLEXTLIB) $(patsubst %,-l%,$(LIBS)) + strip --strip-unneeded $@ chmod 755 $@ -$(INSTDIR): - mkdir $(INSTDIR) +$(INSTPATH): + mkdir $(INSTPATH) -install:: $(INSTDIR) +install:: $(INSTPATH) -install:: $(TARGET) - cp $^ $(INSTDIR) - chown root.root $(patsubst %,$(INSTDIR)/%,$(notdir $^)) +install:: $(TARGET) + cp $^ $(INSTPATH) + chown root.root $(patsubst %,$(INSTPATH)/%,$(notdir $^)) + chmod 755 $(patsubst %,$(INSTPATH)/%,$(notdir $^)) .PHONY: clean clean: @@ -67,3 +85,8 @@ clean: + + + + + -- cgit v1.2.1