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