#==============================================================================# # # Centralized cross-platform build system # # see for instructions: http://puredata.org/docs/developer/build # # #==============================================================================# CWD := $(shell pwd) SRC_ROOT_DIR = $(CWD)/.. INSTALL_PREFIX = $(SRC_ROOT_DIR)/packages/build BUILDLAYOUT_DIR = $(CWD) # default target all: pd abstractions doc externals #all: pd abstractions doc externals flext gem @echo "Complete build succeeded!" include $(BUILDLAYOUT_DIR)/Makefile.buildlayout #==============================================================================# # # GET VERSIONS FOR RELEVANT SOFTWARE # #==============================================================================# CYCLONE_MAJOR_VERSION := $(shell grep CYCLONE_VERSION \ $(EXTERNALS_SRC)/miXed/cyclone/build_counter | cut -d ' ' -f 3 | \ cut -d '"' -f 2) CYCLONE_RELEASE := $(shell grep CYCLONE_RELEASE \ $(EXTERNALS_SRC)/miXed/cyclone/build_counter | cut -d ' ' -f 3 | \ cut -d '"' -f 2) CYCLONE_BUILD := $(shell grep CYCLONE_BUILD \ $(EXTERNALS_SRC)/miXed/cyclone/build_counter | cut -d ' ' -f 3 | \ cut -d '"' -f 2) CYCLONE_VERSION := $(CYCLONE_MAJOR_VERSION) $(CYCLONE_RELEASE) $(CYCLONE_BUILD) FLEXT_MAJOR_VERSION := $(shell grep FLEXTMAJOR \ $(EXTERNALS_SRC)/grill/flext/buildsys/version.inc | cut -d '=' -f2) FLEXT_MINOR_VERSION := $(shell grep FLEXTMINOR \ $(EXTERNALS_SRC)/grill/flext/buildsys/version.inc | cut -d '=' -f2) FLEXT_MICRO_VERSION := $(shell grep FLEXTMICRO \ $(EXTERNALS_SRC)/grill/flext/buildsys/version.inc | cut -d '=' -f2) FLEXT_VERSION := $(FLEXT_MAJOR_VERSION).$(FLEXT_MINOR_VERSION).$(FLEXT_MICRO_VERSION) GEM_VERSION := $(shell grep "GEM_VERSION" $(GEM_SRC)/src/Base/GemVersion.h | \ cut -d '"' -f 2) MAXLIB_VERSION := $(shell grep "define VERSION" \ $(EXTERNALS_SRC)/maxlib/maxlib.c | cut -d '"' -f 2) OSC_VERSION := $(shell grep "define VERSION" $(EXTERNALS_SRC)/OSCx/src/OSC.c | \ cut -d '"' -f 2) PDP_VERSION := $(shell grep PDP_VERSION= $(EXTERNALS_SRC)/pdp/configure | \ cut -d '=' -f 2) PMPD_VERSION := $(shell grep "define VERSION" \ $(EXTERNALS_SRC)/pmpd/src/pmpd.c | cut -d '"' -f 2) TOXY_MAJOR_VERSION := $(shell grep TOXY_VERSION \ $(EXTERNALS_SRC)/miXed/toxy/build_counter | cut -d ' ' -f 3 | \ cut -d '"' -f 2) TOXY_RELEASE := $(shell grep TOXY_RELEASE \ $(EXTERNALS_SRC)/miXed/toxy/build_counter | cut -d ' ' -f 3 | \ cut -d '"' -f 2) TOXY_BUILD := $(shell grep TOXY_BUILD \ $(EXTERNALS_SRC)/miXed/toxy/build_counter | cut -d ' ' -f 3 | \ cut -d '"' -f 2) TOXY_VERSION := $(TOXY_MAJOR_VERSION) $(TOXY_RELEASE) $(TOXY_BUILD) ZEXY_VERSION := $(shell grep VERSION $(EXTERNALS_SRC)/zexy/src/zexy.h | \ grep -v _VERSION | cut -d ' ' -f 3 | cut -d '"' -f 2) # these are sent to all of the various Makefiles so that they all copy their # output to the same directory tree DEST_PATHS = BUILDLAYOUT_DIR=$(BUILDLAYOUT_DIR) \ SRC_ROOT_DIR=$(SRC_ROOT_DIR) \ INSTALL_PREFIX=$(INSTALL_PREFIX) \ UNAME=$(UNAME) #==============================================================================# # # BUILD TARGETS # #==============================================================================# #------------------------------------------------------------------------------ # abstractions abstractions: #------------------------------------------------------------------------------ # doc doc: #------------------------------------------------------------------------------ # externals externals: cd $(EXTERNALS_SRC) && make $(DEST_PATHS) #------------------------------------------------------------------------------ # flext flext: # nusmuk cd $(EXTERNALS_SRC)/nusmuk/msd && $(EXTERNALS_SRC)/grill/flext/build.sh \ pd gcc cd $(EXTERNALS_SRC)/nusmuk/msd2D && $(EXTERNALS_SRC)/grill/flext/build.sh \ pd gcc cd $(EXTERNALS_SRC)/nusmuk/msd3D && $(EXTERNALS_SRC)/grill/flext/build.sh \ pd gcc #------------------------------------------------------------------------------ # Gem gem: # cd $(GEM_SRC)/Gem && xcodebuild #------------------------------------------------------------------------------ # pd # pd's makefile has some of its own variables that need to be remapped # this relies on patches/build_vars_4_makefile.in.patch DESTDIR = "" ifeq ($(OS_NAME),darwin) LIBPD_DEST = $(INSTALL_PREFIX) LIBBIN_DEST = $(BIN_DEST) else ifeq ($(OS_NAME),win) LIBPD_DEST = $(INSTALL_PREFIX) LIBBIN_DEST = $(BIN_DEST) else LIBPD_DEST = $(INSTDIR)/lib/pd LIBBIN_DEST = $(LIB_DEST)/pd/bin endif endif PD_DEST_PATHS = $(DEST_PATHS) DESTDIR=$(DESTDIR) \ LIBPD_DEST=$(LIBPD_DEST) \ LIBBIN_DEST=$(LIBBIN_DEST) PD_CONFIGURE_FLAGS = PD_EXTRA_FLAGS = # Pd sometimes needs a specific autoconf, which is labeled differently on different # machines #PD_AUTOCONF := ${shell ( test -x "`which autoconf-2.59`" && echo autoconf-2.59 ) || echo autoconf } PD_AUTOCONF = autoconf pd: echo "DESTDIR $(DESTDIR) LIBBIN_DEST $(LIBBIN_DEST)" echo "DEST_PATHS $(DEST_PATHS)" echo "PD_DEST_PATHS $(PD_DEST_PATHS)" echo "PD_EXTRA_FLAGS $(PD_EXTRA_FLAGS)" cd $(PD_SRC)/src/ && $(PD_AUTOCONF) cd $(PD_SRC)/src && ./configure $(PD_CONFIGURE_FLAGS) && \ make $(PD_DEST_PATHS) $(PD_EXTRA_FLAGS) #==============================================================================# # # INSTALL TARGETS # #==============================================================================# #------------------------------------------------------------------------------ # install install: license_install readme_install welcome_install gem_install install: pd_install abstractions_install doc_install externals_install install: noncvs_install @echo "Complete install succeeded!" #------------------------------------------------------------------------------ # abstractions_install abstractions_install: cd $(ABSTRACTIONS_SRC) && make $(DEST_PATHS) install #------------------------------------------------------------------------------ # doc_install doc_install: cd $(DOC_SRC) && make $(DEST_PATHS) install #------------------------------------------------------------------------------ # externals_install externals_install: cd $(EXTERNALS_SRC) && make $(DEST_PATHS) install #------------------------------------------------------------------------------ # flext_install flext_install: # nusmuk cd $(EXTERNALS_SRC)/nusmuk/msd && $(EXTERNALS_SRC)/grill/flext/build.sh \ pd gcc install cd $(EXTERNALS_SRC)/nusmuk/msd2D && $(EXTERNALS_SRC)/grill/flext/build.sh \ pd gcc install cd $(EXTERNALS_SRC)/nusmuk/msd3D && $(EXTERNALS_SRC)/grill/flext/build.sh \ pd gcc install #TODO: need to add nusmuk/editor #------------------------------------------------------------------------------ # gem_install GEM_NAME = gem gem_install: gem $(HELP_DEST) install -p $(GEM_SRC)/help/*.* $(HELP_DEST) install -p $(GEM_SRC)/abstractions/*-help.pd $(HELP_DEST) install -d $(OBJECTS_DEST)/$(GEM_NAME) install -p $(shell ls -1 $(GEM_SRC)/abstractions/*.* | \ grep -v '\-help.pd') $(OBJECTS_DEST) install -d $(MANUALS_DEST)/$(GEM_NAME) install -p $(GEM_SRC)/doc/*.* $(MANUALS_DEST)/$(GEM_NAME) install -d $(MANUALS_DEST)/$(GEM_NAME)/manual install -p $(GEM_SRC)/manual/*.* $(MANUALS_DEST)/$(GEM_NAME)/manual for dir in $(shell ls -1 $(GEM_SRC)/examples | grep -v CVS); do \ echo "installing $$dir"; \ install -d $(APPLICATIONS_DEST)/$(GEM_NAME)/$$dir ; \ install -p $(GEM_SRC)/examples/$$dir/*.* $(APPLICATIONS_DEST)/$(GEM_NAME)/$$dir ; \ done #------------------------------------------------------------------------------ # noncvs_install # this is for including pre-compiled binaries in a build noncvs_install: -install -p $(PACKAGES_SRC)/noncvs/$(OS_NAME)/bin/*.* $(BIN_DEST) -install -p $(PACKAGES_SRC)/noncvs/$(OS_NAME)/doc/5.reference/*.* \ $(HELP_DEST) -install -p $(PACKAGES_SRC)/noncvs/$(OS_NAME)/extra/*.* $(OBJECTS_DEST) #------------------------------------------------------------------------------ # pd_install PD_NAME=Pd pd_install: pd cd $(PD_SRC)/src && \ make $(PD_DEST_PATHS) $(PD_EXTRA_FLAGS) install install -d $(MANUALS_DEST)/$(PD_NAME) install -p $(PD_SRC)/src/notes.txt $(MANUALS_DEST)/$(PD_NAME) #==============================================================================# # # GENERATE TEXT FILES FOR PACKAGE # #==============================================================================# LICENSE_FILE = $(MANUALS_DEST)/$(PD_NAME)/License.html license_install: # generate HTML version of License touch $(LICENSE_FILE) echo "" >> "$(LICENSE_FILE)" echo "

