annotate Makefile @ 12:6dbe7751bc40

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