linux-dont-require-osi-vfs-to-be-installed-20011017
[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 DEST=@DEST@
9 TOP_INCDIR=@TOP_INCDIR@
10 TOP_LIBDIR=@TOP_LIBDIR@
11 prefix=@prefix@
12 exec_prefix=@exec_prefix@
13 bindir=@bindir@
14 sbindir=@sbindir@
15 libexecdir=@libexecdir@
16 libdir=@libdir@
17 includedir=@includedir@
18 mandir=@mandir@
19 afssrvbindir=@afssrvbindir@
20 afssrvsbindir=@afssrvsbindir@
21 afssrvlibexecdir=@afssrvlibexecdir@
22 COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et
23 RXGEN=${TOP_SRCDIR}/rxgen/rxgen
24 TOP_SRCDIR=@TOP_SRCDIR@
25 SYS_NAME=@AFS_SYSNAME@
26
27 SHELL = /bin/sh
28
29 LINUX_KERNEL_PATH=@LINUX_KERNEL_PATH@
30 LINUX_VERSION=@LINUX_VERSION@
31
32 include ../config/Makefile.${SYS_NAME}
33
34 INSTALLex = ${INSTALL} -m 755
35 CCXPG2= /usr/xpg2bin/cc
36
37 CFLAGS=${OPTMZ} -I${TOP_INCDIR} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS}
38
39 INCLS=${TOP_INCDIR}/afs/afsint.h \
40         ${TOP_INCDIR}/afs/cmd.h \
41         ${TOP_INCDIR}/afs/afsutil.h
42
43 FSLIBS=${TOP_LIBDIR}/libsys.a \
44          ${TOP_LIBDIR}/libvldb.a \
45          ${TOP_LIBDIR}/libubik.a \
46          ${TOP_LIBDIR}/vlib.a \
47          ${TOP_LIBDIR}/libauth.a \
48          ${TOP_LIBDIR}/librxkad.a \
49          ${TOP_LIBDIR}/libcom_err.a \
50          ${TOP_LIBDIR}/libcmd.a \
51          ${TOP_LIBDIR}/libkauth.a \
52          ${TOP_LIBDIR}/libdes.a \
53          ${TOP_LIBDIR}/librx.a \
54          ${TOP_LIBDIR}/libsys.a \
55          $(TOP_LIBDIR)/util.a \
56          ${TOP_LIBDIR}/liblwp.a \
57          ${TOP_LIBDIR}/libaudit.a
58
59 CMLIBS=${TOP_LIBDIR}/libsys.a \
60          ${TOP_LIBDIR}/libafsint.a \
61          ${TOP_LIBDIR}/librxkad.a \
62          ${TOP_LIBDIR}/libauth.a \
63          ${TOP_LIBDIR}/libcom_err.a \
64          ${TOP_LIBDIR}/libcmd.a \
65          ${TOP_LIBDIR}/librx.a \
66          ${TOP_LIBDIR}/libsys.a \
67          $(TOP_LIBDIR)/util.a \
68          ${TOP_LIBDIR}/liblwp.a
69
70 LIBS = ${FSLIBS} 
71
72 all: fs up fstrace cmdebug livesys kdump kdump64
73
74 #
75 # Build targets
76 #
77 cacheout: cacheout.o
78         $(CC) ${CFLAGS} -o cacheout cacheout.o ${LIBS} ${XLIBS} ${CMLIBS}
79
80 cacheout.o: cacheout.c
81
82 ${DEST}/bin/fs ${DEST}/root.server/usr/afs/bin/fs: fs
83         ${INSTALL} -s $? $@
84
85 ${DEST}/bin/livesys: livesys
86         ${INSTALL} -s $? $@
87
88 ${DEST}/bin/up: up
89         ${INSTALL} -s $? $@
90
91 ${DEST}/etc/fstrace: fstrace
92         ${INSTALL} -s $? $@
93
94 ${DEST}/bin/cmdebug: cmdebug
95         ${INSTALL} -s $? $@
96
97 ${DEST}/etc/kdump: kdump
98         -set -x; \
99         case ${SYS_NAME} in \
100         sgi_6? ) \
101                 ${INSTALLex} -f kdump.sh.sgi_ipnos $@; \
102                 ln -fs kdump ${DEST}/etc/kdump32; \
103                 ln -fs kdump.IP20 ${DEST}/etc/kdump.IP22; \
104                 ln -fs kdump.IP20 ${DEST}/etc/kdump.IP32; \
105                 for f in kdump.IP??; \
106                         do ${INSTALL} -s $$f ${DEST}/etc/$$f || exit $$? ; \
107                 done ;; \
108         sun4x_5[78] ) \
109                 ${INSTALLex} -f kdump.sh.solaris7 $@; \
110                 ${INSTALL} -s -f $? ${DEST}/etc/kdump32;; \
111         *linux* ) \
112                 ${INSTALLex} -f kdump.sh.linux $@; \
113                 ${INSTALL} -s kdump-${LINUX_VERSION} ${DEST}/etc/kdump-${LINUX_VERSION} ;; \
114         hp_ux11* ) \
115                 ${INSTALLex} -f kdump.sh.hp_ux11 $@; \
116                 ${INSTALL} -s -f $? ${DEST}/etc/kdump32;; \
117         *) \
118                 ${INSTALL} -s $? $@ ;; \
119         esac
120
121 ${DEST}/etc/kdump64: kdump64
122         -set -x; \
123         case ${SYS_NAME} in \
124         sun4x_5[78] | hp_ux11* ) \
125                 ${INSTALL} -s $? $@ ;;\
126         * ) \
127                 echo skipping kdump64 for ${SYS_NAME} ;; \
128         esac
129
130
131 up.o: up.c AFS_component_version_number.c
132
133 up: up.o
134         ${CC} ${CFLAGS} -g -o up up.o ${LIBS} ${XLIBS}
135
136 fs.o: fs.c ${INCLS} AFS_component_version_number.c
137
138 fs: fs.o $(LIBS)
139         ${CC} ${CFLAGS} -g -o fs fs.o ${TOP_LIBDIR}/libprot.a $(LIBS) ${XLIBS}
140
141 livesys.o: livesys.c ${INCLS} AFS_component_version_number.c
142
143 livesys: livesys.c $(LIBS)
144         ${CC} -g -o livesys $(CFLAGS) livesys.c $(LIBS) ${XLIBS}
145
146 twiddle: twiddle.c $(LIBS)
147         ${CC} -g -o twiddle $(CFLAGS) twiddle.c $(LIBS) ${XLIBS}
148
149 gcpags: gcpags.c $(LIBS)
150         ${CC} -g -o gcpags $(CFLAGS) gcpags.c $(LIBS) ${XLIBS}
151
152 whatfid.o: whatfid.c ${INCLS} AFS_component_version_number.c
153
154 whatfid: whatfid.o ${LIBS}
155         ${CC} ${CFLAGS} -g -o whatfid whatfid.o ${LIBS} ${XLIBS}
156
157 fstrace.o: fstrace.c AFS_component_version_number.c
158         case ${SYS_NAME} in \
159                 sun4_411 | sun4c_411 | sun4m_412 ) \
160                         ${CCXPG2} -g -I${TOP_SRCDIR}/config -I${TOP_INCDIR} -I${TOP_INCDIR} -c fstrace.c ;; \
161                 * ) \
162                         ${CC} ${CFLAGS} -g -I${TOP_SRCDIR}/config -I${TOP_INCDIR} -I${TOP_INCDIR} -c fstrace.c ;; \
163         esac
164
165 fstrace: fstrace.o
166         case ${SYS_NAME} in \
167                 pmax_ul43 | pmax_ul43a ) \
168                         ${CC} ${CFLAGS} -o fstrace fstrace.o ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a /usr/lib/libi.a ;; \
169                 sun4_411 | sun4c_411 | sun4m_412 ) \
170                         ${CCXPG2} ${CFLAGS} -g -o fstrace fstrace.o ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ;; \
171                 hp700_ux100 | hp800_ux100 | hp?00_ux10? | hp_ux10? | hp_ux11?) \
172                         ${CC} -I${TOP_SRCDIR}/config  -o fstrace fstrace.o ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ;; \
173                 * ) \
174                         ${CC} ${CFLAGS} -o fstrace fstrace.o ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ;; \
175         esac
176
177 cmdebug.o: cmdebug.c ${INCLS} AFS_component_version_number.c
178
179 cmdebug: cmdebug.o ${CMLIBS}
180         $(CC) -o cmdebug cmdebug.o ${CFLAGS} ${CMLIBS} ${XLIBS}
181
182 kdump.o: kdump.c ${INCLS} AFS_component_version_number.c
183         -set -x; \
184         case ${SYS_NAME} in \
185                 alpha_linux* ) \
186                         ${CC} -g -I${LINUX_KERNEL_PATH}/include -I${TOP_INCDIR} -I${TOP_SRCDIR}/config -I${TOP_SRCDIR}/libafs/afs -I${TOP_INCDIR} ${XCFLAGS} -mno-fp-regs -ffixed-8 -o kdump-${LINUX_VERSION}.o -c kdump.c ;; \
187                 *linux* ) \
188                         ${CC} -g -I${LINUX_KERNEL_PATH}/include -I${TOP_INCDIR} -I${TOP_SRCDIR}/config -I${TOP_SRCDIR}/libafs/afs -I${TOP_INCDIR} ${XCFLAGS} -o kdump-${LINUX_VERSION}.o -c kdump.c ;; \
189                 alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_osf32 | alpha_osf32c| alpha_dux?? ) \
190                         ${CC} -g ${CFLAGS} -I/usr/sys/include -I/usr/sys/BINARY -I/usr/sys/AFS -DDEBUGGER -c kdump.c ;;\
191                 sgi_6? ) \
192                         for f in ../libafs/STATIC.IP*/CPU_KDEFS; \
193                         do      IP=`expr "$$f" : '../libafs/STATIC.\(IP..\)'`; \
194                                 CPU_KDEFS=`sed 's/-mips.//' $$f`; \
195                                 echo IP = $$IP; \
196                                 echo CPU_KDEFS = $$CPU_KDEFS; \
197                                 case $$CPU_KDEFS in \
198                                 *-64*)  ${CC} -D_KMEMUSER -woff 1178 \
199                                                 -g -I${TOP_INCDIR} \
200                                                 -I${TOP_SRCDIR}/config \
201                                                 $$CPU_KDEFS \
202                                                 ${XCFLAGS64} \
203                                                 -c kdump.c -o kdump.$$IP.o \
204                                         ;; \
205                                 *)      ${CC} -D_KMEMUSER -woff 1178 \
206                                                 -g -I${TOP_INCDIR} \
207                                                 -I${TOP_SRCDIR}/config \
208                                                 $$CPU_KDEFS \
209                                                 ${XCFLAGS} -DAFS_32BIT_KERNEL_ENV \
210                                                 -c kdump.c -o kdump.$$IP.o \
211                                         ;; \
212                                 esac || exit $$?; \
213                         done \
214                         ;; \
215                 *) \
216                         ${CC} -g -I${TOP_INCDIR} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS} -c kdump.c ;; \
217         esac ;
218
219 kdump64.o : kdump.c ${INCLS} AFS_component_version_number.c
220         -set -x; \
221         case ${SYS_NAME} in \
222         sun4x_5[78] | hp_ux11* ) \
223                 ${CC} -g -I${TOP_INCDIR} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS64} -o kdump64.o -c kdump.c ;; \
224         esac
225
226 kdump:  kdump.o
227         -set -x; \
228         case ${SYS_NAME} in \
229         sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53 | sun4_53 | sun4_54 | sun4c_54 | sun4m_54 | sunx86_54) \
230                 ${CC} -g -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a /usr/lib/libkvm.a -lelf ${XLIBS} ;; \
231         sun4x_5? ) \
232                 ${CC} -g -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a  ${XLIBELFA} ${XLIBKVM} ${XLIBS} ;; \
233         sgi_6? ) \
234                 for f in ../libafs/STATIC.IP*/CPU_KDEFS; \
235                 do      IP=`expr "$$f" : '../libafs/STATIC.\(IP..\)'`; \
236                         CPU_KDEFS=`sed 's/-mips.//' $$f`; \
237                         echo IP = $$IP; \
238                         echo CPU_KDEFS = $$CPU_KDEFS; \
239                         case $$CPU_KDEFS in \
240                         *-64*)  ${CC} ${XCFLAGS64} -g \
241                                         $$CPU_KDEFS \
242                                         -o kdump.$$IP kdump.$$IP.o \
243                                         ${TOP_LIBDIR}/libcmd64.a -lelf \
244                                 ;; \
245                         *)      ${CC} ${XCFLAGS} -g \
246                                         $$CPU_KDEFS \
247                                         -o kdump.$$IP kdump.$$IP.o \
248                                         ${TOP_LIBDIR}/libcmd.a -lelf \
249                                 ;; \
250                         esac || exit $$? ; \
251                 done ;; \
252         *linux* ) \
253                 ${CC} -g -o kdump-${LINUX_VERSION} kdump-${LINUX_VERSION}.o ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ${XLIBS} ;; \
254         alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_osf32 | alpha_osf32c | alpha_dux??) \
255                 ${CC} -g -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a ${XLIBS} -ll -lmld;; \
256         ncrx86_* ) ${CC} -g -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a -lelf ${XLIBS} ;; \
257         * )     ${CC} -g -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a ${XLIBS} ;; \
258         esac
259
260 ## kdump to read from 64 bit kernel dumps
261
262 kdump64 : kdump64.o
263         -set -x; \
264         case ${SYS_NAME} in \
265         sun4x_5[78] | hp_ux11* )  \
266                 ${CC} -g ${XCFLAGS64} -o kdump64 kdump64.o ${TOP_LIBDIR}/libcmd64.a ${XLIBELFA} ${XLIBKVM} ${XLIBS} ;; \
267         esac
268
269 #
270 # Install targets
271 #
272 install: \
273         ${DESTDIR}${bindir}/fs \
274         ${DESTDIR}${bindir}/livesys \
275         ${DESTDIR}${afssrvbindir}/fs \
276         ${DESTDIR}${bindir}/up \
277         ${DESTDIR}${sbindir}/fstrace \
278         ${DESTDIR}${bindir}/cmdebug \
279         ${DESTDIR}${sbindir}/kdump \
280         ${DESTDIR}${sbindir}/kdump64
281
282 #
283 # Misc targets
284 #
285
286 clean:
287         $(RM) -f *.o *.a up fs kdump-* kdump kdump64 core cmdebug AFS_component_version_number.c fstrace gcpags
288
289 test:
290         cd test; $(MAKE)
291
292 include ../config/Makefile.version
293
294 ${DESTDIR}${bindir}/fs: fs
295         ${INSTALL} -s $? $@
296
297 ${DESTDIR}${bindir}/livesys: livesys
298         ${INSTALL} -s $? $@
299
300 ${DESTDIR}${afssrvbindir}/fs: fs
301         ${INSTALL} -s $? $@
302
303 ${DESTDIR}${bindir}/up: up
304         ${INSTALL} -s $? $@
305
306 ${DESTDIR}${sbindir}/fstrace: fstrace
307         ${INSTALL} -s $? $@
308
309 ${DESTDIR}${bindir}/cmdebug: cmdebug
310         ${INSTALL} -s $? $@
311
312 ${DESTDIR}${sbindir}/kdump: kdump
313         -set -x; \
314         case ${SYS_NAME} in \
315         sgi_6? ) \
316                 ${INSTALLex} -f kdump.sh.sgi_ipnos $@; \
317                 ln -fs kdump ${DESTDIR}${sbindir}/kdump32; \
318                 ln -fs kdump.IP20 ${DESTDIR}${sbindir}/kdump.IP22; \
319                 ln -fs kdump.IP20 ${DESTDIR}${sbindir}/kdump.IP32; \
320                 for f in kdump.IP??; \
321                         do ${INSTALL} -s $$f ${DESTDIR}${sbindir}/$$f || exit $$? ; \
322                 done ;; \
323         sun4x_5[78] ) \
324                 ${INSTALLex} -f kdump.sh.solaris7 $@; \
325                 ${INSTALL} -s -f $? ${DESTDIR}${sbindir}/kdump32;; \
326         *linux* ) \
327                 ${INSTALL} -s kdump-${LINUX_VERSION} ${DESTDIR}${sbindir}/kdump-${LINUX_VERSION} ;; \
328         hp_ux11* ) \
329                 ${INSTALLex} -f kdump.sh.hp_ux11 $@; \
330                 ${INSTALL} -s -f $? ${DESTDIR}${sbindir}/kdump32;; \
331         *) \
332                 ${INSTALL} -s $? $@ ;; \
333         esac
334
335 ${DESTDIR}${sbindir}/kdump64: kdump64
336         -set -x; \
337         case ${SYS_NAME} in \
338         sun4x_5[78] | hp_ux11* ) \
339                 ${INSTALL} -s $? $@ ;;\
340         * ) \
341                 echo skipping kdump64 for ${SYS_NAME} ;; \
342         esac
343
344 dest: \
345         ${DEST}/bin/fs \
346         ${DEST}/bin/livesys \
347         ${DEST}/root.server/usr/afs/bin/fs \
348         ${DEST}/bin/up \
349         ${DEST}/etc/fstrace \
350         ${DEST}/bin/cmdebug \
351         ${DEST}/etc/kdump \
352         ${DEST}/etc/kdump64
353