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