Personal tools
You are here: Home documentation developer MakefileTemplate
Views

If you are starting a new library, you should start with the library template that is included in the pure-data SVN. This template works on GNU/Linux, Mac OS X, and Windows/MinGW. There is also preliminary support for building the library for Android, iPhoneOS, and Windows/Cygwin.

You can get the whole template example project form SVN but running this command in your terminal:

svn co https://pure-data.svn.sourceforge.net/svnroot/pure-data/trunk/externals/template

This template is also meant to be easily debianized. Mostly, you'll just need to search-and-replace the word template with the name of your library.

To use this Makefile for your project, first edit the template-meta.pd file. Replace the word 'template' with the name of your library in NAME comment, and set the version of your library in the VERSION comment. Now, anywhere in this template project you see the word template, replace it with the name of your library. The folder for your project must have the same name as your library, the meta file, etc.

Useful Commands

make

build all objects in the library

make install

build all objects in the library and install as a Libdir

make dist

make a versioned tarball from all relevant files, useful for making releases and packaging

make clean

clean all build products (i.e. files like .o, .pd_linux, .pd_darwin, etc.)

make distclean

make as clean as the original dist tarball

make dpkg-source

make a Debian source package

Platform-specific Options

Objects

For objects that only build on certain platforms, you can add those to special SOURCES variables for each supported platform.

SOURCES_android = 
SOURCES_cygwin = 
SOURCES_macosx = 
SOURCES_iphoneos = 
SOURCES_linux = 
SOURCES_windows = 

Setting libraries to link to

For objects that rely on different libraries, like libpthread or libspeex, you might need to set the flags differently for each platform. You can do that with the platform-specific LIBS variables:

LIBS_android = 
LIBS_cygwin = 
LIBS_macosx = 
LIBS_iphoneos = 
LIBS_linux = 
LIBS_windows = 

Changelog

  • 1.0.2 removed SOURCES_* variables and moves CFLAGS, LDFLAGS, and LIBS to an editing section

  • 1.0.1 added dpkg-source to make Debian source packages

  • 1.0 first release



Powered by IEM Powered by Plone Section 508 WCAG Valid XHTML Valid CSS Usable in any browser