updated to Makefile version 1.0.2

svn path=/trunk/externals/iem/comport/; revision=13928
This commit is contained in:
Hans-Christoph Steiner 2010-08-24 04:46:07 +00:00
parent 5c88ace13d
commit 728f8cce8d

View file

@ -1,21 +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: # For instructions on how to use this template, see:
# http://puredata.info/docs/developer/MakefileTemplate # http://puredata.info/docs/developer/MakefileTemplate
LIBRARY_NAME = comport LIBRARY_NAME = comport
# add your .c source files to the SOURCES variable, help files will be # add your .c source files, one object per file, to the SOURCES
# included automatically # variable, help files will be included automatically
SOURCES = comport.c SOURCES = comport.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 # list all pd objects (i.e. myobject.pd) files here, and their helpfiles will
# be included automatically # be included automatically
PDOBJECTS = PDOBJECTS =
@ -27,13 +18,23 @@ EXAMPLES =
MANUAL = MANUAL =
# if you want to include any other files in the source and binary tarballs, # 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 # documentation, etc. README.txt and LICENSE.txt are required and therefore
# automatically included # automatically included
EXTRA_DIST = CHANGES.txt comport.dsp comport.dsw comport-stress-test.pd EXTRA_DIST = CHANGES.txt comport.dsp comport.dsw comport-stress-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 :) # you shouldn't need to edit anything below here, if we did it right :)
@ -51,14 +52,10 @@ libdir = $(prefix)/lib
pkglibdir = $(libdir)/pd-externals pkglibdir = $(libdir)/pd-externals
objectsdir = $(pkglibdir) objectsdir = $(pkglibdir)
INSTALL = install INSTALL = install
INSTALL_FILE = $(INSTALL) -p -m 644 INSTALL_FILE = $(INSTALL) -p -m 644
INSTALL_DIR = $(INSTALL) -p -m 755 -d 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) \ ALLSOURCES := $(SOURCES) $(SOURCES_android) $(SOURCES_cygwin) $(SOURCES_macosx) \
$(SOURCES_iphoneos) $(SOURCES_linux) $(SOURCES_windows) $(SOURCES_iphoneos) $(SOURCES_linux) $(SOURCES_windows)
@ -110,6 +107,7 @@ ifeq ($(UNAME),Darwin)
endif endif
endif endif
ifeq ($(UNAME),Linux) ifeq ($(UNAME),Linux)
CPU := $(shell uname -m)
SOURCES += $(SOURCES_linux) SOURCES += $(SOURCES_linux)
EXTENSION = pd_linux EXTENSION = pd_linux
OS = linux OS = linux
@ -121,6 +119,7 @@ ifeq ($(UNAME),Linux)
DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m) DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
endif endif
ifeq (CYGWIN,$(findstring CYGWIN,$(UNAME))) ifeq (CYGWIN,$(findstring CYGWIN,$(UNAME)))
CPU := $(shell uname -m)
SOURCES += $(SOURCES_cygwin) SOURCES += $(SOURCES_cygwin)
EXTENSION = dll EXTENSION = dll
OS = cygwin OS = cygwin
@ -132,6 +131,7 @@ ifeq (CYGWIN,$(findstring CYGWIN,$(UNAME)))
DISTBINDIR=$(DISTDIR)-$(OS) DISTBINDIR=$(DISTDIR)-$(OS)
endif endif
ifeq (MINGW,$(findstring MINGW,$(UNAME))) ifeq (MINGW,$(findstring MINGW,$(UNAME)))
CPU := $(shell uname -m)
SOURCES += $(SOURCES_windows) SOURCES += $(SOURCES_windows)
EXTENSION = dll EXTENSION = dll
OS = windows OS = windows
@ -143,10 +143,13 @@ ifeq (MINGW,$(findstring MINGW,$(UNAME)))
DISTBINDIR=$(DISTDIR)-$(OS) DISTBINDIR=$(DISTDIR)-$(OS)
endif endif
# in case somebody manually set the HELPPATCHES above
HELPPATCHES ?= $(SOURCES:.c=-help.pd) $(PDOBJECTS:.c=-help.pd)
CFLAGS += $(OPT_CFLAGS) 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)) all: $(SOURCES:.c=.$(EXTENSION))
@ -162,7 +165,6 @@ $(LIBRARY_NAME): $(SOURCES:.c=.o) $(LIBRARY_NAME).o
$(CC) $(LDFLAGS) -o $(LIBRARY_NAME).$(EXTENSION) $(SOURCES:.c=.o) $(LIBRARY_NAME).o $(LIBS) $(CC) $(LDFLAGS) -o $(LIBRARY_NAME).$(EXTENSION) $(SOURCES:.c=.o) $(LIBRARY_NAME).o $(LIBS)
chmod a-x $(LIBRARY_NAME).$(EXTENSION) chmod a-x $(LIBRARY_NAME).$(EXTENSION)
install: libdir_install install: libdir_install
# The meta and help files are explicitly installed to make sure they are # The meta and help files are explicitly installed to make sure they are
@ -186,11 +188,8 @@ single_install: $(LIBRARY_NAME) install-doc install-exec
install-doc: install-doc:
$(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
test -z "$(strip $(SOURCES))" || \ test -z "$(strip $(SOURCES) $(PDOBJECTS))" || \
$(INSTALL_FILE) $(SOURCES:.c=-help.pd) \ $(INSTALL_FILE) $(HELPPATCHES) \
$(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
test -z "$(strip $(PDOBJECTS))" || \
$(INSTALL_FILE) $(PDOBJECTS:.pd=-help.pd) \
$(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
$(INSTALL_FILE) README.txt $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/README.txt $(INSTALL_FILE) README.txt $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/README.txt
$(INSTALL_FILE) LICENSE.txt $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/LICENSE.txt $(INSTALL_FILE) LICENSE.txt $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/LICENSE.txt
@ -211,7 +210,7 @@ install-manual:
clean: clean:
-rm -f -- $(SOURCES:.c=.o) -rm -f -- $(SOURCES:.c=.o) $(SOURCES_LIB:.c=.o)
-rm -f -- $(SOURCES:.c=.$(EXTENSION)) -rm -f -- $(SOURCES:.c=.$(EXTENSION))
-rm -f -- $(LIBRARY_NAME).o -rm -f -- $(LIBRARY_NAME).o
-rm -f -- $(LIBRARY_NAME).$(EXTENSION) -rm -f -- $(LIBRARY_NAME).$(EXTENSION)
@ -231,7 +230,7 @@ $(DISTBINDIR):
libdir: all $(DISTBINDIR) libdir: all $(DISTBINDIR)
$(INSTALL_FILE) $(LIBRARY_NAME)-meta.pd $(DISTBINDIR) $(INSTALL_FILE) $(LIBRARY_NAME)-meta.pd $(DISTBINDIR)
$(INSTALL_FILE) $(SOURCES) $(DISTBINDIR) $(INSTALL_FILE) $(SOURCES) $(DISTBINDIR)
$(INSTALL_FILE) $(SOURCES:.c=-help.pd) $(DISTBINDIR) $(INSTALL_FILE) $(HELPPATCHES) $(DISTBINDIR)
test -z "$(strip $(EXTRA_DIST))" || \ test -z "$(strip $(EXTRA_DIST))" || \
$(INSTALL_FILE) $(EXTRA_DIST) $(DISTBINDIR) $(INSTALL_FILE) $(EXTRA_DIST) $(DISTBINDIR)
# tar --exclude-vcs -czpf $(DISTBINDIR).tar.gz $(DISTBINDIR) # tar --exclude-vcs -czpf $(DISTBINDIR).tar.gz $(DISTBINDIR)
@ -249,12 +248,10 @@ dist: $(DISTDIR)
$(INSTALL_FILE) $(LIBRARY_NAME)-meta.pd $(DISTDIR) $(INSTALL_FILE) $(LIBRARY_NAME)-meta.pd $(DISTDIR)
test -z "$(strip $(ALLSOURCES))" || \ test -z "$(strip $(ALLSOURCES))" || \
$(INSTALL_FILE) $(ALLSOURCES) $(DISTDIR) $(INSTALL_FILE) $(ALLSOURCES) $(DISTDIR)
test -z "$(strip $(ALLSOURCES))" || \
$(INSTALL_FILE) $(ALLSOURCES:.c=-help.pd) $(DISTDIR)
test -z "$(strip $(PDOBJECTS))" || \ test -z "$(strip $(PDOBJECTS))" || \
$(INSTALL_FILE) $(PDOBJECTS) $(DISTDIR) $(INSTALL_FILE) $(PDOBJECTS) $(DISTDIR)
test -z "$(strip $(PDOBJECTS))" || \ test -z "$(strip $(HELPPATCHES))" || \
$(INSTALL_FILE) $(PDOBJECTS:.pd=-help.pd) $(DISTDIR) $(INSTALL_FILE) $(HELPPATCHES) $(DISTDIR)
test -z "$(strip $(EXTRA_DIST))" || \ test -z "$(strip $(EXTRA_DIST))" || \
$(INSTALL_FILE) $(EXTRA_DIST) $(DISTDIR) $(INSTALL_FILE) $(EXTRA_DIST) $(DISTDIR)
test -z "$(strip $(EXAMPLES))" || \ test -z "$(strip $(EXAMPLES))" || \