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

Revision 20957, 15.2 kB (checked in by patrick, 9 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 will name static libs different 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 # Dependencies for each of the various dynamic libraries we build.
85 DYLIB_DEPS=             @DYLIB_DEPS@
86 DYLIB_DEP_FILES=        @DYLIB_DEP_FILES@
87 DYLIB_PROF_DEPS=        @DYLIB_PROF_DEPS@
88 DYLIB_PROF_DEP_FILES=   @DYLIB_PROF_DEP_FILES@
89 STATICLIB_EXT=          @STATICLIB_EXT@
90 DYNAMICLIB_EXT=         @DYNAMICLIB_EXT@
91
92 # These functions build up the name of the library using a comon form.
93 # Unfortunately, spaces have significance in GNU Make function calls, so there
94 # cannot be spaces after any commas.
95 make_libname=           $(1)$(2)$(LIBRARY_VERSION).$(3)
96 make_static=            $(call make_libname,$(1),$(STATIC_SUFFIX),$(STATICLIB_EXT))
97 make_dynamic=           $(call make_libname,$(1),,$(DYNAMICLIB_EXT))
98 make_static_prof=       $(call make_libname,$(1),$(PROFLIB_EXT)$(STATIC_SUFFIX),$(STATICLIB_EXT))
99 make_dynamic_prof=      $(call make_libname,$(1),$(PROFLIB_EXT),$(DYNAMICLIB_EXT))
100
101 # Full list of the libraries to build. These are for Doozer++.
102 LIBS=                   $(SNX_LIBRARY)
103 STATIC_LIBS=            $(call make_static,$${LIB})
104 DYNAMIC_LIBS=           $(call make_dynamic,$${LIB})
105 PROF_STATIC_LIBS=       $(call make_static_prof,$${LIB})
106 PROF_DYNAMIC_LIBS=      $(call make_dynamic_prof,$${LIB})
107
108 # The proper library names. These are used below in the targets that actually
109 # build the libraries.
110 SNX_LIB_STATIC=         $(call make_static,$(SNX_LIBRARY))
111 SNX_LIB_DYNAMIC=        $(call make_dynamic,$(SNX_LIBRARY))
112 SNX_PROF_LIB_STATIC=    $(call make_static_prof,$(SNX_LIBRARY))
113 SNX_PROF_LIB_DYNAMIC=   $(call make_dynamic_prof,$(SNX_LIBRARY))
114
115 # Version information.
116 PARAM_HEADER=   snx/snxParam.h
117 BRANCH=         trunk
118 CANON_NAME=     Ulmo
119 VER_ARGS=       -f $(ROOT_ABS)/VERSION -s @VPR_SUBSYSTEM@               \
120                 -b $(BRANCH) -d "`date '+%b %e, %Y %H:%M:%S'`"
121
122 ifdef VERSION
123    VER_ARGS+=   -v $(VERSION)
124 endif
125
126 # =============================================================================
127 # Library targets.
128 # =============================================================================
129 OBJS=           $(OBJDIR)/*.$(OBJEXT)
130 BEFOREBUILD=    beforebuild
131 AFTERBUILD=     afterbuild
132
133 # Things to do before the object files and library are built.
134 beforebuild: $(PARAM_HEADER)
135
136 $(PARAM_HEADER): $(ROOT_ABS)/$(PARAM_HEADER).in $(ROOT_ABS)/VERSION
137         @$(MAKE) clean-version-links
138         @$(SHELL) $(scriptdir)/make-ver.sh -o $@                \
139           -i $(ROOT_ABS)/$@.in $(VER_ARGS)
140
141 # Things to do after the object files and library are built.
142 afterbuild:
143         @$(MAKE) links
144         @echo ""
145         @echo "---------------------------------------------------------------"
146         @echo 'You should now set $$SNX_BASE_DIR to:'
147         @cd $(instlinks) && echo "  `pwd`"
148         @echo "---------------------------------------------------------------"
149
150 # -----------------------------------------------
151 # Construct the static version of the libraries.
152 # -----------------------------------------------
153 $(LIBDIR)/$(SNX_LIB_STATIC) $(LIBDIR)/$(SNX_PROF_LIB_STATIC): $(OBJS)
154         @echo "------------------------------------------------"
155         @echo "Creating $@"
156         @echo "------------------------------------------------"
157         @$(SHELL) $(MKINSTALLDIRS) $(LIBDIR)
158         $(AR) $(AR_NAME_FLAG)$@ $(OBJS)
159         $(RANLIB) $@
160         cd $(LIBDIR_BASE) && $(RM_LN) $(notdir $@) && $(LN_S) $@ ./
161         @echo "------------------------------------------------"
162         @echo "$@ done"
163         @echo "------------------------------------------------"
164
165 # ------------------------------------------------
166 # Construct the dynamic version of the libraries.
167 # ------------------------------------------------
168 $(LIBDIR)/$(SNX_LIB_DYNAMIC): $(OBJS) $(DYLIB_DEP_FILES)
169         @echo "------------------------------------------------"
170         @echo "Creating $@"
171         @echo "------------------------------------------------"
172         @$(SHELL) $(MKINSTALLDIRS) $(LIBDIR)
173 ifeq (@PLATFORM@, Darwin)
174 ifeq ($(ISA), universal)
175         for a in $(UNIVERSAL_ARCH_LIST) ; do                            \
176             ld -arch $$a -dynamic -r -d -bind_at_load -o                \
177               $(subst .dylib,-$$a.lo,$@) $(OBJS) ;                      \
178          done
179         lipo -create $(foreach arch,$(UNIVERSAL_ARCH_LIST),$(subst .dylib,-$(arch).lo,$@)) -output $(subst .dylib,.lo,$@)
180 else
181         ld -dynamic -r -d -bind_at_load -o $(subst .dylib,.lo,$@) $(OBJS)
182 endif
183         $(CXX) $(EXTRA_LDOPTS) -Wl,-dynamic -nostartfiles -Wl,-dylib    \
184           -Wl,-ldylib1.o $(LDOPTS) -o $@ $(subst .dylib,.lo,$@) $(DYLIB_DEPS)
185         rm -f $(@D)/*.lo
186 else
187         $(CXX_DLL) $(LDOPTS) $(DYLIB_NAME_FLAG) $(OBJS) \
188           $(DYLIB_DEPS)
189 endif
190 ifeq (@OS_TYPE@, Win32)
191         cd $(LIBDIR_BASE) && cp $(LIBDIR)/* .
192 else
193         cd $(LIBDIR_BASE) && $(RM_LN) $(notdir $@) && $(LN_S) $@ ./
194 endif
195         @echo "------------------------------------------------"
196         @echo "$@ done"
197         @echo "------------------------------------------------"
198
199 # ---------------------------------------------------------
200 # Construct the profiled dynamic version of the libraries.
201 # ---------------------------------------------------------
202 $(LIBDIR)/$(SNX_PROF_LIB_DYNAMIC): $(OBJS) $(DYLIB_PROF_DEP_FILES)
203         @echo "------------------------------------------------"
204         @echo "Creating $@"
205         @echo "------------------------------------------------"
206         @$(SHELL) $(MKINSTALLDIRS) $(LIBDIR)
207 ifeq (@PLATFORM@, Darwin)
208 ifeq ($(ISA), universal)
209         for a in $(UNIVERSAL_ARCH_LIST) ; do                            \
210             ld -arch $$a -dynamic -r -d -bind_at_load -o                \
211               $(subst .dylib,-$$a.lo,$@) $(OBJS) ;                      \
212          done
213         lipo -create $(foreach arch,$(UNIVERSAL_ARCH_LIST),$(subst .dylib,-$(arch).lo,$@)) -output $(subst .dylib,.lo,$@)
214 else
215         ld -dynamic -r -d -bind_at_load -o $(subst .dylib,.lo,$@) $(OBJS)
216 endif
217         $(CXX) $(EXTRA_LDOPTS) -Wl,-dynamic -nostartfiles -Wl,-dylib    \
218           -Wl,-ldylib1.o $(LDOPTS) -o $@ $(subst .dylib,.lo,$@)         \
219           $(DYLIB_PROF_DEPS)
220         rm -f $(@D)/*.lo
221 else
222         $(CXX_DLL) $(LDOPTS) $(DYLIB_NAME_FLAG) $(OBJS) \
223           $(DYLIB_PROF_DEPS)
224 endif
225 ifeq (@OS_TYPE@, Win32)
226         cd $(LIBDIR_BASE) && cp $(LIBDIR)/* .
227 else
228         cd $(LIBDIR_BASE) && $(RM_LN) $(notdir $@) && $(LN_S) $@ ./
229 endif
230         @echo "------------------------------------------------"
231         @echo "$@ done"
232         @echo "------------------------------------------------"
233
234 # =============================================================================
235 # Make links for developer use that provide the needed functionality for
236 # the $SNX_BASE_DIR environment variable to be used when needed.
237 # $SNX_BASE_DIR should be set to $(instlinks).
238 # =============================================================================
239 links:
240         @echo "------------------------------------------------"
241         @echo "Setting up developer installation"
242         @echo "------------------------------------------------"
243         $(SHELL) $(MKINSTALLDIRS) $(instlinks)/share/flagpoll
244         $(INSTALL) -m $(FILE_PERMS) $(GROUP_OPT_UNIX)                   \
245           $(EXTRA_INSTALL_ARGS) $(topdir)/sonix.fpc                     \
246           $(instlinks)/share/flagpoll/sonix.fpc
247 ifdef BUILD_TYPE
248         $(MAKE) links-$(BUILD_TYPE)
249 else
250         $(MAKE) links-dbg
251 endif
252
253 clean-version-links:
254         @rm -rf $(LIBDIR_BASE)
255         @rm -rf $(instlinks)/include/sonix* $(instlinks)/lib*/sonix*    \
256            $(instlinks)/$(data_subdir)/sonix*
257         @rm -f $(instlinks)/lib$(LIBBITSUF)/flagpoll/sonix*
258         @for l in $(LIBS) ; do                                          \
259             find $(instlinks) -name "$$l*" -exec rm {} ';' ;            \
260          done
261
262 links-all:
263         @$(MAKE) EXTRA_INSTALL_ARGS=-l prefix="$(instlinks)" installworld
264
265 links-dbg:
266         @$(MAKE) EXTRA_INSTALL_ARGS=-l prefix="$(instlinks)" install-debug
267
268 links-opt:
269         @$(MAKE) EXTRA_INSTALL_ARGS=-l prefix="$(instlinks)" install-optim
270
271 links-prof:
272         @$(MAKE) EXTRA_INSTALL_ARGS=-l prefix="$(instlinks)" install-profiled
273
274 links-prof-libs:
275         @$(MAKE) EXTRA_INSTALL_ARGS=-l prefix="$(instlinks)" install-prof
276         @$(MAKE) EXTRA_INSTALL_ARGS=-l prefix="$(instlinks)" install-prof-dso
277
278 # Remove the links in $(instlinks).
279 clean-links:
280 ifndef GLOBAL_BUILD
281         @echo "------------------------------------------------"
282         @echo "Removing developer installation links"
283         @echo "------------------------------------------------"
284         rm -rf $(instlinks)
285 endif
286
287 # =============================================================================
288 # Installation targets.  The default (what is done by 'install') is to install
289 # the static debugging version of the libraries.  The steps taken for a full
290 # installation are:
291 #
292 #     1) Create the full installation directory hierarchy.
293 #     2) Install the libraries.
294 #     3) Install the header files.
295 #     4) Install the test programs.
296 #     5) Install the contents of the Data directory.
297 #     6) Install the Java-based config editor (if possible).
298 # =============================================================================
299
300 BEFOREINSTALL=  beforeinstall
301
302 # Steps to take before beginning the installation process.  This target is
303 # independent of the current ABI.
304 beforeinstall:
305         @$(MAKE) hier
306
307 # Make the full directory hierarchy for the installation.
308 hier:
309         @echo "------------------------------------------------"
310         @echo "Making hierarchy"
311         @echo "------------------------------------------------"
312         $(SHELL) $(MKINSTALLDIRS) $(prefix)
313         $(MTREE_CMD) -Ude -f $(mtreedir)/SNX.install.dist -p $(prefix)
314         $(SHELL) $(MKINSTALLDIRS) $(projdatadir)
315         $(MTREE_CMD) -Ude -f $(mtreedir)/SNX.data.dist -p $(projdatadir)
316         $(MTREE_CMD) -Ude -f $(mtreedir)/SNX.include.dist -p $(prefix)
317         $(MTREE_CMD) -Ude -f $(mtreedir)/SNX.lib.dist -p $(prefix)
318         $(MTREE_CMD) -Ude -f $(mtreedir)/SNX.samples.dist -p $(projdatadir)
319
320 PREINSTALL=     pre-install
321 POSTINSTALL=    post-install
322
323 pre-install:
324         $(MTREE_CMD) -Ude -f $(mtreedir)/SNX.lib.dist -p $(prefix)
325
326 # Do everything needed after installing the library binaries.
327 post-install:
328         @$(MAKE) install-samples
329         @$(MAKE) install-data
330         @$(MAKE) install-m4
331         @$(MAKE) install-flagpoll
332
333 PREINSTALL_HEADERS=     pre-install-headers
334 POSTINSTALL_HEADERS=    post-install-headers
335
336 pre-install-headers:
337         $(MTREE_CMD) -Ude -f $(mtreedir)/SNX.include.dist -p $(prefix)
338
339 post-install-headers:
340         $(INSTALL) -m $(FILE_PERMS) $(GROUP_OPT_UNIX)                   \
341           $(EXTRA_INSTALL_ARGS) $(topdir)/snx/snxDefines.h              \
342           $(includedir)/snx
343         $(INSTALL) -m $(FILE_PERMS) $(GROUP_OPT_UNIX)                   \
344           $(EXTRA_INSTALL_ARGS) $(topdir)/snx/snxParam.h                \
345           $(includedir)/snx
346
347 # Install the sample code.
348 install-samples:
349         @echo "------------------------------------------------"
350         @echo "Installing sample code"
351         @echo "------------------------------------------------"
352         $(SHELL) $(MKINSTALLDIRS) $(projdatadir)
353         $(MTREE_CMD) -Ude -f $(mtreedir)/SNX.samples.dist -p $(projdatadir)
354         $(PERL) $(scriptdir)/install-src.pl -i $(top_srcdir)/samples    \
355           -m $(FILE_PERMS) $(GROUP_OPT_UNIX) -o $(projdatadir)/samples
356         $(PERL) $(scriptdir)/makefiles-gen.pl --mode="$(FILE_PERMS)"    \
357           --prefix="$(projdatadir)/samples" --vars="$(topdir)/VARS.pl"  \
358           --startdir="$(top_srcdir)/samples" $(_GROUP_OPT_PL) --srcdir="."
359
360 # Install the standard data files.
361 install-data:
362         @echo "------------------------------------------------"
363         @echo "Installing standard data files"
364         @echo "------------------------------------------------"
365         $(SHELL) $(MKINSTALLDIRS) $(projdatadir)
366         $(MTREE_CMD) -Ude -f $(mtreedir)/SNX.data.dist -p $(projdatadir)
367         $(PERL) $(scriptdir)/install-dir.pl -i $(top_srcdir)/data       \
368           -m $(FILE_PERMS) $(GROUP_OPT_UNIX) -o $(projdatadir)/data     \
369           -v "$(topdir)/VARS.pl"
370
371 install-m4:
372         @echo "------------------------------------------------"
373         @echo "Installing Autoconf m4 macros"
374         @echo "------------------------------------------------"
375         $(SHELL) $(MKINSTALLDIRS) $(datadir)/aclocal
376         $(INSTALL) -m $(FILE_PERMS) $(GROUP_OPT_UNIX)                   \
377           $(EXTRA_INSTALL_ARGS) $(JUGGLERROOT_ABS)/macros/sonix.m4      \
378           $(datadir)/aclocal
379
380 install-flagpoll:
381         @echo "------------------------------------------------"
382         @echo "Installing Flagpoll metadata file"
383         @echo "------------------------------------------------"
384         $(SHELL) $(MKINSTALLDIRS) $(libdir)$(LIBBITSUF)/flagpoll
385         $(INSTALL) -m $(FILE_PERMS) $(GROUP_OPT_UNIX)                   \
386           $(topdir)/sonix.fpc                                           \
387           $(libdir)$(LIBBITSUF)/flagpoll/sonix-$(VERSION_DOT).$(PLATFORM).$(ISA).fpc
388
389 # =============================================================================
390 # Clean-up targets.  '_clobber' removes the $(BUILDDIR_BASE) and $(LIBDIR_NAME)
391 # directories.
392 # =============================================================================
393 _clobber:
394         @$(MAKE) cleandepend
395         @$(MAKE) clean-links
396
397
398 # Define $(_LOCAL_CLOBBER) to inform the shared 'clobber' target that there is
399 # a '_clobber' target to be run besides the standard target.
400 _LOCAL_CLOBBER=         1
401
402 include $(MKPATH)/dpp.libs.mk
403 include $(MKPATH)/dpp.clean.mk
404
405 CLEAN_FILES+=   $(PARAM_HEADER)
406 CLEAN_DIRS+=    $(BUILDDIR_BASE) $(LIBDIR_NAME)
407 CLOBBER_DIRS+=  $(BUILDDIR_BASE) $(LIBDIR_NAME)
Note: See TracBrowser for help on using the browser.