1 #==============================================================================#
3 # Centralized cross-platform build system Makefile.buildsystem
5 # this file contains all the common locations and targets
8 #==============================================================================#
9 # This file should be exactly the same in each section of the CVS. A copy is
10 # kept in each section of the CVS so that each section will be self-contained.
11 # To use it, you need to include it in your Makefile (i.e. "include
12 # Makefile.buildlayout") and then define $(prefix) and $(cvs_root_dir).
14 # $(cvs_root_dir) is the base directory of src tree, equivalent to the root
15 # level of the pure-data CVS.
17 # $(prefix) is the base directory to where all of the resulting files
20 # This file is currently located in these places:
27 # it will be going here too:
33 #==============================================================================#
35 ## PLATFORM-SPECIFIC SETTINGS
37 #==============================================================================#
38 # which OS to compile for
39 UNAME := $(shell uname -s)
45 ifeq ($(UNAME),Darwin)
48 DYLIB_EXTENSION = dylib
50 ifeq (MINGW,$(findstring MINGW,$(UNAME)))
55 ifeq (CYGWIN,$(findstring CYGWIN,$(UNAME)))
60 # which CPU to compile for
61 UNAME_MACHINE := $(shell uname -m)
62 ifeq ($(UNAME_MACHINE),i386)
65 ifeq ($(UNAME_MACHINE),i686)
68 ifeq ($(UNAME_MACHINE),ppc)
71 # if machine has dpkg-deb, build a Debian package
72 ifeq ($(shell test -x /usr/bin/dpkg-deb && echo YES),YES)
78 #==============================================================================#
82 #==============================================================================#
84 # base level optimizations
89 #==============================================================================#
93 #==============================================================================#
96 abstractions_src = $(cvs_root_dir)/abstractions
97 doc_src = $(cvs_root_dir)/doc
98 extensions_src = $(cvs_root_dir)/extensions
99 externals_src = $(cvs_root_dir)/externals
100 flext_src = $(cvs_root_dir)/externals/grill/flext
101 gem_src = $(cvs_root_dir)/Gem
102 packages_src = $(cvs_root_dir)/packages
103 pd_src = $(cvs_root_dir)/pd
104 scripts_src = $(cvs_root_dir)/scripts
108 bindir = $(prefix)/bin
109 includedir = $(prefix)/include
110 mandir = $(prefix)/man
112 libdir = $(prefix)/lib
113 ifeq ($(OS_NAME),darwin)
115 libpdbindir = $(bindir)
117 ifeq ($(OS_NAME),windows)
119 libpdbindir = $(bindir)
121 libpddir = $(libdir)/pd
122 libpdbindir = $(libpddir)/bin
126 objectsdir = $(libpddir)/extra
127 pddocdir = $(libpddir)/doc
128 examplesdir = $(pddocdir)/examples
129 helpdir = $(pddocdir)/5.reference
130 manualsdir = $(pddocdir)/manuals
131 readmesdir = $(manualsdir)/READMEs
134 #==============================================================================#
136 # DIRECTORY STRUCTURE TARGETS
138 #==============================================================================#
140 # first make sure that the directory structure is setup
142 install -d $(DESTDIR)
144 $(bindir): $(DESTDIR)
145 install -d $(DESTDIR)$(bindir)
147 $(examplesdir): $(DESTDIR)
148 install -d $(DESTDIR)$(examplesdir)
150 $(includedir): $(DESTDIR)
151 install -d $(DESTDIR)$(includedir)
153 $(pddocdir): $(DESTDIR)
154 install -d $(DESTDIR)$(pddocdir)
156 $(helpdir): $(DESTDIR)
157 install -d $(DESTDIR)$(helpdir)
159 $(manualsdir): $(DESTDIR)
160 install -d $(DESTDIR)$(manualsdir)
162 $(objectsdir): $(DESTDIR)
163 install -d $(DESTDIR)$(objectsdir)
165 $(readmesdir): $(manualsdir)
166 install -d $(DESTDIR)$(readmesdir)
168 installdirs: $(DESTDIR) $(bindir) $(examplesdir) $(pddocdir) $(includedir) $(helpdir) $(manualsdir) $(objectsdir) $(readmesdir)
170 #==============================================================================#
172 # PD VERSION AND PACKAGE NAMING
174 #==============================================================================#
177 PD_MAJOR_VERSION := $(shell grep PD_MAJOR_VERSION $(pd_src)/src/m_pd.h | \
178 sed 's|^.define *PD_MAJOR_VERSION *\([0-9]*\).*|\1|' )
179 PD_MINOR_VERSION := $(shell grep PD_MINOR_VERSION $(pd_src)/src/m_pd.h | \
180 sed 's|^.define *PD_MINOR_VERSION *\([0-9]*\).*|\1|' )
181 PD_BUGFIX_VERSION := $(shell grep PD_BUGFIX_VERSION $(pd_src)/src/m_pd.h | \
182 sed 's|^.define *PD_BUGFIX_VERSION *\([0-9]*\).*|\1|' )
183 PD_TEST_VERSION := $(shell grep PD_TEST_VERSION $(pd_src)/src/m_pd.h | \
184 sed 's|^.define *PD_TEST_VERSION *"\(.*\)".*|\1|' )
185 PD_VERSION = $(PD_MAJOR_VERSION).$(PD_MINOR_VERSION).$(PD_BUGFIX_VERSION)
186 ifneq ($(PD_TEST_VERSION),)
187 PD_VERSION := $(PD_VERSION)-$(PD_TEST_VERSION)
190 VERSION_DATE := $(shell date +%Y%m%d)
192 # release version for this distro
193 PD-EXTENDED_VERSION_PREFIX = extended
194 PD-EXTENDED_VERSION = $(PD-EXTENDED_VERSION_PREFIX)-$(VERSION_DATE)
196 PACKAGE_NAME = Pd-$(PD_VERSION)
199 #==============================================================================#
203 #==============================================================================#
206 -rm -f -- $(DESTDIR)$(examplesdir)/*/*/*/*/*.*
207 -rm -f -- $(DESTDIR)$(examplesdir)/*/*/*/*.*
208 -rm -f -- $(DESTDIR)$(examplesdir)/*/*/*.*
209 -rm -f -- $(DESTDIR)$(examplesdir)/*/*.*
210 -rmdir $(DESTDIR)$(examplesdir)/*/*/*/*
211 -rmdir $(DESTDIR)$(examplesdir)/*/*/*
212 -rmdir $(DESTDIR)$(examplesdir)/*/*
213 -rmdir $(DESTDIR)$(examplesdir)/*
214 -rmdir $(DESTDIR)$(examplesdir)
218 -rm -f -- $(DESTDIR)$(helpdir)/*/*/*.*
219 -rm -f -- $(DESTDIR)$(helpdir)/*/*.*
220 -rm -f -- $(DESTDIR)$(helpdir)/*.*
221 -rmdir $(DESTDIR)$(helpdir)/*/*
222 -rmdir $(DESTDIR)$(helpdir)/*
223 -rmdir $(DESTDIR)$(helpdir)
227 -rm -f -- $(DESTDIR)$(manualsdir)/*/*/*.*
228 -rm -f -- $(DESTDIR)$(manualsdir)/*/*.*
229 -rmdir $(DESTDIR)$(manualsdir)/*/*
230 -rmdir $(DESTDIR)$(manualsdir)/*
231 -rmdir $(DESTDIR)$(manualsdir)
235 -rm $(DESTDIR)$(objectsdir)/*/*/*.pd
236 -rm $(DESTDIR)$(objectsdir)/*/*.pd
237 -rm $(DESTDIR)$(objectsdir)/*.pd
238 -rm $(DESTDIR)$(objectsdir)/*/*/*.$(EXTENSION)
239 -rm $(DESTDIR)$(objectsdir)/*/*.$(EXTENSION)
240 -rm $(DESTDIR)$(objectsdir)/*.$(EXTENSION)
241 -rmdir $(DESTDIR)$(objectsdir)/*/*
242 -rmdir $(DESTDIR)$(objectsdir)/*
243 -rmdir $(DESTDIR)$(objectsdir)
246 install_clean: applications_clean help_clean manuals_clean objects_clean
247 -rmdir $(DESTDIR)$(pddocdir)
248 -rmdir $(DESTDIR)$(prefix)
251 @echo "Build destination cleaned: $(DESTDIR)"
256 -rm -f -- */*/*/*/*.*~
261 -rm -f -- Makefile~ Makefile.buildlayout~
263 -rm -f -- */*/*/*/*.bak
264 -rm -f -- */*/*/*.bak
268 # patching replace litter
269 -rm -f -- */*/*/*/*.rej
270 -rm -f -- */*/*/*.rej
275 -rm -rf -- */*/*/*/autom4te.cache
276 -rm -rf -- */*/*/autom4te.cache
277 -rm -rf -- */*/autom4te.cache
278 -rm -rf -- */autom4te.cache
279 -rm -rf -- autom4te.cache