aboutsummaryrefslogtreecommitdiff
path: root/cyclone/Makefile.libdir
diff options
context:
space:
mode:
Diffstat (limited to 'cyclone/Makefile.libdir')
-rw-r--r--cyclone/Makefile.libdir114
1 files changed, 114 insertions, 0 deletions
diff --git a/cyclone/Makefile.libdir b/cyclone/Makefile.libdir
new file mode 100644
index 0000000..9475432
--- /dev/null
+++ b/cyclone/Makefile.libdir
@@ -0,0 +1,114 @@
+# this Makefile builds a libdir for cyclone
+
+# where to install the library, overridden below depending on platform
+prefix = /usr/local
+libdir = $(prefix)/lib
+bindir = $(prefix)/bin
+pkglibdir = $(libdir)/pd-externals
+objectsdir = $(pkglibdir)
+
+UNAME := $(shell uname -s)
+ifeq ($(UNAME),Darwin)
+ CPU := $(shell uname -p)
+ ifeq ($(CPU),arm) # iPhone/iPod Touch
+ EXTENSION = pd_darwin
+ OS = iphoneos
+ PD_PATH = /Applications/Pd-extended.app/Contents/Resources
+ IPHONE_BASE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
+ CC=$(IPHONE_BASE)/gcc
+ CPP=$(IPHONE_BASE)/cpp
+ CXX=$(IPHONE_BASE)/g++
+ ISYSROOT = -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk
+ IPHONE_CFLAGS = -miphoneos-version-min=3.0 $(ISYSROOT) -arch armv6
+ OPT_CFLAGS = -fast -funroll-loops -fomit-frame-pointer
+ CFLAGS := $(IPHONE_CFLAGS) $(OPT_CFLAGS) $(CFLAGS)
+ LDFLAGS += -arch armv6 -bundle -undefined dynamic_lookup $(ISYSROOT)
+ LIBS += -lc
+ STRIP = strip -x
+ else # Mac OS X
+ EXTENSION = pd_darwin
+ OS = macosx
+ PD_PATH = /Applications/Pd-extended.app/Contents/Resources
+ OPT_CFLAGS = -ftree-vectorize -ftree-vectorizer-verbose=2 -fast
+# build universal 32-bit on 10.4 and 32/64 on newer
+ ifeq ($(shell uname -r | sed 's|\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*|\1|'), 8)
+ FAT_FLAGS = -arch ppc -arch i386 -mmacosx-version-min=10.4
+ else
+ FAT_FLAGS = -arch ppc -arch i386 -arch x86_64 -mmacosx-version-min=10.4
+ endif
+ CFLAGS += $(FAT_FLAGS) -fPIC -I/sw/include
+ LDFLAGS += $(FAT_FLAGS) -bundle -undefined dynamic_lookup -L/sw/lib
+ # if the 'pd' binary exists, check the linking against it to aid with stripping
+ LDFLAGS += $(shell test -e $(PD_PATH)/bin/pd && echo -bundle_loader $(PD_PATH)/bin/pd)
+ LIBS += -lc
+ STRIP = strip -x
+# install into ~/Library/Pd on Mac OS X since /usr/local isn't used much
+ pkglibdir=$(HOME)/Library/Pd
+ endif
+endif
+ifeq ($(UNAME),Linux)
+ CPU := $(shell uname -m)
+ EXTENSION = pd_linux
+ OS = linux
+ PD_PATH = /usr
+ OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
+ CFLAGS += -fPIC
+ LDFLAGS += -Wl,--export-dynamic -shared -fPIC
+ LIBS += -lc
+ STRIP = strip --strip-unneeded -R .note -R .comment
+endif
+ifeq (CYGWIN,$(findstring CYGWIN,$(UNAME)))
+ CPU := $(shell uname -m)
+ EXTENSION = dll
+ OS = cygwin
+ PD_PATH = $(cygpath $(PROGRAMFILES))/pd
+ OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
+ CFLAGS +=
+ LDFLAGS += -Wl,--export-dynamic -shared -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin"
+ LIBS += -lc -lpd
+ STRIP = strip --strip-unneeded -R .note -R .comment
+endif
+ifeq (MINGW,$(findstring MINGW,$(UNAME)))
+ CPU := $(shell uname -m)
+ EXTENSION = dll
+ OS = windows
+ PD_PATH = $(shell cd "$(PROGRAMFILES)"/pd && pwd)
+ OPT_CFLAGS = -O3 -funroll-loops -fomit-frame-pointer
+ CFLAGS += -mms-bitfields
+ LDFLAGS += -s -shared -Wl,--enable-auto-import
+ LIBS += -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin" -L"$(PD_PATH)/obj" -lpd -lwsock32 -lkernel32 -luser32 -lgdi32
+ STRIP = strip --strip-unneeded -R .note -R .comment
+endif
+
+cyclone:
+ $(MAKE) -f Makefile \
+ OPT_CFLAGS="-O6 -funroll-loops -fomit-frame-pointer -fno-strict-aliasing -fPIC"
+
+install: cyclone
+ install -d $(DESTDIR)$(objectsdir)/cyclone
+ install -p cyclone-meta.pd $(DESTDIR)$(objectsdir)/cyclone
+ install -p ../LICENSE.txt $(DESTDIR)$(objectsdir)/cyclone
+ install -p README.txt $(DESTDIR)$(objectsdir)/cyclone
+# cyclone is compiled straight into $(OUT_DIR), yes a kludge, but the code of
+# this build system is impenetrable
+ $(MAKE) OUT_DIR=$(DESTDIR)$(objectsdir)/cyclone
+# install "maxmode" libraries into subdir, so they don't override the libdir
+ install -d $(DESTDIR)$(objectsdir)/cyclone/maxmode
+ install -p ../bin/cyclone.$(EXTENSION) \
+ ../bin/hammer.$(EXTENSION) \
+ ../bin/sickle.$(EXTENSION) \
+ ../bin/maxmode.$(EXTENSION) \
+ $(DESTDIR)$(objectsdir)/cyclone/maxmode
+# install "cyclist" command line app with pd
+ install -d $(DESTDIR)$(bindir)
+ install -p -m0755 ../bin/cyclist $(DESTDIR)$(bindir)
+ install -p ../doc/help/cyclone/*.* \
+ $(DESTDIR)$(objectsdir)/cyclone
+ install -d $(DESTDIR)$(objectsdir)/cyclone/examples
+ install -p ../test/cyclone/*.* \
+ $(DESTDIR)$(objectsdir)/cyclone/examples
+
+clean:
+ -$(MAKE) -f Makefile $(DEST_PATHS) clean
+ -rm -f ../bin/*.pd_linux
+ -rm -f ../bin/cyclist