9407b9b72ca0dc1a2a622caea622b4599e8540e4
[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 DESTDIR=@DESTDIR@
9 SRCDIR=@SRCDIR@
10 TOP_SRCDIR=@TOP_SRCDIR@
11 SYS_NAME=@AFS_SYSNAME@
12
13 SHELL = /bin/sh
14
15 LINUX_VERS=dummy
16 include ../config/Makefile.${SYS_NAME}
17
18 INSTALLex = ${INSTALL} -m 755
19 CCXPG2= /usr/xpg2bin/cc
20
21 CFLAGS = ${OPTMZ} -I${DESTDIR}include -I${TOP_SRCDIR}/config -I${SRCDIR}include ${XCFLAGS}
22
23 INCLS = ${DESTDIR}include/afs/afsint.h \
24         ${DESTDIR}include/afs/cmd.h \
25         ${DESTDIR}include/afs/afsutil.h
26
27 VLIB = ${DESTDIR}lib/afs/
28
29 LIB = ${DESTDIR}lib/
30
31 FSLIBS = ${VLIB}libsys.a \
32          ${VLIB}libvldb.a \
33          ${LIB}libubik.a \
34          ${VLIB}vlib.a \
35          ${VLIB}libauth.a \
36          ${DESTDIR}lib/librxkad.a \
37          ${VLIB}libcom_err.a \
38          ${VLIB}libcmd.a \
39          ${VLIB}libkauth.a \
40          ${DESTDIR}lib/libdes.a \
41          ${LIB}librx.a \
42          ${VLIB}libsys.a \
43          $(VLIB)util.a \
44          ${LIB}liblwp.a \
45          ${VLIB}libaudit.a
46
47 CMLIBS = ${VLIB}libsys.a \
48          ${VLIB}libafsint.a \
49          ${DESTDIR}lib/librxkad.a \
50          ${VLIB}libauth.a \
51          ${VLIB}libcom_err.a \
52          ${VLIB}libcmd.a \
53          ${LIB}librx.a \
54          ${VLIB}libsys.a \
55          $(VLIB)util.a \
56          ${LIB}liblwp.a 
57
58 LIBS = ${FSLIBS} 
59
60 include ../config/Makefile.version
61
62 cacheout: cacheout.o
63         $(CC) ${CFLAGS} -o cacheout cacheout.o ${LIBS} ${XLIBS} ${CMLIBS}
64
65 cacheout.o: cacheout.c
66
67 all: fs up cmdebug fstrace kdump gcpags kdump64
68
69 ${DESTDIR}bin/fs ${DESTDIR}root.server/usr/afs/bin/fs: fs
70         ${INSTALL} -s $? $@
71
72 ${DESTDIR}bin/up: up
73         ${INSTALL} -s $? $@
74
75 ${DESTDIR}etc/fstrace: fstrace
76         ${INSTALL} -s $? $@
77
78 ${DESTDIR}bin/cmdebug: cmdebug
79         ${INSTALL} -s $? $@
80
81 ${DESTDIR}etc/kdump: kdump
82         -set -x; \
83         case ${SYS_NAME} in \
84         sgi_6? ) \
85                 ${INSTALLex} -f kdump.sh.sgi_ipnos $@; \
86                 ln -fs kdump ${DESTDIR}etc/kdump32; \
87                 ln -fs kdump.IP20 ${DESTDIR}etc/kdump.IP22; \
88                 ln -fs kdump.IP20 ${DESTDIR}etc/kdump.IP32; \
89                 for f in kdump.IP??; \
90                 do ${INSTALL} -s $$f ${DESTDIR}etc/$$f || exit $$? ; \
91                 done ;; \
92         sun4x_57 ) \
93                 ${INSTALLex} -f kdump.sh.solaris7 $@; \
94                 ${INSTALL} -s -f $? ${DESTDIR}etc/kdump32;; \
95         *linux* ) \
96                 for lv in ${LINUX_VERS}; do \
97                         ${INSTALL} -s kdump-$$lv ${DESTDIR}etc/kdump-$$lv ; \
98                 done ;; \
99         hp_ux11* ) \
100                 ${INSTALLex} -f kdump.sh.hp_ux11 $@; \
101                 ${INSTALL} -s -f $? ${DESTDIR}etc/kdump32;; \
102         *) \
103                 ${INSTALL} -s $? $@ ;; \
104         esac
105
106 ${DESTDIR}etc/kdump64: kdump64
107         -set -x; \
108         case ${SYS_NAME} in \
109         sun4x_57 | hp_ux11* ) \
110                 ${INSTALL} -s $? $@ ;;\
111         * ) \
112                 echo skipping kdump64 for ${SYS_NAME} ;; \
113         esac
114
115
116 install: all ${DESTDIR}bin/fs ${DESTDIR}root.server/usr/afs/bin/fs \
117         ${DESTDIR}bin/up ${DESTDIR}etc/fstrace ${DESTDIR}bin/cmdebug \
118         ${DESTDIR}etc/kdump ${DESTDIR}etc/kdump64
119
120 system: install
121
122 up.o: up.c AFS_component_version_number.c
123
124 up: up.o
125         ${CC} ${CFLAGS} -g -o up up.o ${LIBS} ${XLIBS}
126
127 fs.o: fs.c ${INCLS} AFS_component_version_number.c
128
129 fs: fs.o $(LIBS)
130         ${CC} ${CFLAGS} -g -o fs fs.o ${DESTDIR}lib/afs/libprot.a $(LIBS) ${XLIBS}
131
132 twiddle: twiddle.c $(LIBS)
133         ${CC} -g -o twiddle $(CFLAGS) twiddle.c $(LIBS) ${XLIBS}
134
135 gcpags: gcpags.c $(LIBS)
136         ${CC} -g -o gcpags $(CFLAGS) gcpags.c $(LIBS) ${XLIBS}
137
138 whatfid.o: whatfid.c ${INCLS} AFS_component_version_number.c
139
140 whatfid: whatfid.o ${LIBS}
141         ${CC} ${CFLAGS} -g -o whatfid whatfid.o ${LIBS} ${XLIBS}
142
143 fstrace.o: fstrace.c AFS_component_version_number.c
144         case ${SYS_NAME} in \
145                 sun4_411 | sun4c_411 | sun4m_412 ) \
146                         ${CCXPG2} -g -I${TOP_SRCDIR}/config -I${DESTDIR}include -I${SRCDIR}include -c fstrace.c ;; \
147                 * ) \
148                         ${CC} ${CFLAGS} -g -I${TOP_SRCDIR}/config -I${DESTDIR}include -I${SRCDIR}include -c fstrace.c ;; \
149         esac
150
151 fstrace: fstrace.o
152         case ${SYS_NAME} in \
153                 pmax_ul43 | pmax_ul43a ) \
154                         ${CC} ${CFLAGS} -o fstrace fstrace.o ${VLIB}/libsys.a ${VLIB}libcmd.a ${VLIB}util.a /usr/lib/libi.a ;; \
155                 sun4_411 | sun4c_411 | sun4m_412 ) \
156                         ${CCXPG2} ${CFLAGS} -g -o fstrace fstrace.o ${VLIB}/libsys.a ${VLIB}libcmd.a ${VLIB}util.a ;; \
157                 hp700_ux100 | hp800_ux100 | hp?00_ux10? | hp_ux10? | hp_ux11?) \
158                         ${CC} -I${TOP_SRCDIR}/config  -o fstrace fstrace.o ${VLIB}/libsys.a ${VLIB}libcmd.a ${VLIB}util.a ;; \
159                 * ) \
160                         ${CC} ${CFLAGS} -o fstrace fstrace.o ${VLIB}/libsys.a ${VLIB}libcmd.a ${VLIB}util.a ;; \
161         esac
162
163 cmdebug.o: cmdebug.c ${INCLS} AFS_component_version_number.c
164
165 cmdebug: cmdebug.o ${CMLIBS}
166         $(CC) -o cmdebug cmdebug.o ${CFLAGS} ${CMLIBS} ${XLIBS}
167
168 kdump.o: kdump.c ${INCLS} AFS_component_version_number.c
169         -set -x; \
170         case ${SYS_NAME} in \
171                 alpha_linux* ) \
172                         for lv in ${LINUX_VERS}; do \
173                                 ${CC} -g -I${LINUX_SRCDIR}$$lv/include -I${DESTDIR}include -I${TOP_SRCDIR}/config -I${SRCDIR}include ${XCFLAGS} -mno-fp-regs -ffixed-8 -o kdump-$$lv.o -c kdump.c ; \
174                                 done ;; \
175                 *linux* ) \
176                         for lv in ${LINUX_VERS}; do \
177                                 ${CC} -g -I${LINUX_SRCDIR}$$lv/include -I${DESTDIR}include -I${TOP_SRCDIR}/config -I${SRCDIR}include ${XCFLAGS} -o kdump-$$lv.o -c kdump.c ; \
178                         done ;; \
179                 alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_osf32 | alpha_osf32c| alpha_dux?? ) \
180                         ${CC} -g ${CFLAGS} -I/usr/sys/include -I/usr/sys/BINARY -I/usr/sys/AFS -DDEBUGGER -c kdump.c ;;\
181                 sgi_6? ) \
182                         for f in ../libafs/STATIC.IP*/CPU_KDEFS; \
183                         do      IP=`expr "$$f" : '../libafs/STATIC.\(IP..\)'`; \
184                                 CPU_KDEFS=`sed 's/-mips.//' $$f`; \
185                                 echo IP = $$IP; \
186                                 echo CPU_KDEFS = $$CPU_KDEFS; \
187                                 case $$CPU_KDEFS in \
188                                 *-64*)  ${CC} -D_KMEMUSER -woff 1178 \
189                                                 -g -I${DESTDIR}include \
190                                                 -I${TOP_SRCDIR}/config \
191                                                 $$CPU_KDEFS \
192                                                 ${XCFLAGS64} \
193                                                 -c kdump.c -o kdump.$$IP.o \
194                                         ;; \
195                                 *)      ${CC} -D_KMEMUSER -woff 1178 \
196                                                 -g -I${DESTDIR}include \
197                                                 -I${TOP_SRCDIR}/config \
198                                                 $$CPU_KDEFS \
199                                                 ${XCFLAGS} -DAFS_32BIT_KERNEL_ENV \
200                                                 -c kdump.c -o kdump.$$IP.o \
201                                         ;; \
202                                 esac || exit $$?; \
203                         done \
204                         ;; \
205                 *) \
206                         ${CC} -g -I${DESTDIR}include -I${TOP_SRCDIR}/config -I${SRCDIR}include ${XCFLAGS} -c kdump.c ;; \
207         esac ;
208
209 kdump64.o : kdump.c ${INCLS} AFS_component_version_number.c
210         -set -x; \
211         case ${SYS_NAME} in \
212         sun4x_57 | hp_ux11* ) \
213                 ${CC} -g -I${DESTDIR}include -I${TOP_SRCDIR}/config -I${SRCDIR}include ${XCFLAGS64} -o kdump64.o -c kdump.c ;; \
214         esac
215
216 kdump:  kdump.o
217         -set -x; \
218         case ${SYS_NAME} in \
219         sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53 | sun4_53 | sun4_54 | sun4c_54 | sun4m_54 | sunx86_54) \
220                 ${CC} -g -o kdump kdump.o ${DESTDIR}lib/afs/libcmd.a  ${DESTDIR}lib/afs/util.a /usr/lib/libkvm.a -lelf ${XLIBS} ;; \
221         sun4x_5? ) \
222                 ${CC} -g -o kdump kdump.o ${DESTDIR}lib/afs/libcmd.a  ${DESTDIR}lib/afs/util.a  ${XLIBELFA}  ${XLIBKVM} ${XLIBS} ;; \
223         sgi_6? ) \
224                 for f in ../libafs/STATIC.IP*/CPU_KDEFS; \
225                 do      IP=`expr "$$f" : '../libafs/STATIC.\(IP..\)'`; \
226                         CPU_KDEFS=`sed 's/-mips.//' $$f`; \
227                         echo IP = $$IP; \
228                         echo CPU_KDEFS = $$CPU_KDEFS; \
229                         case $$CPU_KDEFS in \
230                         *-64*)  ${CC} ${XCFLAGS64} -g \
231                                         $$CPU_KDEFS \
232                                         -o kdump.$$IP kdump.$$IP.o \
233                                         ${DESTDIR}lib/afs/libcmd64.a -lelf \
234                                 ;; \
235                         *)      ${CC} ${XCFLAGS} -g \
236                                         $$CPU_KDEFS \
237                                         -o kdump.$$IP kdump.$$IP.o \
238                                         ${DESTDIR}lib/afs/libcmd.a -lelf \
239                                 ;; \
240                         esac || exit $$? ; \
241                 done ;; \
242         *linux* ) \
243                 for lv in ${LINUX_VERS}; do \
244                         ${CC} -g -o kdump-$$lv kdump-$$lv.o ${DESTDIR}lib/afs/libcmd.a  ${DESTDIR}lib/afs/util.a ${XLIBS} ; \
245                 done ;; \
246         alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_osf32 | alpha_osf32c | alpha_dux??) \
247                 ${CC} -g -o kdump kdump.o ${DESTDIR}lib/afs/libcmd.a  ${DESTDIR}lib/afs/util.a ${XLIBS} -ll -lmld;; \
248         ncrx86_* ) ${CC} -g -o kdump kdump.o ${DESTDIR}lib/afs/libcmd.a  ${DESTDIR}lib/afs/util.a -lelf ${XLIBS} ;; \
249         * )     ${CC} -g -o kdump kdump.o ${DESTDIR}lib/afs/libcmd.a  ${DESTDIR}lib/afs/util.a ${XLIBS} ;; \
250         esac
251
252 ## kdump to read from 64 bit kernel dumps
253
254 kdump64 : kdump64.o
255         -set -x; \
256         case ${SYS_NAME} in \
257         sun4x_57 | hp_ux11* )  \
258                 ${CC} -g ${XCFLAGS64} -o kdump64 kdump64.o ${DESTDIR}lib/afs/libcmd64.a ${XLIBELFA}  ${XLIBKVM} ${XLIBS} ;; \
259         esac
260
261 clean:
262         rm -f *.o *.a up fs core cmdebug AFS_component_version_number.c fstrace gcpags
263
264 beancount:
265         wc -l *.c *.h
266
267 test:
268         cd test; $(MAKE)
269