(Parts of this package can be used under " >> "$(LICENSE_FILE)" echo "Pd"s BSD license)

" >> "$(LICENSE_FILE)" echo "" >> "$(LICENSE_FILE)" cat "$(EXTERNALS_SRC)/creb/COPYING" | sed -e 's/^$$/\/g' >> "$(LICENSE_FILE)" echo "" >> $(LICENSE_FILE) # Pd's license file install -p "$(PD_SRC)/LICENSE.txt" "$(MANUALS_DEST)/$(PD_NAME)/PD LICENSE.txt" WELCOME_FILE = $(MANUALS_DEST)/$(PD_NAME)/Welcome.html welcome_install: touch $(WELCOME_FILE) echo "

" >> $(WELCOME_FILE) echo "

" >> $(WELCOME_FILE) echo "

Version $(PD_VERSION)

" >> $(WELCOME_FILE) echo "

written by Miller S. Puckette

" >> $(WELCOME_FILE) echo "" >> $(WELCOME_FILE) echo "

`grep -A9 ACKNOWLEDG $(PD_SRC)/README.txt`

" >> $(WELCOME_FILE) echo "
" >> $(WELCOME_FILE) echo "" >> $(WELCOME_FILE) README_FILE = $(MANUALS_DEST)/$(PD_NAME)/ReadMe.html readme_install: echo $(CYCLONE_RELEASE) -rm $(README_FILE) touch $(README_FILE) echo "" >> $(README_FILE) echo "" >> $(README_FILE) echo "" >> $(README_FILE) echo "" >> $(README_FILE) echo "" >> $(README_FILE) echo "

Pure Data $(PD_VERSION)-$(PACKAGE_VERSION)

" >> $(README_FILE) echo "

Pd is a free real-time computer music software package resembling Max. It provides a patchable environment for audio analysis, synthesis, and processing, with a rich set of multimedia capabilities. You can get Pd for Linux, Windows, MacOS X, BSD, or IRIX.

" >> $(README_FILE) echo "

For more information, go to: http://puredata.org

" >> $(README_FILE) echo "

Installation

" >> $(README_FILE) echo "

To install Pd, drag the Pd.app to anywhere in your hard disk.

" >> $(README_FILE) echo "

To install Gem, pmpd, xsample, dyn~, and vasp support, copy org.puredata.pd.plist to ~/Library/Preferences (~ means your home folder). WARNING: this will overwrite any existing Pd preferences!

" >> $(README_FILE) echo "

Pure Data CVS Developers

" >> $(README_FILE) # this may seem whack, but it generates the list of developers from the SourceForge site: curl 'http://sourceforge.net/project/memberlist.php?group_id=55736' | grep -A2 -e '' | sed 's|\(href="\)|target="w" \1http://sourceforge.net|' >> $(README_FILE) echo "

