Build system: MT_LIBS includes XLIBS
[openafs.git] / src / venus / Makefile.in
1 # Copyright 2000, International Business Machines Corporation and others.
2 # All Rights Reserved.
3
4 # This software has been released under the terms of the IBM Public
5 # License.  For details, see the LICENSE file in the top-level source
6 # directory or online at http://www.openafs.org/dl/license10.html
7
8 srcdir=@srcdir@
9 include @TOP_OBJDIR@/src/config/Makefile.config
10 include @TOP_OBJDIR@/src/config/Makefile.lwp
11
12 INCLS=${TOP_INCDIR}/afs/afsint.h \
13         ${TOP_INCDIR}/afs/cmd.h \
14         ${TOP_INCDIR}/afs/afsutil.h
15
16 AFSIO_INCLS=${TOP_INCDIR}/afs/afsint.h \
17         ${TOP_INCDIR}/afs/cmd.h \
18         ${TOP_INCDIR}/afs/auth.h \
19         ${TOP_INCDIR}/afs/vlserver.h \
20         ${TOP_INCDIR}/afs/ihandle.h \
21         ${TOP_INCDIR}/afs/com_err.h \
22         ${TOP_INCDIR}/afs/afscp.h \
23         ${TOP_INCDIR}/afs/afsutil.h
24
25 AFSIO_LIBS=${TOP_LIBDIR}/libafscp.a \
26         $(top_builddir)/src/rxkad/liboafs_rxkad.la \
27         $(top_builddir)/src/fsint/liboafs_fsint.la \
28         $(top_builddir)/src/vlserver/liboafs_vldb.la \
29         $(top_builddir)/src/cmd/liboafs_cmd.la \
30         $(top_builddir)/src/util/liboafs_util.la \
31         $(top_builddir)/src/opr/liboafs_opr.la
32
33 FSLIBS=${TOP_LIBDIR}/libsys.a \
34          ${TOP_LIBDIR}/libvldb.a \
35          ${TOP_LIBDIR}/libubik.a \
36          ${TOP_LIBDIR}/vlib.a \
37          ${TOP_LIBDIR}/libauth.a \
38          ${TOP_LIBDIR}/librxkad.a \
39          ${TOP_LIBDIR}/libafscom_err.a \
40          ${TOP_LIBDIR}/libcmd.a \
41          ${TOP_LIBDIR}/libkauth.a \
42          ${TOP_LIBDIR}/librx.a \
43          ${TOP_LIBDIR}/libsys.a \
44          ${TOP_LIBDIR}/liblwp.a \
45          ${TOP_LIBDIR}/libaudit.a \
46          $(TOP_LIBDIR)/libafsutil.a \
47          $(TOP_LIBDIR)/libopr.a \
48          ${TOP_LIBDIR}/libafsrfc3961.a \
49          ${TOP_LIBDIR}/libafshcrypto_lwp.a
50
51 CMLIBS=${TOP_LIBDIR}/libsys.a \
52          ${TOP_LIBDIR}/libafsint.a \
53          ${TOP_LIBDIR}/librxkad.a \
54          ${TOP_LIBDIR}/libauth.a \
55          ${TOP_LIBDIR}/libafscom_err.a \
56          ${TOP_LIBDIR}/libcmd.a \
57          ${TOP_LIBDIR}/librx.a \
58          ${TOP_LIBDIR}/libafshcrypto_lwp.a \
59          ${TOP_LIBDIR}/libsys.a \
60          ${TOP_LIBDIR}/liblwp.a \
61          $(TOP_LIBDIR)/libopr.a \
62          $(TOP_LIBDIR)/libafsutil.a
63
64 LIBS = ${FSLIBS}
65
66 all: fs up fstrace cmdebug livesys kdump-build cacheout afsio
67
68 #
69 # Build targets
70 #
71 cacheout: cacheout.o
72         $(AFS_LDRULE) cacheout.o ${LIBS} $(LIB_roken) ${XLIBS} ${CMLIBS}
73
74 cacheout.o: cacheout.c
75
76
77 up.o: up.c AFS_component_version_number.c
78
79 up: up.o
80         $(AFS_LDRULE) up.o ${LIBS} $(LIB_roken) ${XLIBS}
81
82 fs.o: fs.c ${INCLS} AFS_component_version_number.c
83
84 fs: fs.o $(LIBS)
85         $(AFS_LDRULE) fs.o ${TOP_LIBDIR}/libprot.a $(LIBS) \
86                 $(LIB_roken) ${XLIBS}
87
88 afsio.o: afsio.c ${AFSIO_INCLS} AFS_component_version_number.c
89         ${PTH_CCRULE} ${srcdir}/afsio.c
90 afscbint.ss.o: ../fsint/afscbint.ss.c
91         ${PTH_CCRULE} ../fsint/afscbint.ss.c
92
93 afsio: afsio.o afscbint.ss.o ${AFSIO_LIBS}
94         $(LT_LDRULE_static) afsio.o afscbint.ss.o \
95                 ${AFSIO_LIBS} \
96                 $(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} \
97                 $(LDFLAGS_krb5) $(LIB_krb5)
98
99 livesys.o: livesys.c ${INCLS} AFS_component_version_number.c
100
101 livesys: livesys.o $(LIBS)
102         $(AFS_LDRULE) livesys.o $(LIBS) $(LIB_roken) ${XLIBS}
103
104 twiddle: twiddle.o $(LIBS)
105         $(AFS_LDRULE) twiddle.o $(LIBS) $(LIB_roken) ${XLIBS}
106
107 gcpags: gcpags.o $(LIBS)
108         $(AFS_LDRULE) gcpags.o $(LIBS) $(LIB_roken) ${XLIBS}
109
110 whatfid.o: whatfid.c ${INCLS} AFS_component_version_number.c
111
112 whatfid: whatfid.o ${LIBS}
113         $(AFS_LDRULE) whatfid.o ${LIBS} $(LIB_roken) ${XLIBS}
114
115 fstrace: fstrace.o
116         $(AFS_LDRULE) fstrace.o $(LIBS) $(LIB_roken) ${XLIBS}
117
118 cmdebug.o: cmdebug.c ${INCLS} AFS_component_version_number.c
119
120 cmdebug: cmdebug.o ${CMLIBS}
121         $(AFS_LDRULE) cmdebug.o ${CMLIBS} $(LIB_roken) ${XLIBS}
122
123 dedebug.o: dedebug.c ${INCLS} AFS_component_version_number.c
124
125 dedebug: dedebug.o ${CMLIBS}
126         $(AFS_LDRULE) dedebug.o ${CMLIBS} $(LIB_roken) ${XLIBS}
127
128 #
129 # Kernel info dumper - these are done with submakes so that
130 # the build process does not attempt to rebuild them every time it runs.
131 #
132
133 #
134 # Branching target, run the actual build depending on sysname
135 #
136 kdump-build: kdump.c ${INCLS} AFS_component_version_number.c
137         $(MAKE) kdump kdump64
138         touch kdump-build
139
140 #
141 # Build targets - one for each type of kdump build process we have
142 #
143 kdump: kdump.o
144         -set -x; \
145         case ${SYS_NAME} in \
146         sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53 | sun4_53 | sun4_54 | sun4c_54 | sun4m_54 | sunx86_5? ) \
147                 ${CC} -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a /usr/lib/libkvm.a -lelf ${XLIBS} ;; \
148         sun*_5? | sun*_5?? ) \
149                 ${CC} -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a  ${XLIBELFA} ${XLIBKVM} ${XLIBS} ;; \
150         sgi_6? ) \
151                 for f in ../libafs/STATIC.IP*/CPU_KDEFS; \
152                 do      IP=`expr "$$f" : '../libafs/STATIC.\(IP..\)'`; \
153                         CPU_KDEFS=`sed 's/-mips.//' $$f`; \
154                         echo IP = $$IP; \
155                         echo CPU_KDEFS = $$CPU_KDEFS; \
156                         case $$CPU_KDEFS in \
157                         *-64*)  ${CC} ${XCFLAGS64} \
158                                         $$CPU_KDEFS \
159                                         -o kdump.$$IP kdump.$$IP.o \
160                                         ${TOP_LIBDIR}/libcmd64.a -lelf \
161                                 ;; \
162                         *)      ${CC} ${XCFLAGS} ${ARCHFLAGS} \
163                                         $$CPU_KDEFS \
164                                         -o kdump.$$IP kdump.$$IP.o \
165                                         ${TOP_LIBDIR}/libcmd.a -lelf \
166                                 ;; \
167                         esac || exit $$? ; \
168                 done ;; \
169         *linux26* | *linux_26* ) \
170                 touch kdump ;; \
171         *alpha_linux* ) \
172                 $(MAKE) kdump-alpha_linux-@LINUX_VERSION@ ;; \
173         *linux* ) \
174                 $(MAKE) kdump-linux-@LINUX_VERSION@ ;; \
175         alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_osf32 | alpha_osf32c | alpha_dux??) \
176                 ${CC} -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a ${XLIBS} -ll -lmld;; \
177         ncrx86_* ) ${CC} -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a -lelf ${XLIBS} ;; \
178         *bsd*) touch kdump ;; \
179         * )     ${CC} -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a ${XLIBS} ;; \
180         esac
181
182 kdump64:
183         -set -x; \
184         case ${SYS_NAME} in \
185         sun4x_5[789] | sun4x_510 | hp_ux11* | sunx86_5[789] | sunx86_510 )  \
186                 $(MAKE) kdump64.o ; \
187                 ${CC} ${XCFLAGS64} -o kdump64 kdump64.o ${TOP_LIBDIR}/libcmd64.a ${XLIBELFA} ${XLIBKVM} ${XLIBS} ;; \
188         esac
189
190
191 kdump.o: kdump.c ${INCLS} AFS_component_version_number.c
192         -set -x; \
193         case ${SYS_NAME} in \
194                 *linux26* | *linux_26* ) \
195                         touch kdump.o ;; \
196                 alpha_linux* ) \
197                         $(MAKE) kdump-alpha_linux-${LINUX_VERSION}.o ;; \
198                 *linux* ) \
199                         $(MAKE) kdump-linux-${LINUX_VERSION}.o ;; \
200                 alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_osf32 | alpha_osf32c| alpha_dux?? ) \
201                         ${CC} ${AFS_CFLAGS} -I/usr/sys/include -I/usr/sys/BINARY -I/usr/sys/AFS -DDEBUGGER -c ${srcdir}/kdump.c ;;\
202                 sgi_6? ) \
203                         for f in ../libafs/STATIC.IP*/CPU_KDEFS; \
204                         do      IP=`expr "$$f" : '../libafs/STATIC.\(IP..\)'`; \
205                                 CPU_KDEFS=`sed 's/-mips.//' $$f`; \
206                                 echo IP = $$IP; \
207                                 echo CPU_KDEFS = $$CPU_KDEFS; \
208                                 case $$CPU_KDEFS in \
209                                 *-64*)  ${CC} -D_KMEMUSER -woff 1178 \
210                                                 ${KERN_DBG} ${KERN_OPTMZ} -I${TOP_INCDIR} \
211                                                 -I${TOP_OBJDIR}/src/config \
212                                                 $$CPU_KDEFS \
213                                                 ${XCFLAGS64} \
214                                                 -c ${srcdir}/kdump.c -o kdump.$$IP.o \
215                                         ;; \
216                                 *)      ${CC} -D_KMEMUSER -woff 1178 \
217                                                 ${KERN_DBG} ${KERN_OPTMZ} -I${TOP_INCDIR} \
218                                                 -I${TOP_OBJDIR}/src/config \
219                                                 $$CPU_KDEFS \
220                                                 ${XCFLAGS} ${ARCHFLAGS} -DAFS_32BIT_KERNEL_ENV \
221                                                 -c ${srcdir}/kdump.c -o kdump.$$IP.o \
222                                         ;; \
223                                 esac || exit $$?; \
224                         done \
225                         ;; \
226                 *bsd*) \
227                         touch kdump.o ;; \
228                 *) \
229                         ${CC} ${KERN_DBG} ${KERN_OPTMZ} -I${TOP_SRCDIR} -I${TOP_INCDIR}/afs \
230                         -I${TOP_OBJDIR}/src/config -I${TOP_OBJDIR}/src -I${TOP_INCDIR} ${XCFLAGS} ${ARCHFLAGS} \
231                         -o kdump.o -c ${srcdir}/kdump.c ;; \
232         esac ;
233
234 kdump64.o : kdump.c ${INCLS} AFS_component_version_number.c
235         -set -x; \
236         case ${SYS_NAME} in \
237         sun4x_5[789] | sun4x_510 | hp_ux11* | sunx86_5[789] | sunx86_510 ) \
238                 ${CC} ${KERN_DBG} ${KERN_OPTMZ} -I${TOP_SRCDIR} -I${TOP_INCDIR}/afs \
239                 -I${TOP_OBJDIR}/src/config -I${TOP_OBJDIR}/src -I${TOP_INCDIR} ${XCFLAGS64} \
240                 -o kdump64.o -c ${srcdir}/kdump.c ;; \
241         esac
242
243 # *linux* - Builds kdump-X.Y.Z according to kernel version
244 kdump-linux-@LINUX_VERSION@.o: kdump.c ${INCLS} AFS_component_version_number.c
245         ${CC} ${KERN_DBG} ${KERN_OPTMZ} -I${LINUX_KERNEL_PATH}/include -I${TOP_INCDIR}/afs \
246                 -I${TOP_OBJDIR}/src \
247                 -I${TOP_OBJDIR}/src/afs/${MKAFS_OSTYPE} \
248                 -I${TOP_OBJDIR}/src/config -I${TOP_OBJDIR}/src/libafs/afs \
249                 -I${TOP_SRCDIR} -I${TOP_SRCDIR}/afs/${MKAFS_OSTYPE} \
250                 -I${TOP_INCDIR} ${XCFLAGS} ${ARCHFLAGS} -o kdump-linux-${LINUX_VERSION}.o \
251                 -c ${srcdir}/kdump.c
252
253 kdump-linux-@LINUX_VERSION@: kdump-linux-@LINUX_VERSION@.o
254         ${CC} ${KERN_DBG} ${KERN_OPTMZ} -o kdump-linux-${LINUX_VERSION} kdump-linux-${LINUX_VERSION}.o \
255                 ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ${XLIBS}
256
257 # *alpha_linux* - Builds kdump-X.Y.Z according to kernel version
258 kdump-alpha_linux-@LINUX_VERSION@.o: kdump.c ${INCLS} AFS_component_version_number.c
259         ${CC} ${KERN_DBG} ${KERN_OPTMZ} -I${LINUX_KERNEL_PATH}/include -I${TOP_INCDIR}/afs \
260                 -I${TOP_OBJDIR}/src \
261                 -I${TOP_OBJDIR}/src/afs/${MKAFS_OSTYPE} \
262                 -I${TOP_OBJDIR}/src/config -I${TOP_OBJDIR}/src/libafs/afs \
263                 -I${TOP_SRCDIR} -I${TOP_SRCDIR}/afs/${MKAFS_OSTYPE} \
264                 -I${TOP_INCDIR} ${XCFLAGS} ${ARCHFLAGS} -mno-fp-regs -ffixed-8 \
265                 -o kdump-alpha_linux-${LINUX_VERSION}.o -c ${srcdir}/kdump.c ;;
266
267 kdump-alpha_linux-@LINUX_VERSION@: kdump-alpha_linux-@LINUX_VERSION@.o
268         ${CC} ${KERN_DBG} ${KERN_OPTMZ} -o kdump-alpha_linux-${LINUX_VERSION} kdump-alpha_linux-${LINUX_VERSION}.o \
269                 ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ${XLIBS}
270
271 #
272 # Install targets
273 #
274 install: kdump-build fs livesys up fstrace cmdebug afsio
275         ${INSTALL} -d ${DESTDIR}${bindir}
276         ${INSTALL} -d ${DESTDIR}${afssrvbindir}
277         ${INSTALL} -d ${DESTDIR}${sbindir}
278         ${INSTALL_PROGRAM} fs ${DESTDIR}${bindir}/fs
279         ${INSTALL_PROGRAM} livesys ${DESTDIR}${bindir}/livesys
280         ${INSTALL_PROGRAM} fs ${DESTDIR}${afssrvbindir}/fs
281         ${INSTALL_PROGRAM} up ${DESTDIR}${bindir}/up
282         ${INSTALL_PROGRAM} fstrace ${DESTDIR}${sbindir}/fstrace
283         ${INSTALL_PROGRAM} cmdebug ${DESTDIR}${bindir}/cmdebug
284         ${INSTALL_PROGRAM} afsio ${DESTDIR}${bindir}/afsio ;
285         -set -x; \
286         case ${SYS_NAME} in \
287         sgi_6? ) \
288                 ${INSTALL_SCRIPT} kdump.sh.sgi_ipnos ${DESTDIR}${sbindir}/kdump; \
289                 ln -fs kdump ${DESTDIR}${sbindir}/kdump32; \
290                 ln -fs kdump.IP20 ${DESTDIR}${sbindir}/kdump.IP22; \
291                 ln -fs kdump.IP20 ${DESTDIR}${sbindir}/kdump.IP32; \
292                 for f in kdump.IP??; \
293                         do ${INSTALL_PROGRAM} $$f ${DESTDIR}${sbindir}/$$f || exit $$? ; \
294                 done ;; \
295         sun*_5[789] | sun*_510 ) \
296                 ${INSTALL_SCRIPT} kdump.sh.solaris7 ${DESTDIR}${sbindir}/kdump32; \
297                 ${INSTALL_PROGRAM} kdump-build ${DESTDIR}${sbindir}/kdump;; \
298         *linux26* | *linux_26* ) \
299                 ;; \
300         *linux* ) \
301                 ${INSTALL_SCRIPT} kdump.sh.linux ${DESTDIR}${sbindir}/kdump; \
302                 ${INSTALL_PROGRAM} kdump-build ${DESTDIR}${sbindir}/kdump ;; \
303         hp_ux11* ) \
304                 ${INSTALL_SCRIPT} kdump.sh.hp_ux11 ${DESTDIR}${sbindir}/kdump; \
305                 ${INSTALL_PROGRAM} kdump-build ${DESTDIR}${sbindir}/kdump ;; \
306         *bsd* ) \
307                 ;; \
308         *) \
309                 ${INSTALL_PROGRAM} kdump-build ${DESTDIR}${sbindir}/kdump ;; \
310         esac
311         if [ -f kdump64 ]; then \
312                 ${INSTALL_PROGRAM} kdump64 ${DESTDIR}${sbindir}/kdump; \
313         fi
314
315 dest: kdump-build fs livesys up fstrace cmdebug afsio
316         ${INSTALL} -d ${DEST}/bin
317         ${INSTALL} -d ${DEST}/etc
318         ${INSTALL} -d ${DEST}/root.server/usr/afs/bin
319         ${INSTALL_PROGRAM} fs ${DEST}/bin/fs
320         ${INSTALL_PROGRAM} livesys ${DEST}/bin/livesys
321         ${INSTALL_PROGRAM} fs ${DEST}/root.server/usr/afs/bin/fs
322         ${INSTALL_PROGRAM} up ${DEST}/bin/up
323         ${INSTALL_PROGRAM} fstrace ${DEST}/etc/fstrace
324         ${INSTALL_PROGRAM} cmdebug ${DEST}/bin/cmdebug
325         ${INSTALL_PROGRAM} afsio ${DEST}/bin/afsio
326         -set -x; \
327         case ${SYS_NAME} in \
328         sgi_6? ) \
329                 ${INSTALL_SCRIPT} ${srcdir}/kdump.sh.sgi_ipnos ${DEST}/etc/kdump; \
330                 ln -fs kdump ${DEST}/etc/kdump32; \
331                 ln -fs kdump.IP20 ${DEST}/etc/kdump.IP22; \
332                 ln -fs kdump.IP20 ${DEST}/etc/kdump.IP32; \
333                 for f in kdump.IP??; \
334                         do ${INSTALL_PROGRAM} $$f ${DEST}/etc/$$f || exit $$? ; \
335                 done ;; \
336         sun*_5[789] | sun*_510 ) \
337                 ${INSTALL_SCRIPT} ${srcdir}/kdump.sh.solaris7 ${DEST}/etc/kdump; \
338                 ${INSTALL_PROGRAM} ${srcdir}/kdump ${DEST}/etc/kdump32;; \
339         *linux26* | *linux_26* ) \
340                 ;; \
341         *alpha_linux* ) \
342                 ${INSTALL_SCRIPT} ${srcdir}/kdump.sh.linux ${DEST}/etc/kdump; \
343                 ${INSTALL_PROGRAM} kdump-alpha_linux-${LINUX_VERSION} ${DEST}/etc/kdump-${LINUX_VERSION} ;; \
344         *linux* ) \
345                 ${INSTALL_SCRIPT} ${srcdir}/kdump.sh.linux ${DEST}/etc/kdump; \
346                 ${INSTALL_PROGRAM} kdump-linux-${LINUX_VERSION} ${DEST}/etc/kdump-${LINUX_VERSION} ;; \
347         hp_ux11* ) \
348                 ${INSTALL_SCRIPT} ${srcdir}/kdump.sh.hp_ux11 ${DEST}/etc/kdump32; \
349                 ${INSTALL_PROGRAM} kdump-build ${DEST}/etc/kdump ;; \
350         *bsd*) \
351                 ;; \
352         *) \
353                 ${INSTALL_PROGRAM} kdump-build ${DEST}/etc/kdump ;; \
354         esac
355         if [ -f kdump64 ]; then \
356                 ${INSTALL_PROGRAM} kdump64 ${DEST}/etc/kdump; \
357         fi
358
359 #
360 # Misc targets
361 #
362
363 clean:
364         $(LT_CLEAN)
365         $(RM) -f *.o *.a up fs kdump-* kdump kdump64 core cmdebug \
366                 AFS_component_version_number.c fstrace gcpags livesys dedebug \
367                 cacheout afsio
368
369 test:
370         cd test; $(MAKE)
371
372 include ../config/Makefile.version