solaris9-and-makefile-updates-20011102
[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         sun4x_5[789]|sunx86_5[789] ) \
87                 ${INSTALLex} -f ${srcdir}/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         *) \
96                 ${INSTALL} -s $? $@ ;; \
97         esac
98
99 ${DEST}/etc/kdump64: kdump64
100         -set -x; \
101         case ${SYS_NAME} in \
102         sun4x_5[789] | hp_ux11* |sunx86_5[789] ) \
103                 ${INSTALL} -s $? $@ ;;\
104         * ) \
105                 echo skipping kdump64 for ${SYS_NAME} ;; \
106         esac
107
108
109 up.o: up.c AFS_component_version_number.c
110
111 up: up.o
112         ${CC} ${CFLAGS} -g -o up up.o ${LIBS} ${XLIBS}
113
114 fs.o: fs.c ${INCLS} AFS_component_version_number.c
115
116 fs: fs.o $(LIBS)
117         ${CC} ${CFLAGS} -g -o fs fs.o ${TOP_LIBDIR}/libprot.a $(LIBS) ${XLIBS}
118
119 livesys.o: livesys.c ${INCLS} AFS_component_version_number.c
120
121 livesys: livesys.c $(LIBS)
122         ${CC} -g -o livesys $(CFLAGS) ${srcdir}/livesys.c $(LIBS) ${XLIBS}
123
124 twiddle: twiddle.c $(LIBS)
125         ${CC} -g -o twiddle $(CFLAGS) twiddle.c $(LIBS) ${XLIBS}
126
127 gcpags: gcpags.c $(LIBS)
128         ${CC} -g -o gcpags $(CFLAGS) gcpags.c $(LIBS) ${XLIBS}
129
130 whatfid.o: whatfid.c ${INCLS} AFS_component_version_number.c
131
132 whatfid: whatfid.o ${LIBS}
133         ${CC} ${CFLAGS} -g -o whatfid whatfid.o ${LIBS} ${XLIBS}
134
135 fstrace.o: fstrace.c AFS_component_version_number.c
136         case ${SYS_NAME} in \
137                 sun4_411 | sun4c_411 | sun4m_412 ) \
138                         ${CCXPG2} -g -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} -I${TOP_INCDIR} -c ${srcdir}/fstrace.c ;; \
139                 * ) \
140                         ${CC} ${CFLAGS} -g -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} -I${TOP_INCDIR} -c ${srcdir}/fstrace.c ;; \
141         esac
142
143 fstrace: fstrace.o
144         case ${SYS_NAME} in \
145                 pmax_ul43 | pmax_ul43a ) \
146                         ${CC} ${CFLAGS} -o fstrace fstrace.o ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a /usr/lib/libi.a ;; \
147                 sun4_411 | sun4c_411 | sun4m_412 ) \
148                         ${CCXPG2} ${CFLAGS} -g -o fstrace fstrace.o ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ;; \
149                 hp700_ux100 | hp800_ux100 | hp?00_ux10? | hp_ux10? | hp_ux11?) \
150                         ${CC} -I${TOP_OBJDIR}/src/config  -o fstrace fstrace.o ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ;; \
151                 * ) \
152                         ${CC} ${CFLAGS} -o fstrace fstrace.o ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ;; \
153         esac
154
155 cmdebug.o: cmdebug.c ${INCLS} AFS_component_version_number.c
156
157 cmdebug: cmdebug.o ${CMLIBS}
158         $(CC) -o cmdebug cmdebug.o ${CFLAGS} ${CMLIBS} ${XLIBS}
159
160 kdump.o: kdump.c ${INCLS} AFS_component_version_number.c
161         -set -x; \
162         case ${SYS_NAME} in \
163                 alpha_linux* ) \
164                         ${CC} -g -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 ;; \
165                 *linux* ) \
166                         ${CC} -g -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 ;; \
167                 alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_osf32 | alpha_osf32c| alpha_dux?? ) \
168                         ${CC} -g ${CFLAGS} -I/usr/sys/include -I/usr/sys/BINARY -I/usr/sys/AFS -DDEBUGGER -c ${srcdir}/kdump.c ;;\
169                 sgi_6? ) \
170                         for f in ../libafs/STATIC.IP*/CPU_KDEFS; \
171                         do      IP=`expr "$$f" : '../libafs/STATIC.\(IP..\)'`; \
172                                 CPU_KDEFS=`sed 's/-mips.//' $$f`; \
173                                 echo IP = $$IP; \
174                                 echo CPU_KDEFS = $$CPU_KDEFS; \
175                                 case $$CPU_KDEFS in \
176                                 *-64*)  ${CC} -D_KMEMUSER -woff 1178 \
177                                                 -g -I${TOP_INCDIR} \
178                                                 -I${TOP_OBJDIR}/src/config \
179                                                 $$CPU_KDEFS \
180                                                 ${XCFLAGS64} \
181                                                 -c ${srcdir}/kdump.c -o kdump.$$IP.o \
182                                         ;; \
183                                 *)      ${CC} -D_KMEMUSER -woff 1178 \
184                                                 -g -I${TOP_INCDIR} \
185                                                 -I${TOP_OBJDIR}/src/config \
186                                                 $$CPU_KDEFS \
187                                                 ${XCFLAGS} -DAFS_32BIT_KERNEL_ENV \
188                                                 -c ${srcdir}/kdump.c -o kdump.$$IP.o \
189                                         ;; \
190                                 esac || exit $$?; \
191                         done \
192                         ;; \
193                 *) \
194                         ${CC} -g -I${TOP_INCDIR}/afs -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} ${XCFLAGS} -c ${srcdir}/kdump.c ;; \
195         esac ;
196
197 kdump64.o : kdump.c ${INCLS} AFS_component_version_number.c
198         -set -x; \
199         case ${SYS_NAME} in \
200         sun4x_5[789] | hp_ux11* |sunx86_5[789] ) \
201                 ${CC} -g -I${TOP_INCDIR}/afs -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} ${XCFLAGS64} -o kdump64.o -c ${srcdir}/kdump.c ;; \
202         esac
203
204 kdump:  kdump.o
205         -set -x; \
206         case ${SYS_NAME} in \
207         sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53 | sun4_53 | sun4_54 | sun4c_54 | sun4m_54 | sunx86_5? ) \
208                 ${CC} -g -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a /usr/lib/libkvm.a -lelf ${XLIBS} ;; \
209         sun4x_5? |sunx86_5? ) \
210                 ${CC} -g -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a  ${XLIBELFA} ${XLIBKVM} ${XLIBS} ;; \
211         sgi_6? ) \
212                 for f in ../libafs/STATIC.IP*/CPU_KDEFS; \
213                 do      IP=`expr "$$f" : '../libafs/STATIC.\(IP..\)'`; \
214                         CPU_KDEFS=`sed 's/-mips.//' $$f`; \
215                         echo IP = $$IP; \
216                         echo CPU_KDEFS = $$CPU_KDEFS; \
217                         case $$CPU_KDEFS in \
218                         *-64*)  ${CC} ${XCFLAGS64} -g \
219                                         $$CPU_KDEFS \
220                                         -o kdump.$$IP kdump.$$IP.o \
221                                         ${TOP_LIBDIR}/libcmd64.a -lelf \
222                                 ;; \
223                         *)      ${CC} ${XCFLAGS} -g \
224                                         $$CPU_KDEFS \
225                                         -o kdump.$$IP kdump.$$IP.o \
226                                         ${TOP_LIBDIR}/libcmd.a -lelf \
227                                 ;; \
228                         esac || exit $$? ; \
229                 done ;; \
230         *linux* ) \
231                 ${CC} -g -o kdump-${LINUX_VERSION} kdump-${LINUX_VERSION}.o ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ${XLIBS} ;; \
232         alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_osf32 | alpha_osf32c | alpha_dux??) \
233                 ${CC} -g -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a ${XLIBS} -ll -lmld;; \
234         ncrx86_* ) ${CC} -g -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a -lelf ${XLIBS} ;; \
235         * )     ${CC} -g -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a ${XLIBS} ;; \
236         esac
237
238 ## kdump to read from 64 bit kernel dumps
239
240 kdump64 : kdump64.o
241         -set -x; \
242         case ${SYS_NAME} in \
243         sun4x_5[789] | hp_ux11* |sunx86_5[789] )  \
244                 ${CC} -g ${XCFLAGS64} -o kdump64 kdump64.o ${TOP_LIBDIR}/libcmd64.a ${XLIBELFA} ${XLIBKVM} ${XLIBS} ;; \
245         esac
246
247 #
248 # Install targets
249 #
250 install: \
251         ${DESTDIR}${bindir}/fs \
252         ${DESTDIR}${bindir}/livesys \
253         ${DESTDIR}${afssrvbindir}/fs \
254         ${DESTDIR}${bindir}/up \
255         ${DESTDIR}${sbindir}/fstrace \
256         ${DESTDIR}${bindir}/cmdebug \
257         ${DESTDIR}${sbindir}/kdump \
258         ${DESTDIR}${sbindir}/kdump64
259
260 #
261 # Misc targets
262 #
263
264 clean:
265         $(RM) -f *.o *.a up fs kdump-* kdump kdump64 core cmdebug AFS_component_version_number.c fstrace gcpags
266
267 test:
268         cd test; $(MAKE)
269
270 include ../config/Makefile.version
271
272 ${DESTDIR}${bindir}/fs: fs
273         ${INSTALL} -s $? $@
274
275 ${DESTDIR}${bindir}/livesys: livesys
276         ${INSTALL} -s $? $@
277
278 ${DESTDIR}${afssrvbindir}/fs: fs
279         ${INSTALL} -s $? $@
280
281 ${DESTDIR}${bindir}/up: up
282         ${INSTALL} -s $? $@
283
284 ${DESTDIR}${sbindir}/fstrace: fstrace
285         ${INSTALL} -s $? $@
286
287 ${DESTDIR}${bindir}/cmdebug: cmdebug
288         ${INSTALL} -s $? $@
289
290 ${DESTDIR}${sbindir}/kdump: kdump
291         -set -x; \
292         case ${SYS_NAME} in \
293         sgi_6? ) \
294                 ${INSTALLex} -f kdump.sh.sgi_ipnos $@; \
295                 ln -fs kdump ${DESTDIR}${sbindir}/kdump32; \
296                 ln -fs kdump.IP20 ${DESTDIR}${sbindir}/kdump.IP22; \
297                 ln -fs kdump.IP20 ${DESTDIR}${sbindir}/kdump.IP32; \
298                 for f in kdump.IP??; \
299                         do ${INSTALL} -s $$f ${DESTDIR}${sbindir}/$$f || exit $$? ; \
300                 done ;; \
301         sun4x_5[789] |sunx86_5[789] ) \
302                 ${INSTALLex} -f kdump.sh.solaris7 $@; \
303                 ${INSTALL} -s -f $? ${DESTDIR}${sbindir}/kdump32;; \
304         *linux* ) \
305                 ${INSTALL} -s kdump-${LINUX_VERSION} ${DESTDIR}${sbindir}/kdump-${LINUX_VERSION} ;; \
306         hp_ux11* ) \
307                 ${INSTALLex} -f kdump.sh.hp_ux11 $@; \
308                 ${INSTALL} -s -f $? ${DESTDIR}${sbindir}/kdump32;; \
309         *) \
310                 ${INSTALL} -s $? $@ ;; \
311         esac
312
313 ${DESTDIR}${sbindir}/kdump64: kdump64
314         -set -x; \
315         case ${SYS_NAME} in \
316         sun4x_5[789] | hp_ux11* |sunx86_5[789] ) \
317                 ${INSTALL} -s $? $@ ;;\
318         * ) \
319                 echo skipping kdump64 for ${SYS_NAME} ;; \
320         esac
321
322 dest: \
323         ${DEST}/bin/fs \
324         ${DEST}/bin/livesys \
325         ${DEST}/root.server/usr/afs/bin/fs \
326         ${DEST}/bin/up \
327         ${DEST}/etc/fstrace \
328         ${DEST}/bin/cmdebug \
329         ${DEST}/etc/kdump \
330         ${DEST}/etc/kdump64
331