" >> $(README_FILE) echo "

" >> $(README_FILE) echo "Many others not listed have contributed their time and effort, this is just a list of the current developers in the SourceForge project. But really, every Pd user is a developer and is encouraged to contribute to the CVS repository." >> $(README_FILE) echo "

" >> $(README_FILE) echo "

License

" >> $(README_FILE) echo "

" >> $(README_FILE) echo "The Pd core is licensed under a BSD license, almost every other part of this package is available under the GNU GPL. A couple packages have BSD-style licenses too." >> $(README_FILE) echo "

" >> $(README_FILE) echo "

Included Versions

" >> $(README_FILE) echo "

These externals are all included from the Pd CVS repository:

" >> $(README_FILE) echo "" >> $(README_FILE) echo "(this package was built on `date`)
" >> $(README_FILE) echo "" >> $(README_FILE) #==============================================================================# # ## FINAL ASSEMBLY # #==============================================================================# #---------------------------------------------------------------------------- # DOC_FORMAT doc_format: # clean out cruft files -find $(INSTALL_PREFIX) -name .DS_Store -delete -find $(INSTALL_PREFIX) -name '*.*.bak' -delete # run script to move help-*.pd files to *-help.pd according to the standard cd $(DOCS_DEST) && \ $(SCRIPTS_SRC)/convert-help-to-standard.sh # remove write perms to prevent people form editing the helpfiles by mistake cd $(DOCS_DEST) && chmod a-wx */*.pd */*/*.pd find $(DOCS_DEST) -name '*.pd' -print0 | xargs -0 chmod a-wx find $(DOCS_DEST) -name '*.txt' -print0 | xargs -0 chmod a-wx #==============================================================================# # # DEVELOPER TARGETS # #==============================================================================# devsymlinks: patch_pd: @echo PD_SRC $(PD_SRC) # change Pd's version number to reflect the extended build cd $(PD_SRC)/src/ && \ sed 's/\(pd_version\[\] = "Pd version \)[0-9extndRC.-]*/\1$(PD_VERSION)-$(PACKAGE_VERSION)/' s_main.c > s_main.c.tmp && \ mv s_main.c.tmp s_main.c # apply all platform-neutral patches for patch in $(wildcard $(CWD)/patches/*.patch); do \ echo "Applying $$patch"; \ cd $(PD_SRC)/src/ && patch -p0 < $$patch; \ done # apply all platform-specific patches for patch in $(wildcard $(CWD)/patches/$(OS_NAME)/*.patch); do \ echo "Applying $$patch"; \ cd $(PD_SRC)/src/ && patch -p0 < $$patch; \ done -rm -f -- $(PD_SRC)/src/configure $(PD_SRC)/src/makefile @echo " " @echo "patching succeeded!" unpatch_pd: # this sed pattern won't work with TEST versions cd $(PD_SRC)/src && \ sed 's/\(pd_version\[\] = "Pd version [0-9]\.[0-9]*[.-][0-9]*\)[0-9extndRC.-]*/\1/' \ s_main.c > s_main.c.tmp && \ mv s_main.c.tmp s_main.c # apply all platform-neutral patches for patch in $(wildcard $(CWD)/patches/*.patch); do \ echo "Applying $$patch"; \ cd $(PD_SRC)/src/ && patch -p0 -R < $$patch; \ done # apply all platform-specific patches for patch in $(wildcard $(CWD)/patches/$(OS_NAME)/*.patch); do \ echo "Applying $$patch"; \ cd $(PD_SRC)/src/ && patch -p0 -R < $$patch; \ done -rm -f -- $(PD_SRC)/src/configure $(PD_SRC)/src/makefile @echo " " @echo "unpatching succeeded!" #==============================================================================# # # CLEAN TARGETS # #==============================================================================# abstractions_clean: -cd $(ABSTRACTIONS_SRC) && make $(DEST_PATHS) clean doc_clean: externals_clean: -cd $(EXTERNALS_SRC) && make $(DEST_PATHS) clean flext_clean: gem_clean: pd_clean: -cd $(PD_SRC) && make $(PD_DEST_PATHS) clean # these targets are all from Makefile.buildlayout: install_clean cruft_clean clean: abstractions_clean doc_clean externals_clean flext_clean clean: gem_clean pd_clean echo "Complete clean finished." distclean: clean cruft_clean