From 6a5f1829530eea02cd30679afe857c2ad8554135 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 6 Apr 2010 18:21:24 +0000 Subject: updated libdir style projects with latest version of Makefile template svn path=/trunk/externals/moonlib/; revision=13377 --- Makefile | 72 +++++++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 23 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 843a482..a2e4c70 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,12 @@ -# To use this Makefile for your project, first put the name of your library in -# LIBRARY_NAME variable. The folder for your project should have the same name -# as your library. +## Pd library template version 1.0 +# For instructions on how to use this template, see: +# http://puredata.info/docs/developer/MakefileTemplate LIBRARY_NAME = moonlib -LIBRARY_VERSION = 0.2 -# Next, add your .c source files to the SOURCES variable. The help files will -# be included automatically +# add your .c source files to the SOURCES variable, help files will be +# included automatically SOURCES = absolutepath.c basedir.c char2f.c comma.c dinlet~.c dispatch.c dripchar.c f2char.c gamme.c image.c mknob.c panvol~.c popen.c relativepath.c s2f.c sarray.c sfread2~.c slist.c ssaw~.c tabdump2.c tabenv.c tabreadl.c tabsort2.c tabsort.c wac.c - # For objects that only build on certain platforms, add those to the SOURCES # line for the right platforms. SOURCES_android = @@ -22,10 +20,17 @@ SOURCES_windows = # be included automatically PDOBJECTS = +# example patches and related files, in the 'examples' subfolder +EXAMPLES = + +# manuals and related files, in the 'manual' subfolder +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, READMEs, example -# patches, documentation, etc. -EXTRA_DIST = README.txt XFS.txt pause.gif play.gif playy.gif rec.gif saww.gif sin.gif sinw.gif squarew.gif +# list them here. This can be anything from header files, example patches, +# documentation, etc. README.txt and LICENSE.txt are required and therefore +# automatically included +EXTRA_DIST = XFS.txt pause.gif play.gif playy.gif rec.gif saww.gif sin.gif sinw.gif squarew.gif # special case: the 'd' directory of gifs was manually added below @@ -36,6 +41,9 @@ EXTRA_DIST = README.txt XFS.txt pause.gif play.gif playy.gif rec.gif saww.gif si # #------------------------------------------------------------------------------# +# 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) + # where Pd lives PD_PATH = ../../pd # where to install the library @@ -122,8 +130,7 @@ ifeq (MINGW,$(findstring MINGW,$(UNAME))) EXTENSION = dll OS = windows OPT_CFLAGS = -O3 -funroll-loops -fomit-frame-pointer -march=i686 -mtune=pentium4 - WINDOWS_HACKS = -D'O_NONBLOCK=1' - CFLAGS += -mms-bitfields $(WINDOWS_HACKS) + 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 @@ -134,7 +141,7 @@ endif CFLAGS += $(OPT_CFLAGS) -.PHONY = install libdir_install single_install install-doc install-exec install-examples clean dist etags +.PHONY = install libdir_install single_install install-doc install-exec install-examples install-manual clean dist etags all: $(SOURCES:.c=.$(EXTENSION)) @@ -155,7 +162,7 @@ install: libdir_install # The meta and help files are explicitly installed to make sure they are # actually there. Those files are not optional, then need to be there. -libdir_install: $(SOURCES:.c=.$(EXTENSION)) install-doc install-examples +libdir_install: $(SOURCES:.c=.$(EXTENSION)) install-doc install-examples install-manual $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) $(INSTALL_FILE) $(LIBRARY_NAME)-meta.pd \ $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) @@ -181,16 +188,21 @@ install-doc: $(INSTALL_FILE) $(PDOBJECTS:.pd=-help.pd) \ $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) $(INSTALL_FILE) README.txt $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/README.txt - $(INSTALL_FILE) \ - pause.gif play.gif playy.gif rec.gif saww.gif sin.gif sinw.gif squarew.gif \ - $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) - $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/d - $(INSTALL_FILE) d/d*.gif $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/d/ + $(INSTALL_FILE) LICENSE.txt $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/LICENSE.txt install-examples: - test ! -d examples || (\ + test -z "$(strip $(EXAMPLES))" || \ $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/examples && \ - $(INSTALL_FILE) examples/*.* $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/examples) + for file in $(EXAMPLES); do \ + $(INSTALL_FILE) examples/$$file $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/examples; \ + done + +install-manual: + test -z "$(strip $(MANUAL))" || \ + $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/manual && \ + for file in $(MANUAL); do \ + $(INSTALL_FILE) manual/$$file $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/manual; \ + done clean: @@ -221,6 +233,8 @@ $(DISTDIR): dist: $(DISTDIR) $(INSTALL_FILE) Makefile $(DISTDIR) + $(INSTALL_FILE) README.txt $(DISTDIR) + $(INSTALL_FILE) LICENSE.txt $(DISTDIR) $(INSTALL_FILE) $(LIBRARY_NAME)-meta.pd $(DISTDIR) test -z "$(strip $(ALLSOURCES))" || \ $(INSTALL_FILE) $(ALLSOURCES) $(DISTDIR) @@ -232,6 +246,17 @@ dist: $(DISTDIR) $(INSTALL_FILE) $(PDOBJECTS:.pd=-help.pd) $(DISTDIR) test -z "$(strip $(EXTRA_DIST))" || \ $(INSTALL_FILE) $(EXTRA_DIST) $(DISTDIR) + test -z "$(strip $(EXAMPLES))" || \ + $(INSTALL_DIR) $(DISTDIR)/examples && \ + for file in $(EXAMPLES); do \ + $(INSTALL_FILE) examples/$$file $(DISTDIR)/examples; \ + done + test -z "$(strip $(MANUAL))" || \ + $(INSTALL_DIR) $(DISTDIR)/manual && \ + for file in $(MANUAL); do \ + $(INSTALL_FILE) manual/$$file $(DISTDIR)/manual; \ + done +# special case for this library $(INSTALL_DIR) $(DISTDIR)/d $(INSTALL_FILE) d/d*.gif $(DISTDIR)/d/ tar --exclude-vcs -czpf $(DISTDIR).tar.gz $(DISTDIR) @@ -240,12 +265,13 @@ dist: $(DISTDIR) etags: etags *.h $(SOURCES) ../../pd/src/*.[ch] /usr/include/*.h /usr/include/*/*.h -showpaths: +showsetup: @echo "PD_PATH: $(PD_PATH)" @echo "objectsdir: $(objectsdir)" @echo "LIBRARY_NAME: $(LIBRARY_NAME)" + @echo "LIBRARY_VERSION: $(LIBRARY_VERSION)" @echo "SOURCES: $(SOURCES)" + @echo "PDOBJECTS: $(PDOBJECTS)" @echo "ALLSOURCES: $(ALLSOURCES)" @echo "UNAME: $(UNAME)" @echo "CPU: $(CPU)" - -- cgit v1.2.1