aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2010-08-24 04:46:07 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2010-08-24 04:46:07 +0000
commitd8a30f0bda0802bc19fbb64cbf1cfc60e7d29f16 (patch)
tree691e53dcc780131b13784bae4bc43a38f40f17bf /Makefile
parentb83af9fdeb226a3b13e2334fb8ef7e60a80b04c4 (diff)
updated to Makefile version 1.0.2
svn path=/trunk/externals/ekext/; revision=13928
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile60
1 files changed, 29 insertions, 31 deletions
diff --git a/Makefile b/Makefile
index cd5b186..4c87183 100644
--- a/Makefile
+++ b/Makefile
@@ -1,22 +1,12 @@
-## Pd library template version 1.0.1
+## Pd library template version 1.0.2
# For instructions on how to use this template, see:
# http://puredata.info/docs/developer/MakefileTemplate
LIBRARY_NAME = ekext
-# add your .c source files to the SOURCES variable, help files will be
-# included automatically
+# add your .c source files, one object per file, to the SOURCES
+# variable, help files will be included automatically
SOURCES = cup.c cupd.c doubledelta.c framescore~.c framespect~.c hasc~.c hssc~.c listmoses.c list_sum.c lpc~.c lpreson~.c maskxor.c peakit~.c polymap.c polystat.c sieve.c simile~.c simile.c steady.c valve.c voicing_detector~.c weightonset.c zeroxpos~.c
-
-# For objects that only build on certain platforms, add those to the SOURCES
-# line for the right platforms.
-SOURCES_android =
-SOURCES_cygwin =
-SOURCES_macosx =
-SOURCES_iphoneos =
-SOURCES_linux =
-SOURCES_windows =
-
# list all pd objects (i.e. myobject.pd) files here, and their helpfiles will
# be included automatically
PDOBJECTS = count.pd
@@ -28,7 +18,7 @@ EXAMPLES = lpc-cross-synthesis.pd peakit-listmoses.pd
MANUAL =
# if you want to include any other files in the source and binary tarballs,
-# list them here. This can be anything from header files, example patches,
+# list them here. This can be anything from header files, test patches,
# documentation, etc. README.txt and LICENSE.txt are required and therefore
# automatically included
EXTRA_DIST = peakit~_license.txt voicing_detector~test3-help.pd maskxor-test.pd beauty.wav drummach.wav stink.wav
@@ -37,6 +27,16 @@ EXTRA_DIST = peakit~_license.txt voicing_detector~test3-help.pd maskxor-test.pd
#------------------------------------------------------------------------------#
#
+# things you might need to edit if you are using other C libraries
+#
+#------------------------------------------------------------------------------#
+
+CFLAGS = -DPD -I$(PD_PATH)/src -Wall -W -g
+LDFLAGS =
+LIBS =
+
+#------------------------------------------------------------------------------#
+#
# you shouldn't need to edit anything below here, if we did it right :)
#
#------------------------------------------------------------------------------#
@@ -44,6 +44,8 @@ EXTRA_DIST = peakit~_license.txt voicing_detector~test3-help.pd maskxor-test.pd
# get library version from meta file
LIBRARY_VERSION = $(shell sed -n 's|^\#X text [0-9][0-9]* [0-9][0-9]* VERSION \(.*\);|\1|p' $(LIBRARY_NAME)-meta.pd)
+CFLAGS += -DVERSION='"$(LIBRARY_VERSION)"'
+
# where Pd lives
PD_PATH = ../../pd
# where to install the library
@@ -52,14 +54,10 @@ libdir = $(prefix)/lib
pkglibdir = $(libdir)/pd-externals
objectsdir = $(pkglibdir)
-
INSTALL = install
INSTALL_FILE = $(INSTALL) -p -m 644
INSTALL_DIR = $(INSTALL) -p -m 755 -d
-CFLAGS = -DPD -I$(PD_PATH)/src -Wall -W -g
-LDFLAGS =
-LIBS =
ALLSOURCES := $(SOURCES) $(SOURCES_android) $(SOURCES_cygwin) $(SOURCES_macosx) \
$(SOURCES_iphoneos) $(SOURCES_linux) $(SOURCES_windows)
@@ -111,6 +109,7 @@ ifeq ($(UNAME),Darwin)
endif
endif
ifeq ($(UNAME),Linux)
+ CPU := $(shell uname -m)
SOURCES += $(SOURCES_linux)
EXTENSION = pd_linux
OS = linux
@@ -122,6 +121,7 @@ ifeq ($(UNAME),Linux)
DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
endif
ifeq (CYGWIN,$(findstring CYGWIN,$(UNAME)))
+ CPU := $(shell uname -m)
SOURCES += $(SOURCES_cygwin)
EXTENSION = dll
OS = cygwin
@@ -133,6 +133,7 @@ ifeq (CYGWIN,$(findstring CYGWIN,$(UNAME)))
DISTBINDIR=$(DISTDIR)-$(OS)
endif
ifeq (MINGW,$(findstring MINGW,$(UNAME)))
+ CPU := $(shell uname -m)
SOURCES += $(SOURCES_windows)
EXTENSION = dll
OS = windows
@@ -144,10 +145,13 @@ ifeq (MINGW,$(findstring MINGW,$(UNAME)))
DISTBINDIR=$(DISTDIR)-$(OS)
endif
+# in case somebody manually set the HELPPATCHES above
+HELPPATCHES ?= $(SOURCES:.c=-help.pd) $(PDOBJECTS:.c=-help.pd)
+
CFLAGS += $(OPT_CFLAGS)
-.PHONY = install libdir_install single_install install-doc install-exec install-examples install-manual clean dist etags
+.PHONY = install libdir_install single_install install-doc install-exec install-examples install-manual clean dist etags $(LIBRARY_NAME)
all: $(SOURCES:.c=.$(EXTENSION))
@@ -163,7 +167,6 @@ $(LIBRARY_NAME): $(SOURCES:.c=.o) $(LIBRARY_NAME).o
$(CC) $(LDFLAGS) -o $(LIBRARY_NAME).$(EXTENSION) $(SOURCES:.c=.o) $(LIBRARY_NAME).o $(LIBS)
chmod a-x $(LIBRARY_NAME).$(EXTENSION)
-
install: libdir_install
# The meta and help files are explicitly installed to make sure they are
@@ -187,11 +190,8 @@ single_install: $(LIBRARY_NAME) install-doc install-exec
install-doc:
$(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
- test -z "$(strip $(SOURCES))" || \
- $(INSTALL_FILE) $(SOURCES:.c=-help.pd) \
- $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
- test -z "$(strip $(PDOBJECTS))" || \
- $(INSTALL_FILE) $(PDOBJECTS:.pd=-help.pd) \
+ test -z "$(strip $(SOURCES) $(PDOBJECTS))" || \
+ $(INSTALL_FILE) $(HELPPATCHES) \
$(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
$(INSTALL_FILE) README.txt $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/README.txt
$(INSTALL_FILE) LICENSE.txt $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/LICENSE.txt
@@ -212,7 +212,7 @@ install-manual:
clean:
- -rm -f -- $(SOURCES:.c=.o)
+ -rm -f -- $(SOURCES:.c=.o) $(SOURCES_LIB:.c=.o)
-rm -f -- $(SOURCES:.c=.$(EXTENSION))
-rm -f -- $(LIBRARY_NAME).o
-rm -f -- $(LIBRARY_NAME).$(EXTENSION)
@@ -232,7 +232,7 @@ $(DISTBINDIR):
libdir: all $(DISTBINDIR)
$(INSTALL_FILE) $(LIBRARY_NAME)-meta.pd $(DISTBINDIR)
$(INSTALL_FILE) $(SOURCES) $(DISTBINDIR)
- $(INSTALL_FILE) $(SOURCES:.c=-help.pd) $(DISTBINDIR)
+ $(INSTALL_FILE) $(HELPPATCHES) $(DISTBINDIR)
test -z "$(strip $(EXTRA_DIST))" || \
$(INSTALL_FILE) $(EXTRA_DIST) $(DISTBINDIR)
# tar --exclude-vcs -czpf $(DISTBINDIR).tar.gz $(DISTBINDIR)
@@ -250,12 +250,10 @@ dist: $(DISTDIR)
$(INSTALL_FILE) $(LIBRARY_NAME)-meta.pd $(DISTDIR)
test -z "$(strip $(ALLSOURCES))" || \
$(INSTALL_FILE) $(ALLSOURCES) $(DISTDIR)
- test -z "$(strip $(ALLSOURCES))" || \
- $(INSTALL_FILE) $(ALLSOURCES:.c=-help.pd) $(DISTDIR)
test -z "$(strip $(PDOBJECTS))" || \
$(INSTALL_FILE) $(PDOBJECTS) $(DISTDIR)
- test -z "$(strip $(PDOBJECTS))" || \
- $(INSTALL_FILE) $(PDOBJECTS:.pd=-help.pd) $(DISTDIR)
+ test -z "$(strip $(HELPPATCHES))" || \
+ $(INSTALL_FILE) $(HELPPATCHES) $(DISTDIR)
test -z "$(strip $(EXTRA_DIST))" || \
$(INSTALL_FILE) $(EXTRA_DIST) $(DISTDIR)
test -z "$(strip $(EXAMPLES))" || \