aboutsummaryrefslogtreecommitdiff
path: root/pso/makefile.pd-linux
diff options
context:
space:
mode:
Diffstat (limited to 'pso/makefile.pd-linux')
-rw-r--r--pso/makefile.pd-linux79
1 files changed, 51 insertions, 28 deletions
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:
+
+
+
+
+