updated to Makefile version 1.0.3

svn path=/trunk/externals/iem/comport/; revision=13994
This commit is contained in:
Hans-Christoph Steiner 2010-09-07 23:27:26 +00:00
parent aedbea26e8
commit ca1cc57e87

View file

@ -1,4 +1,4 @@
## Pd library template version 1.0.2 ## Pd library template version 1.0.3
# 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
@ -31,7 +31,7 @@ EXTRA_DIST = CHANGES.txt comport.dsp comport.dsw comport-stress-test.pd
# #
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
CFLAGS = -DPD -I$(PD_PATH)/src -Wall -W -g CFLAGS = -DPD -I"$(PD_INCLUDE)" -Wall -W -g
LDFLAGS = LDFLAGS =
LIBS = LIBS =
@ -44,9 +44,10 @@ LIBS =
# get library version from meta file # 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) 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 CFLAGS += -DVERSION='"$(LIBRARY_VERSION)"'
PD_PATH = ../../pd
# where to install the library PD_INCLUDE = $(PD_PATH)/include
# where to install the library, overridden below depending on platform
prefix = /usr/local prefix = /usr/local
libdir = $(prefix)/lib libdir = $(prefix)/lib
pkglibdir = $(libdir)/pd-externals pkglibdir = $(libdir)/pd-externals
@ -70,6 +71,7 @@ ifeq ($(UNAME),Darwin)
SOURCES += $(SOURCES_iphoneos) SOURCES += $(SOURCES_iphoneos)
EXTENSION = pd_darwin EXTENSION = pd_darwin
OS = iphoneos OS = iphoneos
PD_PATH = /Applications/Pd-extended.app/Contents/Resources
IPHONE_BASE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin IPHONE_BASE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
CC=$(IPHONE_BASE)/gcc CC=$(IPHONE_BASE)/gcc
CPP=$(IPHONE_BASE)/cpp CPP=$(IPHONE_BASE)/cpp
@ -77,8 +79,7 @@ ifeq ($(UNAME),Darwin)
ISYSROOT = -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk ISYSROOT = -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk
IPHONE_CFLAGS = -miphoneos-version-min=3.0 $(ISYSROOT) -arch armv6 IPHONE_CFLAGS = -miphoneos-version-min=3.0 $(ISYSROOT) -arch armv6
OPT_CFLAGS = -fast -funroll-loops -fomit-frame-pointer OPT_CFLAGS = -fast -funroll-loops -fomit-frame-pointer
CFLAGS := $(IPHONE_CFLAGS) $(OPT_CFLAGS) $(CFLAGS) \ CFLAGS := $(IPHONE_CFLAGS) $(OPT_CFLAGS) $(CFLAGS)
-I/Applications/Pd-extended.app/Contents/Resources/include
LDFLAGS += -arch armv6 -bundle -undefined dynamic_lookup $(ISYSROOT) LDFLAGS += -arch armv6 -bundle -undefined dynamic_lookup $(ISYSROOT)
LIBS += -lc LIBS += -lc
STRIP = strip -x STRIP = strip -x
@ -87,6 +88,7 @@ ifeq ($(UNAME),Darwin)
SOURCES += $(SOURCES_macosx) SOURCES += $(SOURCES_macosx)
EXTENSION = pd_darwin EXTENSION = pd_darwin
OS = macosx OS = macosx
PD_PATH = /Applications/Pd-extended.app/Contents/Resources
OPT_CFLAGS = -ftree-vectorize -ftree-vectorizer-verbose=2 -fast OPT_CFLAGS = -ftree-vectorize -ftree-vectorizer-verbose=2 -fast
# build universal 32-bit on 10.4 and 32/64 on newer # 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) ifeq ($(shell uname -r | sed 's|\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*|\1|'), 8)
@ -95,8 +97,7 @@ ifeq ($(UNAME),Darwin)
FAT_FLAGS = -arch ppc -arch i386 -arch x86_64 -mmacosx-version-min=10.4 FAT_FLAGS = -arch ppc -arch i386 -arch x86_64 -mmacosx-version-min=10.4
SOURCES += $(SOURCES_iphoneos) SOURCES += $(SOURCES_iphoneos)
endif endif
CFLAGS += $(FAT_FLAGS) -fPIC -I/sw/include \ CFLAGS += $(FAT_FLAGS) -fPIC -I/sw/include
-I/Applications/Pd-extended.app/Contents/Resources/include
LDFLAGS += $(FAT_FLAGS) -bundle -undefined dynamic_lookup -L/sw/lib LDFLAGS += $(FAT_FLAGS) -bundle -undefined dynamic_lookup -L/sw/lib
# if the 'pd' binary exists, check the linking against it to aid with stripping # 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) LDFLAGS += $(shell test -e $(PD_PATH)/bin/pd && echo -bundle_loader $(PD_PATH)/bin/pd)
@ -112,6 +113,7 @@ ifeq ($(UNAME),Linux)
SOURCES += $(SOURCES_linux) SOURCES += $(SOURCES_linux)
EXTENSION = pd_linux EXTENSION = pd_linux
OS = linux OS = linux
PD_PATH = /usr
OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
CFLAGS += -fPIC CFLAGS += -fPIC
LDFLAGS += -Wl,--export-dynamic -shared -fPIC LDFLAGS += -Wl,--export-dynamic -shared -fPIC
@ -124,9 +126,10 @@ ifeq (CYGWIN,$(findstring CYGWIN,$(UNAME)))
SOURCES += $(SOURCES_cygwin) SOURCES += $(SOURCES_cygwin)
EXTENSION = dll EXTENSION = dll
OS = cygwin OS = cygwin
PD_PATH = $(cygpath $(PROGRAMFILES))/pd
OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
CFLAGS += CFLAGS +=
LDFLAGS += -Wl,--export-dynamic -shared -L$(PD_PATH)/src LDFLAGS += -Wl,--export-dynamic -shared -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin"
LIBS += -lc -lpd LIBS += -lc -lpd
STRIP = strip --strip-unneeded -R .note -R .comment STRIP = strip --strip-unneeded -R .note -R .comment
DISTBINDIR=$(DISTDIR)-$(OS) DISTBINDIR=$(DISTDIR)-$(OS)
@ -136,10 +139,11 @@ ifeq (MINGW,$(findstring MINGW,$(UNAME)))
SOURCES += $(SOURCES_windows) SOURCES += $(SOURCES_windows)
EXTENSION = dll EXTENSION = dll
OS = windows OS = windows
PD_PATH = $(shell cd "$(PROGRAMFILES)"/pd && pwd)
OPT_CFLAGS = -O3 -funroll-loops -fomit-frame-pointer -march=i686 -mtune=pentium4 OPT_CFLAGS = -O3 -funroll-loops -fomit-frame-pointer -march=i686 -mtune=pentium4
CFLAGS += -mms-bitfields CFLAGS += -mms-bitfields
LDFLAGS += -s -shared -Wl,--enable-auto-import 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 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 STRIP = strip --strip-unneeded -R .note -R .comment
DISTBINDIR=$(DISTDIR)-$(OS) DISTBINDIR=$(DISTDIR)-$(OS)
endif endif
@ -281,6 +285,10 @@ etags:
etags *.h $(SOURCES) ../../pd/src/*.[ch] /usr/include/*.h /usr/include/*/*.h etags *.h $(SOURCES) ../../pd/src/*.[ch] /usr/include/*.h /usr/include/*/*.h
showsetup: showsetup:
@echo "CFLAGS: $(CFLAGS)"
@echo "LDFLAGS: $(LDFLAGS)"
@echo "LIBS: $(LIBS)"
@echo "PD_INCLUDE: $(PD_INCLUDE)"
@echo "PD_PATH: $(PD_PATH)" @echo "PD_PATH: $(PD_PATH)"
@echo "objectsdir: $(objectsdir)" @echo "objectsdir: $(objectsdir)"
@echo "LIBRARY_NAME: $(LIBRARY_NAME)" @echo "LIBRARY_NAME: $(LIBRARY_NAME)"