root/juggler/tags/1.0_alpha_02/Makefile.base.in

Revision 190, 8.1 kB (checked in by patrick, 10 years ago)

Add a comment about what ${topdir} is now that it's in this file.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 # -----------------------------------------------------------------------------
2 # $Id$
3 #
4 # This file <Makefile.base> provides variable information and targets shared
5 # by all Makefiles in the VR Juggler source tree.  It requires GNU make.
6 # -----------------------------------------------------------------------------
7 # All Makefiles in the source tree should include this file for maximum
8 # information sharing.
9 #
10 # ** NOTE:                                                                  **
11 # **   Shared targets are defined here, so any files that include this file **
12 # **   should define a default target BEFORE including this file.           **
13 # -----------------------------------------------------------------------------
14 # Variables defined here are:
15 #
16 # SHELL          - The shell to use when make(1) executes shell commands.
17 #
18 # bindir         - Path to bin directory containing executables (usually
19 #                  ${exec_prefix}/bin).
20 # datadir        - Path to a directory generally sharing platform-independent
21 #                  data (usually ${prefix}/share).
22 # exec_prefix    - Path to base directory where executables will be (usually
23 #                  ${prefix}).
24 # libdir         - Path to directory containing shared and static libraries
25 #                  (usually ${exec_prefix}/lib).
26 # libexecdir     - Path to libexec directory that generally contains
27 #                  executables not called directly by users (usually
28 #                  ${exec_prefix}/libexec).
29 # prefix         - Base path used for installation and other things.
30 # releasedir     - The absolute path to the release directory.
31 # sbindir        - Path to sbin directory containing executables (usually
32 #                  ${exec_prefix}/sbin).
33 # scriptdir      - The path to the directory containing scripts used in the
34 #                  build and install/release process.
35 # sysconfdir     - System configuration directory (usually ${prefix}/etc).
36 # topdir         - The top of the build tree.
37 # VJROOT_ABS     - The absolute path to the root of the VR Juggler source
38 #                  tree.
39 #
40 # AR             - Path to ar(1) (or equivalent program).
41 # ARFLAGS        - Flags for ${AR}.
42 # CC             - Path to C compiler.
43 # CXX            - Path to C++ compiler.
44 # CPP            - Command for invoking the C preprocessor.
45 # CXXCPP         - Command for invoking the C preprocessor used by the C++
46 #                  compiler.
47 # CFLAGS         - Flags for ${CC}.
48 # CPPFLAGS       - Flags for ${CPP} and ${CXXCPP}.
49 # CXXFLAGS       - Flags for ${CXX}.
50 # DEFS           - Command-line preprocessor definitions (-Dvariable=value).
51 # DEPENDFLAGS    - Flags passed to makedepend(1) (or equivalent program for
52 #                  generating dependencies).
53 # DEPEND_EXTRAS  - Flags not recognized by makedepend(1) that may be necessary
54 #                  in ${CFLAGS} or ${CXXFLAGS}.
55 # INCLUDES       - Additions to the include path (-I/path/to/include).
56 # LD             - Path to ld(1) (or equivalent program).
57 # LDFLAGS        - Flags for ${LD}.
58 # LDOPTS         - Extra, often platform-specific, options for the linker.
59 # LIBS           - Extra external libraries needed at link time.
60 # MKPATH         - Path to shared vj.*.mk file directory.
61 # OBJDIR         - Path to the directory where the object files will be built.
62 #
63 # C_COMPILE      - Command for compiling C code.
64 # CXX_COMPILE    - Command for compiling C++ code.
65 #
66 # ABI            - Application Binary Interface type (on IRIX).  This may be
67 #                  used for other binary types when supported by the operating
68 #                  system (e.g., "ELF" or "AOUT").
69 # LIBBITSUF      - Suffix for the library path used by the linker on IRIX
70 #                  only.  For o32 binaries, it will be blank.  For n32
71 #                  binaries, it will be 32.  For 64-bit binaries, it will be
72 #                  64.
73 # PLATFORM       - The operating system abbreviation on which the library is
74 #                  being built (e.g., SGI -> IRIX on an SGI computer,
75 #                  HP => HP-UX on an HP workstation).
76 #
77 # LIBRARY        - The base name of the library that will be built with no
78 #                  file extension.
79 # -----------------------------------------------------------------------------
80 # Targets defined here are:
81 #
82 # Suffix rules for .c => .o and .C => .o.
83 # clean: Standard directory clean-up target.
84 # -----------------------------------------------------------------------------
85
86 SHELL           = /bin/sh
87
88 # -----------------------------------------------------------------------------
89 # Base variables needed by all Makefiles.
90 # -----------------------------------------------------------------------------
91 bindir          = @bindir@
92 datadir         = @datadir@
93 exec_prefix     = @exec_prefix@
94 libdir          = @libdir@
95 libexecdir      = @libexecdir@
96 prefix          = @prefix@
97 releasedir      = ${VJROOT_ABS}/release
98 sbindir         = @sbindir@
99 scriptdir       = ${releasedir}/scripts
100 sysconfdir      = @sysconfdir@
101 topdir          = @topdir@
102 VJROOT_ABS      = @VJROOT_ABS@
103
104 AR              = @AR@ ${ARFLAGS}
105 ARFLAGS         = @ARFLAGS@
106 CC              = @CC@
107 CXX             = @CXX@
108 CPP             = @CPP@
109 CXXCPP          = @CXXCPP@
110 CFLAGS          = @CFLAGS@ ${OPTIMIZER}
111 CPPFLAGS        = @CPPFLAGS@
112 CXXFLAGS        = @CXXFLAGS@ ${OPTIMIZER}
113 DEFS            = @DEFS@
114 DEPENDFLAGS     = @DEPENDFLAGS@ @INCLUDES@ -I${VJROOT_ABS} -I${topdir}
115 DEPEND_EXTRAS   = @DEPEND_EXTRAS@ ${DEFS}
116 INCLUDES        = @INCLUDES@ -I${VJROOT} -I${topdir}
117 INSTALL         = @INSTALL@
118 LD              = @LD@
119 LDFLAGS         = @LDFLAGS@ -L/usr/lib${LIBBITSUF} -L/usr/lib
120 LDOPTS          = @LDOPTS@
121 LIBS            = @LIBS@
122 MKPATH          = ${VJROOT_ABS}/mk
123 OBJDIR          = .
124
125 # -----------------------------------------------------------------------------
126 # Compiler command lines.
127 # -----------------------------------------------------------------------------
128 C_COMPILE       = ${CC} ${DEFS} ${INCLUDES} ${CPPFLAGS} ${CFLAGS}
129 CXX_COMPILE     = ${CXX} ${DEFS} ${INCLUDES} ${CPPFLAGS} ${CXXFLAGS}
130
131 # -----------------------------------------------------------------------------
132 # Platform- and binary-specific options.  The assignments preceding the
133 # ifeq ... endif blocks are the default values.  Depending on the value of
134 # ${ABI}, further settings may be made to allow for building with multiple
135 # ABIs.
136 # -----------------------------------------------------------------------------
137 ifdef vjABI
138     ifeq (${vjABI}, O32)
139         ABI             = O32
140         INST_SET        = mips2
141         LIBBITSUF       =
142     endif
143     ifeq (${vjABI}, N32_M3)
144         ABI             = N32
145         INST_SET        = mips3
146         LIBBITSUF       = 32
147     endif
148     ifeq (${vjABI}, N32_M4)
149         ABI             = N32
150         INST_SET        = mips4
151         LIBBITSUF       = 32
152     endif
153     ifeq (${vjABI}, 64_M3)
154         ABI             = 64
155         INST_SET        = mips3
156         LIBBITSUF       = 64
157     endif
158     ifeq (${vjABI}, 64_M4)
159         ABI             = 64
160         INST_SET        = mips4
161         LIBBITSUF       = 64
162     endif
163 else
164     ABI         = @ABI@
165     INST_SET    = @INST_SET@
166     LIBBITSUF   = @LIBBITSUF@
167 endif
168
169 PLATFORM        = @PLATFORM@
170
171 ifeq (${ABI}, O32)
172     ARFLAGS     := -o32 -mips2 ${ARFLAGS}
173     CFLAGS      += -o32 -mips2
174     CXXFLAGS    += -o32 -mips2
175     LDOPTS      += -o32 -mips2
176     LIBBITSUF   =
177 endif
178 ifeq (${ABI}, N32)
179     ARFLAGS     := -n32 ${ARFLAGS}
180     CFLAGS      += -n32
181     CXXFLAGS    += -n32
182     LDOPTS      += -n32
183     LIBBITSUF   = 32
184 endif
185 ifeq (${ABI}, 64)
186     ARFLAGS     := -64 ${ARFLAGS}
187     CFLAGS      += -64
188     CXXFLAGS    += -64
189     LDOPTS      += -64
190     LIBBITSUF   = 64
191 endif
192
193 ifeq (${INST_SET}, mips3)
194     ARFLAGS     := -mips3 ${ARFLAGS}
195     CFLAGS      += -mips3
196     CXXFLAGS    += -mips3
197     LDOPTS      += -mips3
198 endif
199 ifeq (${INST_SET}, mips4)
200     ARFLAGS     := -mips4 ${ARFLAGS}
201     CFLAGS      += -mips4
202     CXXFLAGS    += -mips4
203     LDOPTS      += -mips4
204 endif
205
206 # -----------------------------------------------------------------------------
207 # Library name.
208 # -----------------------------------------------------------------------------
209 LIBRARY         = libJuggler
210
211 @SET_MAKE@
212
213 # -----------------------------------------------------------------------------
214 # Build rule for ${OBJDIR} code.
215 # -----------------------------------------------------------------------------
216 ${OBJDIR}/%.o : %.c
217         ${C_COMPILE} -c -o $@ $<
218
219 ${OBJDIR}/%.o : %.C
220         ${CXX_COMPILE} -c -o $@ $<
221
222 ${OBJDIR}/%.o : %.cpp
223         ${CXX_COMPILE} -c -o $@ $<
224
225 # -----------------------------------------------------------------------------
226 # Include a common 'clean' target.
227 # -----------------------------------------------------------------------------
228 include ${MKPATH}/vj.clean.mk
Note: See TracBrowser for help on using the browser.