annotate skeleton/Makefile.skeleton @ 314:a1be2e4a5d22

Use g++-4.0 if using 10.4 SDK
author Chris Cannam
date Tue, 05 Apr 2011 11:00:44 +0100
parents 2ad57dd004ba
children dba435f9b283
rev   line source
cannam@299 1
cannam@299 2 ## Skeleton Makefile for Vamp plugin builds using command-line tools.
Chris@312 3 ## This requires GNU make, which is what you get with OS/X, Linux, or
Chris@312 4 ## MinGW/Cygwin on Windows.
cannam@299 5 ##
cannam@299 6 ## Rename this to Makefile, and edit as appropriate.
cannam@299 7 ## This Makefile WILL NOT WORK until you have edited it as described
cannam@299 8 ## below -- the Makefile as supplied does nothing useful at all!
cannam@299 9 ##
cannam@299 10 ## Various sets of options are provided, commented out -- just uncomment
cannam@299 11 ## (remove the '#' characters for) the set that most closely resembles
Chris@312 12 ## your own situation, and adjust to taste. Then run "gmake".
cannam@299 13 ##
cannam@299 14 ## (For Windows builds using MS Visual Studio, start instead with the
cannam@299 15 ## VampExamplePlugins project found in the build directory of the SDK.)
cannam@299 16
cannam@299 17
cannam@299 18 # Edit this to the base name of your plugin library
cannam@299 19 #
Chris@312 20 PLUGIN_LIBRARY_NAME := myplugins
cannam@299 21
Chris@312 22 # Edit this to list the .cpp or .c files in your plugin project
cannam@299 23 #
Chris@312 24 PLUGIN_SOURCES := MyPlugin.cpp plugins.cpp
Chris@312 25
Chris@312 26 # Edit this to list the .h files in your plugin project
Chris@312 27 #
Chris@312 28 PLUGIN_HEADERS := MyPlugin.h
cannam@299 29
cannam@299 30 # Edit this to the location of the Vamp plugin SDK, relative to your
cannam@299 31 # project directory
cannam@299 32 #
Chris@312 33 VAMP_SDK_DIR := ../vamp-plugin-sdk
cannam@299 34
cannam@299 35
cannam@306 36 ## Uncomment these for an OS/X universal binary (PPC and 32- and
cannam@306 37 ## 64-bit Intel) supporting 10.4 or newer (if you have the 10.4 SDK):
cannam@299 38
Chris@314 39 # CXX := g++-4.0
Chris@312 40 # CXXFLAGS := -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch i386 -arch x86_64 -arch ppc -I$(VAMP_SDK_DIR) -Wall -fPIC
Chris@312 41 # PLUGIN_EXT := .dylib
Chris@312 42 # LDFLAGS := $(CXXFLAGS) -dynamiclib -install_name $(PLUGIN) $(VAMP_SDK_DIR)/libvamp-sdk.a -exported_symbols_list vamp-plugin.list
cannam@299 43
cannam@299 44
cannam@306 45 ## Uncomment these for an OS/X universal binary (PPC and 32- and
cannam@306 46 ## 64-bit Intel) supporting 10.5 or newer (use this if you have the
cannam@306 47 ## default 10.6 developer tools):
cannam@299 48
Chris@312 49 # CXXFLAGS := -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -arch i386 -arch x86_64 -arch ppc -I$(VAMP_SDK_DIR) -Wall -fPIC
Chris@312 50 # PLUGIN_EXT := .dylib
Chris@312 51 # LDFLAGS := $(CXXFLAGS) -dynamiclib -install_name $(PLUGIN) $(VAMP_SDK_DIR)/libvamp-sdk.a -exported_symbols_list vamp-plugin.list
cannam@299 52
cannam@299 53
cannam@299 54 ## Uncomment these for Linux using the standard tools:
cannam@299 55
Chris@312 56 # CXXFLAGS := -I$(VAMP_SDK_DIR) -Wall -fPIC
Chris@312 57 # PLUGIN_EXT := .so
Chris@312 58 # LDFLAGS := -shared -Wl,-soname=$(PLUGIN) $(VAMP_SDK_DIR)/libvamp-sdk.a -Wl,--version-script=vamp-plugin.map
cannam@299 59
cannam@299 60
cannam@299 61 ## Uncomment these for a cross-compile from Linux to Windows using MinGW:
cannam@299 62
Chris@312 63 # CXX := i586-mingw32msvc-g++
Chris@312 64 # CXXFLAGS := -I$(VAMP_SDK_DIR) -Wall
Chris@312 65 # PLUGIN_EXT := .dll
Chris@312 66 # LDFLAGS := --static-libgcc -Wl,-soname=$(PLUGIN) -shared $(VAMP_SDK_DIR)/libvamp-sdk.a
cannam@299 67
cannam@299 68
cannam@299 69 ## Uncomment these for OpenSolaris using SunStudio compiler and GNU make:
cannam@299 70
Chris@312 71 # CXX := CC
Chris@312 72 # CXXFLAGS := -G -I$(VAMP_SDK_DIR) +w -KPIC
Chris@312 73 # PLUGIN_EXT := .so
Chris@312 74 # LDFLAGS := -G -h$(PLUGIN) $(VAMP_SDK_DIR)/libvamp-sdk.a -Qoption ld -Mvamp-plugin.map
cannam@299 75
cannam@299 76
cannam@299 77
cannam@299 78 ## All of the above
cannam@299 79
Chris@312 80 PLUGIN := $(PLUGIN_LIBRARY_NAME)$(PLUGIN_EXT)
Chris@312 81
Chris@312 82 PLUGIN_OBJECTS := $(PLUGIN_SOURCES:.cpp=.o)
Chris@312 83 PLUGIN_OBJECTS := $(PLUGIN_OBJECTS:.c=.o)
Chris@312 84
Chris@312 85 $(PLUGIN): $(PLUGIN_OBJECTS)
cannam@299 86 $(CXX) -o $@ $^ $(LDFLAGS)
cannam@299 87
Chris@312 88 $(PLUGIN_OBJECTS): $(PLUGIN_HEADERS)
Chris@312 89
cannam@299 90 clean:
cannam@299 91 rm -f *.o
cannam@299 92