root/juggler/branches/2.2/modules/gadgeteer/Makefile.inc.in

Revision 20957, 17.5 kB (checked in by patrick, 8 months ago)

MFT r20954: Removed the -m option used with ld(1) on Mac OS X. The Juggler

libraries do not have multiply defined symbols to ignore, and that
option is obsolete in Mac OS X 10.5.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 # ************** <auto-copyright.pl BEGIN do not edit this line> **************
2 #
3 # VR Juggler is (C) Copyright 1998-2007 by Iowa State University
4 #
5 # Original Authors:
6 #   Allen Bierbaum, Christopher Just,
7 #   Patrick Hartling, Kevin Meinert,
8 #   Carolina Cruz-Neira, Albert Baker
9 #
10 # This library is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU Library General Public
12 # License as published by the Free Software Foundation; either
13 # version 2 of the License, or (at your option) any later version.
14 #
15 # This library is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 # Library General Public License for more details.
19 #
20 # You should have received a copy of the GNU Library General Public
21 # License along with this library; if not, write to the
22 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 # Boston, MA 02111-1307, USA.
24 #
25 # *************** <auto-copyright.pl END do not edit this line> ***************
26
27 # -----------------------------------------------------------------------------
28 # Specialized include file for the top-level makefile.  Targets and variables
29 # needed for building the whole source tree are provided here.  This file
30 # should only be included by the top-level makefile.  It is written in such a
31 # way that no assumptions are made by this file about what the including file
32 # provides except that it includes make.defs.mk.
33 #
34 # Generated for use on @PLATFORM@
35 # -----------------------------------------------------------------------------
36
37 # Variables whose values are specific to this file.
38 data_subdir=    @data_subdir@
39 includedir=     @includedir@
40 instlinks=      $(topdir)/instlinks
41 srcdir=         @srcdir@
42 top_srcdir=     @top_srcdir@
43
44 # Extra compiler and linker options needed only by this file.
45 DBG_FLAGS=      -DJUGGLER_DEBUG @DBG_FLAGS@
46 OPT_FLAGS=      -DJUGGLER_OPT -DNDEBUG @OPT_FLAGS@
47
48 # =============================================================================
49 # Build and installation directory naming and ownership information.
50 # =============================================================================
51 DEFAULT_DIR=    $(OPT_DIR)
52
53 # If we have a name for the install group, define group-setting options for
54 # UNIX commands (chown(1), chgrp(1)) and for local Perl scripts
55 # (makefiles-gen.pl in particular).
56 ifdef GROUP_NAME
57    _GROUP_OPT_PL=       --gname="$(GROUP_NAME)"
58 endif
59
60 # --------------------------------------------
61 # Library build information.
62 # --------------------------------------------
63
64 LIBRARY_VERSION=        @LIBRARY_VERSION@
65
66 # We do not do version numbering for dynamic libraries on Win32.
67 ifeq (@OS_TYPE@, Win32)
68 STATIC_SUFFIX=  _s
69 endif
70
71 ifeq (@HAVE_LD_SONAME@, Y)
72 CC_SONAME_FLAG= @CC_SONAME_FLAG@
73 LDOPTS+=        $(CC_SONAME_FLAG)$(notdir $@)
74 endif
75
76 # Add extra linking options on Darwin/OS X.
77 ifeq (@PLATFORM@, Darwin)
78 LDOPTS+=        -Wl,-dylib_compatibility_version,$(MAJOR_VERSION).$(MINOR_VERSION)
79 LDOPTS+=        -Wl,-dylib_current_version,$(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
80 LDOPTS_DBG=     -g
81 LDOPTS_OPT=     -Wl,-x
82 endif
83
84 # Full list of the libraries to build.
85 LIBS=                   $(GADGET_LIBRARY)
86 STATIC_LIBS=            $$LIB.$(STATICLIB_EXT)
87 DYNAMIC_LIBS=           $$LIB.$(DYNAMICLIB_EXT)$(DYNAMICLIB_VER)
88 PROF_STATIC_LIBS=       $${LIB}$(PROFLIB_EXT).$(STATICLIB_EXT)
89 PROF_DYNAMIC_LIBS=      $${LIB}$(PROFLIB_EXT).$(DYNAMICLIB_EXT)$(DYNAMICLIB_VER)
90
91 # Dependencies for each of the various dynamic libraries we build.
92 DYLIB_DEPS=             @DYLIB_DEPS@
93 DYLIB_DEP_FILES=        @DYLIB_DEP_FILES@
94 DYLIB_PROF_DEPS=        @DYLIB_PROF_DEPS@
95 DYLIB_PROF_DEP_FILES=   @DYLIB_PROF_DEP_FILES@
96
97 # These functions build up the name of the library using a comon form.
98 # Unfortunately, spaces have significance in GNU Make function calls, so there
99 # cannot be spaces after any commas.
100 make_libname=                   $(1)$(2)$(LIBRARY_VERSION).$(3)
101 make_static=                    $(call make_libname,$(1),$(STATIC_SUFFIX),$(STATICLIB_EXT))
102 make_dynamic=                   $(call make_libname,$(1),,$(DYNAMICLIB_EXT))
103 make_static_prof=               $(call make_libname,$(1),$(PROFLIB_EXT)$(STATIC_SUFFIX),$(STATICLIB_EXT))
104 make_dynamic_prof=              $(call make_libname,$(1),$(PROFLIB_EXT),$(DYNAMICLIB_EXT))
105
106 # Full list of the libraries to build. These are for Doozer++.
107 LIBS=                           $(GADGET_LIBRARY)
108 STATIC_LIBS=                    $(call make_static,$${LIB})
109 DYNAMIC_LIBS=                   $(call make_dynamic,$${LIB})
110 PROF_STATIC_LIBS=               $(call make_static_prof,$${LIB})
111 PROF_DYNAMIC_LIBS=              $(call make_dynamic_prof,$${LIB})
112
113 # The proper library names. These are used below in the targets that actually
114 # build the libraries.
115 GADGET_LIB_STATIC=              $(call make_static,$(GADGET_LIBRARY))
116 GADGET_LIB_DYNAMIC=             $(call make_dynamic,$(GADGET_LIBRARY))
117 GADGET_PROF_LIB_STATIC=         $(call make_static_prof,$(GADGET_LIBRARY))
118 GADGET_PROF_LIB_DYNAMIC=        $(call make_dynamic_prof,$(GADGET_LIBRARY))
119
120 # Version information.
121 PARAM_HEADER=   gadget/gadgetParam.h
122 BRANCH=         trunk
123 CANON_NAME=     Varda
124 VER_ARGS=       -f $(GADGETROOT_ABS)/VERSION -s @VPR_SUBSYSTEM@         \
125                 -b $(BRANCH) -n "$(CANON_NAME)"                         \
126                 -d "`date '+%b %e, %Y %H:%M:%S'`"
127
128 ifdef VERSION
129    VER_ARGS+=   -v $(VERSION)
130 endif
131
132 # =============================================================================
133 # Library targets.
134 # =============================================================================
135 OBJS=           $(OBJDIR)/*.$(OBJEXT)
136 BEFOREBUILD=    beforebuild
137 AFTERBUILD=     afterbuild
138
139 # Things to do before the object files and library are built.
140 beforebuild: $(PARAM_HEADER)
141
142 $(PARAM_HEADER): $(GADGETROOT_ABS)/$(PARAM_HEADER).in $(GADGETROOT_ABS)/VERSION
143         @$(MAKE) clean-version-links
144         @$(SHELL) $(scriptdir)/make-ver.sh -o $@                \
145           -i $(GADGETROOT_ABS)/$@.in $(VER_ARGS)
146
147 # Things to do after the object files and library are built.
148 afterbuild:
149         @$(MAKE) links
150         @echo ""
151         @echo "---------------------------------------------------------------"
152         @echo 'You should now set $$GADGET_BASE_DIR to:'
153         @cd $(instlinks) && echo "  `pwd`"
154         @echo "---------------------------------------------------------------"
155
156 # -----------------------------------------------
157 # Construct the static version of the libraries.
158 # -----------------------------------------------
159 $(LIBDIR)/$(GADGET_LIB_STATIC) $(LIBDIR)/$(GADGET_PROF_LIB_STATIC): $(OBJS)
160         @echo "------------------------------------------------"
161         @echo "Creating $@"
162         @echo "------------------------------------------------"
163         @$(SHELL) $(MKINSTALLDIRS) $(LIBDIR)
164         $(AR) $(AR_NAME_FLAG)$@ $(OBJS)
165         $(RANLIB) $@
166         cd $(LIBDIR_BASE) && $(RM_LN) $(notdir $@) && $(LN_S) $@ ./
167         @echo "------------------------------------------------"
168         @echo "$@ done"
169         @echo "------------------------------------------------"
170
171 # ------------------------------------------------
172 # Construct the dynamic version of the libraries.
173 # ------------------------------------------------
174 $(LIBDIR)/$(GADGET_LIB_DYNAMIC): $(OBJS) $(DYLIB_DEP_FILES)
175         @echo "------------------------------------------------"
176         @echo "Creating $@"
177         @echo "------------------------------------------------"
178         @$(SHELL) $(MKINSTALLDIRS) $(LIBDIR)
179 ifeq (@PLATFORM@, Darwin)
180 ifeq ($(ISA), universal)
181         for a in $(UNIVERSAL_ARCH_LIST) ; do                            \
182             ld -arch $$a -dynamic -r -d -bind_at_load -o                \
183               $(subst .dylib,-$$a.lo,$@) $(OBJS) ;                      \
184          done
185         lipo -create $(foreach arch,$(UNIVERSAL_ARCH_LIST),$(subst .dylib,-$(arch).lo,$@)) -output $(subst .dylib,.lo,$@)
186 else
187         ld -dynamic -r -d -bind_at_load -o $(subst .dylib,.lo,$@) $(OBJS)
188 endif
189         $(CXX) $(EXTRA_LDOPTS) -Wl,-dynamic -nostartfiles -Wl,-dylib    \
190           -Wl,-ldylib1.o $(LDOPTS) -o $@ $(subst .dylib,.lo,$@) $(DYLIB_DEPS)
191         rm -f $(@D)/*.lo
192 else
193         $(CXX_DLL) $(LDOPTS) $(DYLIB_NAME_FLAG) $(OBJS) \
194           $(DYLIB_DEPS)
195 endif
196 ifeq (@OS_TYPE@, Win32)
197         cd $(LIBDIR_BASE) && cp $(LIBDIR)/* .
198 else
199         cd $(LIBDIR_BASE) && $(RM_LN) $(notdir $@) && $(LN_S) $@ ./
200 endif
201         @echo "------------------------------------------------"
202         @echo "$@ done"
203         @echo "------------------------------------------------"
204
205 # ---------------------------------------------------------
206 # Construct the profiled dynamic version of the libraries.
207 # ---------------------------------------------------------
208 $(LIBDIR)/$(GADGET_PROF_LIB_DYNAMIC): $(OBJS) $(DYLIB_PROF_DEP_FILES)
209         @echo "------------------------------------------------"
210         @echo "Creating $@"
211         @echo "------------------------------------------------"
212         @$(SHELL) $(MKINSTALLDIRS) $(LIBDIR)
213 ifeq (@PLATFORM@, Darwin)
214 ifeq ($(ISA), universal)
215         for a in $(UNIVERSAL_ARCH_LIST) ; do                            \
216             ld -arch $$a -dynamic -r -d -bind_at_load -o                \
217               $(subst .dylib,-$$a.lo,$@) $(OBJS) ;                      \
218          done
219         lipo -create $(foreach arch,$(UNIVERSAL_ARCH_LIST),$(subst .dylib,-$(arch).lo,$@)) -output $(subst .dylib,.lo,$@)
220 else
221         ld -dynamic -r -d -bind_at_load -o $(subst .dylib,.lo,$@) $(OBJS)
222 endif
223         $(CXX) $(EXTRA_LDOPTS) -Wl,-dynamic -nostartfiles -Wl,-dylib    \
224           -Wl,-ldylib1.o $(LDOPTS) -o $@ $(subst .dylib,.lo,$@)         \
225           $(DYLIB_PROF_DEPS)
226         rm -f $(@D)/*.lo
227 else
228         $(CXX_DLL) $(LDOPTS) $(DYLIB_NAME_FLAG) $(OBJS) \
229           $(DYLIB_PROF_DEPS)
230 endif
231 ifeq (@OS_TYPE@, Win32)
232         cd $(LIBDIR_BASE) && cp $(LIBDIR)/* .
233 else
234         cd $(LIBDIR_BASE) && $(RM_LN) $(notdir $@) && $(LN_S) $@ ./
235 endif
236         @echo "------------------------------------------------"
237         @echo "$@ done"
238         @echo "------------------------------------------------"
239
240 # =============================================================================
241 # Make links for developer use that provide the needed functionality for
242 # the $GADGET_BASE_DIR environment variable to be used when needed.
243 # $GADGET_BASE_DIR should be set to $(instlinks).
244 # =============================================================================
245 links:
246         @echo "------------------------------------------------"
247         @echo "Setting up developer installation"
248         @echo "------------------------------------------------"
249         $(SHELL) $(MKINSTALLDIRS) $(instlinks)/share/flagpoll
250         $(INSTALL) -m $(FILE_PERMS) $(GROUP_OPT_UNIX)                   \
251           $(EXTRA_INSTALL_ARGS) $(topdir)/gadgeteer.fpc                 \
252           $(instlinks)/share/flagpoll/gadgeteer.fpc
253 ifdef BUILD_TYPE
254         $(MAKE) links-$(BUILD_TYPE)
255 else
256         $(MAKE) links-dbg
257 endif
258
259 clean-version-links:
260         @rm -rf $(LIBDIR_BASE)
261         @rm -rf $(instlinks)/include/gadgeteer*                         \
262            $(instlinks)/lib*/gadgeteer*                                 \
263            $(instlinks)/$(data_subdir)/gadgeteer*
264         @rm -f $(instlinks)/lib$(LIBBITSUF)/flagpoll/gadgeteer*
265         @for l in $(LIBS) ; do                                          \
266             find $(instlinks) -name "$$l*" -exec rm {} ';' ;            \
267          done
268
269 links-all:
270         @$(MAKE) EXTRA_INSTALL_ARGS=-l prefix="$(instlinks)" installworld
271
272 links-dbg:
273         @$(MAKE) EXTRA_INSTALL_ARGS=-l prefix="$(instlinks)" install-debug
274
275 links-opt:
276         @$(MAKE) EXTRA_INSTALL_ARGS=-l prefix="$(instlinks)" install-optim
277
278 links-prof:
279         @$(MAKE) EXTRA_INSTALL_ARGS=-l prefix="$(instlinks)" install-profiled
280
281 links-prof-libs:
282         @$(MAKE) EXTRA_INSTALL_ARGS=-l prefix="$(instlinks)" install-prof
283         @$(MAKE) EXTRA_INSTALL_ARGS=-l prefix="$(instlinks)" install-prof-dso
284
285 # Remove the links in $(instlinks).
286 clean-links:
287 ifndef GLOBAL_BUILD
288         @echo "------------------------------------------------"
289         @echo "Removing developer installation links"
290         @echo "------------------------------------------------"
291         rm -rf $(instlinks)
292 endif
293
294 # =============================================================================
295 # Installation targets.  The default (what is done by 'install') is to install
296 # the static debugging version of the libraries.  The steps taken for a full
297 # installation are:
298 #
299 #     1) Create the full installation directory hierarchy.
300 #     2) Install the libraries.
301 #     3) Install the header files.
302 #     4) Install the test programs.
303 #     5) Install the contents of the Data directory.
304 #     6) Install the Java-based config editor (if possible).
305 # =============================================================================
306
307 BEFOREINSTALL=  beforeinstall
308 AFTERINSTALL=   afterinstall
309
310 # Steps to take before beginning the installation process.  This target is
311 # independent of the current ABI.
312 beforeinstall:
313         @$(MAKE) hier
314
315 # Make the full directory hierarchy for the installation.
316 hier:
317         @echo "------------------------------------------------"
318         @echo "Making hierarchy"
319         @echo "------------------------------------------------"
320         $(SHELL) $(MKINSTALLDIRS) $(prefix)
321         $(MTREE_CMD) -Ude -f $(mtreedir)/GADGET.install.dist -p $(prefix)
322         $(SHELL) $(MKINSTALLDIRS) $(projdatadir)
323         $(MTREE_CMD) -Ude -f $(mtreedir)/GADGET.data.dist -p $(projdatadir)
324         $(MTREE_CMD) -Ude -f $(mtreedir)/GADGET.include.dist -p $(prefix)
325         $(MTREE_CMD) -Ude -f $(mtreedir)/GADGET.lib.dist -p $(prefix)
326         $(MTREE_CMD) -Ude -f $(mtreedir)/GADGET.test.dist -p $(projdatadir)
327
328 # Steps to take after the installation process is complete.  This target is
329 # independent of the current ABI.
330 afterinstall:
331
332 PREINSTALL=     pre-install
333 POSTINSTALL=    post-install
334
335 pre-install:
336         $(MTREE_CMD) -Ude -f $(mtreedir)/GADGET.lib.dist -p $(prefix)
337
338 # Do everything needed after installing the library binaries.
339 post-install:
340         @$(MAKE) install-samples
341         @$(MAKE) install-test
342         @$(MAKE) install-tools
343         @$(MAKE) install-data
344         @$(MAKE) install-m4
345         @$(MAKE) install-flagpoll
346
347 PREINSTALL_HEADERS=     pre-install-headers
348 POSTINSTALL_HEADERS=    post-install-headers
349
350 pre-install-headers:
351         $(MTREE_CMD) -Ude -f $(mtreedir)/GADGET.include.dist -p $(prefix)
352
353 post-install-headers:
354         $(INSTALL) -m $(FILE_PERMS) $(GROUP_OPT_UNIX)                   \
355           $(EXTRA_INSTALL_ARGS)                                         \
356           $(GADGETROOT_ABS)/gadget/Devices/DriverConfig.h               \
357           $(includedir)/gadget/Devices/DriverConfig.h
358         $(INSTALL) -m $(FILE_PERMS) $(GROUP_OPT_UNIX)                   \
359           $(EXTRA_INSTALL_ARGS)                                         \
360           $(GADGETROOT_ABS)/cluster/PluginConfig.h                      \
361           $(includedir)/cluster/PluginConfig.h
362         $(INSTALL) -m $(FILE_PERMS) $(GROUP_OPT_UNIX)                   \
363           $(EXTRA_INSTALL_ARGS) $(GADGETROOT_ABS)/gadget/gadgetConfig.h \
364           $(includedir)/gadget/gadgetConfig.h
365         $(INSTALL) -m $(FILE_PERMS) $(GROUP_OPT_UNIX)                   \
366           $(EXTRA_INSTALL_ARGS) $(topdir)/gadget/gadgetDefines.h        \
367           $(includedir)/gadget
368         $(INSTALL) -m $(FILE_PERMS) $(GROUP_OPT_UNIX)                   \
369           $(EXTRA_INSTALL_ARGS) $(topdir)/gadget/gadgetParam.h          \
370           $(includedir)/gadget
371
372 # Install the sample code.
373 install-samples:
374         @echo "------------------------------------------------"
375         @echo "Installing sample code"
376         @echo "------------------------------------------------"
377         $(SHELL) $(MKINSTALLDIRS) $(projdatadir)
378         $(MTREE_CMD) -Ude -f $(mtreedir)/GADGET.samples.dist -p $(projdatadir)
379         $(PERL) $(scriptdir)/install-src.pl -i $(top_srcdir)/samples    \
380           -m $(FILE_PERMS) $(GROUP_OPT_UNIX) -o $(projdatadir)/samples
381         $(PERL) $(scriptdir)/makefiles-gen.pl --mode="$(FILE_PERMS)"    \
382           --prefix="$(projdatadir)/samples" --vars="$(topdir)/VARS.pl"  \
383           --startdir="$(top_srcdir)/samples" $(_GROUP_OPT_PL) --srcdir="."
384
385 # Install the test programs.
386 install-test:
387         @echo "------------------------------------------------"
388         @echo "Installing test programs"
389         @echo "------------------------------------------------"
390         $(SHELL) $(MKINSTALLDIRS) $(projdatadir)
391         $(MTREE_CMD) -Ude -f $(mtreedir)/GADGET.test.dist -p $(projdatadir)
392         $(PERL) $(scriptdir)/install-src.pl -i $(top_srcdir)/test       \
393           -m $(FILE_PERMS) $(GROUP_OPT_UNIX) -o $(projdatadir)/test
394         $(PERL) $(scriptdir)/makefiles-gen.pl --mode="$(FILE_PERMS)"    \
395           --prefix="$(projdatadir)/test" --vars="$(topdir)/VARS.pl"     \
396           --startdir="$(top_srcdir)/test" $(_GROUP_OPT_PL) --srcdir="."
397
398 # Install the standard data files.
399 install-data:
400         @echo "------------------------------------------------"
401         @echo "Installing standard data files"
402         @echo "------------------------------------------------"
403         $(SHELL) $(MKINSTALLDIRS) $(projdatadir)
404         $(MTREE_CMD) -Ude -f $(mtreedir)/GADGET.data.dist -p $(projdatadir)
405         $(PERL) $(scriptdir)/install-dir.pl -i $(top_srcdir)/data       \
406           -m $(FILE_PERMS) $(GROUP_OPT_UNIX) -o $(projdatadir)/data     \
407           -v "$(topdir)/VARS.pl"
408
409 install-tools:
410         @echo "------------------------------------------------"
411         @echo "Installing tools"
412         @echo "------------------------------------------------"
413         $(SHELL) $(MKINSTALLDIRS) $(projdatadir)
414         $(MTREE_CMD) -Ude -f $(mtreedir)/GADGET.tools.dist -p $(projdatadir)
415         $(PERL) $(scriptdir)/install-dir.pl -i $(top_srcdir)/tools      \
416           -m $(FILE_PERMS) $(GROUP_OPT_UNIX) -o $(projdatadir)/tools    \
417           -v "$(topdir)/VARS.pl"
418
419 install-m4:
420         @echo "------------------------------------------------"
421         @echo "Installing Autoconf m4 macros"
422         @echo "------------------------------------------------"
423         $(SHELL) $(MKINSTALLDIRS) $(datadir)/aclocal
424         $(INSTALL) -m $(FILE_PERMS) $(GROUP_OPT_UNIX)                   \
425           $(EXTRA_INSTALL_ARGS) $(JUGGLERROOT_ABS)/macros/gadget.m4     \
426           $(datadir)/aclocal
427
428 install-flagpoll:
429         @echo "------------------------------------------------"
430         @echo "Installing Flagpoll metadata file"
431         @echo "------------------------------------------------"
432         $(SHELL) $(MKINSTALLDIRS) $(libdir)$(LIBBITSUF)/flagpoll
433         $(INSTALL) -m $(FILE_PERMS) $(GROUP_OPT_UNIX)                   \
434           $(topdir)/gadgeteer.fpc                                       \
435           $(libdir)$(LIBBITSUF)/flagpoll/gadgeteer-$(VERSION_DOT).$(PLATFORM).$(ISA).fpc
436
437 # =============================================================================
438 # Clean-up targets.  '_cleandepend' removes all the .d files in the Plugins
439 # directories.  '_clobber' removes the $(BUILDDIR_BASE) and $(LIBDIR_NAME)
440 # directories.
441 # =============================================================================
442 _cleandepend:
443
444 _clobber:
445         @$(MAKE) cleandepend
446         @$(MAKE) clean-links
447
448
449 # Define $(_LOCAL_CLOBBER) to inform the shared 'clobber' target that there is
450 # a '_clobber' target to be run besides the standard target.
451 _LOCAL_CLOBBER=         1
452 _LOCAL_CLEANDEP=        1
453
454 include $(MKPATH)/dpp.libs.mk
455 include $(MKPATH)/dpp.clean.mk
456
457 CLEAN_FILES+=   $(PARAM_HEADER)
458 CLEAN_DIRS+=    $(BUILDDIR_BASE) $(LIBDIR_NAME)
459 CLOBBER_DIRS+=  $(BUILDDIR_BASE) $(LIBDIR_NAME)
Note: See TracBrowser for help on using the browser.