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