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