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