cf74460e0ea1a8c481a600807d058174c45bc80f
[openafs.git] / 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 # Portions Copyright (c) 2003 Apple Computer, Inc.
9
10 srcdir=@srcdir@
11 include @TOP_OBJDIR@/src/config/Makefile.config
12
13 ENABLE_KERNEL_MODULE=@ENABLE_KERNEL_MODULE@
14
15 # To compile AFS from scratch in the src tree run "make".
16 #   This recursively calls "make install ..." and does not depend on the
17 #   existence of any non-standard programs.
18 # To compile for the kernel type "make blibafs".  This assumes install, 
19 #   rxgen, compile_et and others already exist and runs it with
20 #   "-argument kinstall".
21
22 COMPILE_PART1  = cd src && cd
23 COMPILE_PART2A = && $(MAKE)
24 COMPILE_PART2B = all
25 COMPILE_PART2  = ${COMPILE_PART2A} ${COMPILE_PART2B}
26 COMPILE_CLEAN  = ${COMPILE_PART2A} clean
27 COMPILE_DEPINSTALL  = ${COMPILE_PART2A} depinstall
28 COMPILE_GENERATED  = ${COMPILE_PART2A} generated
29
30 all: force
31         $(MAKE) build
32
33 all_nolibafs: force
34         $(MAKE) build TARGET=finale_nolibafs
35
36 only_libafs: force
37         $(MAKE) build TARGET=libafs
38
39 only_libafs_tree: force
40         $(MAKE) build TARGET=libafs_tree
41
42 buildtools: force
43         $(MAKE) build TARGET=build_tools COMPILE_PART2B=buildtools
44
45 cscope:
46         ( cd src ; cscope -b -R )
47
48 generated: force buildtools
49         +${COMPILE_PART1} afs ${COMPILE_GENERATED}
50         +${COMPILE_PART1} auth ${COMPILE_GENERATED}
51         +${COMPILE_PART1} bozo ${COMPILE_GENERATED}
52         +${COMPILE_PART1} bubasics ${COMPILE_GENERATED}
53         +${COMPILE_PART1} bucoord ${COMPILE_GENERATED}
54         +${COMPILE_PART1} budb ${COMPILE_GENERATED}
55         +${COMPILE_PART1} cmd ${COMPILE_GENERATED}
56         +${COMPILE_PART1} fsint ${COMPILE_GENERATED}
57         +${COMPILE_PART1} kauth ${COMPILE_GENERATED}
58         +${COMPILE_PART1} ptserver ${COMPILE_GENERATED}
59         +${COMPILE_PART1} rxkad ${COMPILE_GENERATED}
60         +${COMPILE_PART1} rxstat ${COMPILE_GENERATED}
61         +${COMPILE_PART1} sys ${COMPILE_GENERATED}
62         +${COMPILE_PART1} ubik ${COMPILE_GENERATED}
63         +${COMPILE_PART1} update ${COMPILE_GENERATED}
64         +${COMPILE_PART1} vlserver ${COMPILE_GENERATED}
65         +${COMPILE_PART1} volser ${COMPILE_GENERATED}
66         +${COMPILE_PART1} config ${COMPILE_PART2A} generated_clean
67         +${COMPILE_PART1} roken ${COMPILE_PART2A} clean
68         +${COMPILE_PART1} crypto/hcrypto ${COMPILE_PART2A} clean
69         +${COMPILE_PART1} opr ${COMPILE_PART2A} clean
70
71 install: all install_dirs
72         $(MAKE) build COMPILE_PART2B=install
73
74 install_nolibafs: all_nolibafs install_dirs
75         $(MAKE) build TARGET=finale_nolibafs COMPILE_PART2B=install
76
77 install_only_libafs: only_libafs install_dirs
78         $(MAKE) build TARGET=libafs COMPILE_PART2B=install
79
80 dest: all dest_dirs
81         $(MAKE) build COMPILE_PART2B=dest
82         -${INSTALL_DATA} ${srcdir}/src/LICENSE ${DEST}/LICENSE
83
84 dest_nolibafs: all_nolibafs dest_dirs
85         $(MAKE) build TARGET=finale_nolibafs COMPILE_PART2B=dest
86         -${INSTALL_DATA} ${srcdir}/src/LICENSE ${DEST}/LICENSE
87
88 dest_only_libafs: only_libafs dest_dirs
89         $(MAKE) build TARGET=libafs COMPILE_PART2B=dest
90         -${INSTALL_DATA} ${srcdir}/src/LICENSE ${DEST}/LICENSE
91
92 dpkg:
93         ln -fs ${srcdir}/src/packaging/Debian debian
94         dpkg-buildpackage -rfakeroot -b -us -uc
95
96 packages: dest
97         @case ${SYS_NAME} in \
98         *_darwin_* ) \
99                 ${COMPILE_PART1} packaging/MacOS && bash ./buildpkg.sh ${DEST} ;; \
100         hp_ux110 ) \
101                 ${COMPILE_PART1} packaging/HP-UX && swpackage -s  psf-1.2.10-transarc-paths-11.00 ;; \
102         hp_ux11i ) \
103                 ${COMPILE_PART1} packaging/HP-UX && swpackage -s  psf-1.2.10-transarc-paths-11.11 ;; \
104         ia64_hpux1122 ) \
105                 ${COMPILE_PART1} packaging/HP-UX && swpackage -s  psf-1.2.10-transarc-paths-11.22 ;; \
106         ia64_hpux1123 | hp_ux1123) \
107                 ${COMPILE_PART1} packaging/HP-UX && swpackage -s  psf-1.2.10-transarc-paths-11.23 ;; \
108         *) \
109                 echo Not building packages for ${SYS_NAME} ;; \
110         esac
111
112 ${TOP_INCDIR}/afs ${TOP_INCDIR}/rx ${TOP_INCDIR}/hcrypto ${TOP_INCDIR}/opr ${TOP_LIBDIR} ${TOP_JLIBDIR}:
113         mkdir -p $@
114
115 install_dirs: force
116         mkdir -p ${DESTDIR}${bindir}
117         mkdir -p ${DESTDIR}${sbindir}
118         mkdir -p ${DESTDIR}${libexecdir}/openafs
119         mkdir -p ${DESTDIR}${libdir}/afs
120         mkdir -p ${DESTDIR}${includedir}/afs
121         mkdir -p ${DESTDIR}${includedir}/rx
122         mkdir -p ${DESTDIR}${afskerneldir}
123         mkdir -p ${DESTDIR}${afssrvbindir}
124         mkdir -p ${DESTDIR}${afssrvsbindir}
125         mkdir -p ${DESTDIR}${afssrvlibexecdir}
126         mkdir -p ${DESTDIR}${afsdatadir}/C
127
128 dest_dirs: force
129         mkdir -p ${DEST}/bin
130         mkdir -p ${DEST}/etc
131         mkdir -p ${DEST}/lib/afs
132         mkdir -p ${DEST}/include/afs
133         mkdir -p ${DEST}/include/rx
134         mkdir -p ${DEST}/root.client/usr/vice/etc/C
135         mkdir -p ${DEST}/root.server/etc
136         mkdir -p ${DEST}/root.server/usr/afs/bin
137
138 prelude: ${TOP_INCDIR}/afs ${TOP_INCDIR}/rx ${TOP_INCDIR}/hcrypto ${TOP_INCDIR}/opr ${TOP_LIBDIR}
139
140 project: cmd comerr 
141
142 tests: all_nolibafs
143         +${COMPILE_PART1} tests ${COMPILE_PART2}
144
145 tests_libafs: all
146         +${COMPILE_PART1} tests ${COMPILE_PART2}
147
148 config: prelude
149         +${COMPILE_PART1} config ${COMPILE_PART2}
150
151 procmgmt: $(DIR_roken) config
152         +${COMPILE_PART1} procmgmt ${COMPILE_PART2}
153
154 opr: config hcrypto $(DIR_roken)
155         +${COMPILE_PART1} opr ${COMPILE_PART2}
156
157 util: opr $(DIR_roken) procmgmt hcrypto lwp
158         +${COMPILE_PART1} util ${COMPILE_PART2}
159
160 libafscp: util afs volser vlserver rx auth fsint
161         +${COMPILE_PART1} libafscp ${COMPILE_PART2}
162
163 audit: util rx rxkad fsint
164         +${COMPILE_PART1} audit ${COMPILE_PART2} #TODO
165
166 comerr: util $(DIR_roken)
167         +${COMPILE_PART1} comerr ${COMPILE_PART2}
168
169 cmd: comerr
170         +@case ${SYS_NAME} in \
171         sgi_6* | sun*_5[789] | sun*_51[01] | hp_ux11* | ia64_hpux* | sparc64_linux* | alpha_linux* ) \
172                 ${COMPILE_PART1} cmd ${COMPILE_PART2}64 ;; \
173         *) \
174                 ${COMPILE_PART1} cmd ${COMPILE_PART2} ;; \
175         esac
176
177 hcrypto: config $(DIR_roken)
178         +${COMPILE_PART1} crypto/hcrypto ${COMPILE_PART2}
179
180 rfc3961: config hcrypto
181         +${COMPILE_PART1} crypto/rfc3961 ${COMPILE_PART2}
182
183 lwp: opr $(DIR_roken) lwp_depinstall
184         +${COMPILE_PART1} lwp ${COMPILE_PART2}
185
186 roken: config
187         +${COMPILE_PART1} roken ${COMPILE_PART2}
188
189 rxgen: $(DIR_roken) config
190         +${COMPILE_PART1} rxgen ${COMPILE_PART2}
191
192 rx: config lwp rxgen rx_depinstall util
193         +${COMPILE_PART1} rx ${COMPILE_PART2}
194
195 rxstat: rx rxstat_depinstall
196         +${COMPILE_PART1} rxstat ${COMPILE_PART2}
197
198 rxtests: rxdebug
199 rxdebug: rx sys
200         +${COMPILE_PART1} rxdebug ${COMPILE_PART2}
201
202 fsint: cmd comerr rxgen rx lwp fsint_depinstall
203         +${COMPILE_PART1} fsint ${COMPILE_PART2}
204
205 export2: project 
206
207 export: 
208         @case ${SYS_NAME} in \
209         rs_aix*) \
210                 ${MAKE} export_build ; \
211         esac
212
213 export_build: fsint
214         +${COMPILE_PART1} export ${COMPILE_PART2}
215
216 afs: config export comerr afs_depinstall
217         +${COMPILE_PART1} afs ${COMPILE_PART2}
218
219 sys: cmd comerr afs hcrypto rx rxstat fsint sys_depinstall
220         +${COMPILE_PART1} sys ${COMPILE_PART2}
221
222 rxkad: cmd comerr hcrypto rx rxkad_depinstall
223         +${COMPILE_PART1} rxkad ${COMPILE_PART2}
224
225 auth: cmd comerr hcrypto lwp rx rxkad audit sys auth_depinstall
226         +${COMPILE_PART1} auth ${COMPILE_PART2}
227
228 ubik: cmd comerr auth ubik_depinstall sys
229         +${COMPILE_PART1} ubik ${COMPILE_PART2}
230
231 tubik: ubik libafsrpc libafsauthent
232         +case ${SYS_NAME} in \
233         alpha_dux*|sgi_*|sun*_5*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*[nof]bsd*|*_darwin_*) \
234                 ${COMPILE_PART1} tubik ${COMPILE_PART2} ;; \
235         *) \
236                 echo Not building MT ubik for ${SYS_NAME} ;; \
237         esac
238
239 ubiktests: ubik
240
241 ptserver: cmd comerr ubik cmd comerr auth audit ptserver_depinstall
242         +${COMPILE_PART1} ptserver ${COMPILE_PART2}
243
244 tptserver: cmd comerr ptserver tubik libafsrpc libafsauthent
245         +case ${SYS_NAME} in \
246         alpha_dux*|sgi_*|sun*_5*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*[nof]bsd*|*_darwin_*) \
247                 ${COMPILE_PART1} tptserver ${COMPILE_PART2} ;; \
248         *) \
249                 echo Not building MT ptserver for ${SYS_NAME} ;; \
250         esac
251
252 kauth: cmd comerr ubik cmd auth comerr ptserver audit libacl kauth_depinstall sys_depinstall
253         +${COMPILE_PART1} kauth ${COMPILE_PART2}
254
255 libacl: cmd comerr ptserver libacl_depinstall
256         +${COMPILE_PART1} libacl ${COMPILE_PART2}
257
258 dir: cmd comerr libacl dir_depinstall
259         +${COMPILE_PART1} dir ${COMPILE_PART2}
260
261 # Removed from sgi_* case below:
262 # ${COMPILE_PART1} sgiefs ${COMPILE_PART2};;
263 sgiefs:
264         +case ${SYS_NAME} in \
265         sgi_*) \
266                 echo "SGI efs not supported" ;; \
267         *) \
268                 echo No efs stuff for ${SYS_NAME};; \
269         esac
270
271 vol: cmd comerr dir afs sgiefs $(DIR_roken)
272         +${COMPILE_PART1} vol ${COMPILE_PART2}
273
274 tsalvaged: vol libafsrpc libafsauthent cmd util
275         +case ${SYS_NAME} in \
276                 alpha_dux*|sgi_*|sun*_5*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*[fn]bsd*|*_darwin_*) \
277                         ${COMPILE_PART1} tsalvaged ${COMPILE_PART2} ;; \
278                 *_darwin_*) \
279                         ${COMPILE_PART1} tsalvaged  ${COMPILE_PART2} ;; \
280                 *) \
281                         echo Not building MT tsalvaged for ${SYS_NAME} ;; \
282         esac
283
284
285 vlserver: cmd comerr vol audit vlserver_depinstall
286         +${COMPILE_PART1} vlserver ${COMPILE_PART2}
287
288 tvlserver: cmd comerr vol audit tubik libafsrpc libafsauthent tvlserver_depinstall
289         +case ${SYS_NAME} in \
290         alpha_dux*|sgi_*|sun*_5*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*[nof]bsd*|*_darwin_*) \
291                 ${COMPILE_PART1} tvlserver ${COMPILE_PART2} ;; \
292         *) \
293                 echo Not building MT tvlserver for ${SYS_NAME} ;; \
294         esac
295
296
297 viced: cmd comerr vlserver tvlserver libafsrpc libafsauthent audit
298         +${COMPILE_PART1} viced ${COMPILE_PART2}
299
300 dviced: cmd comerr viced vlserver tvlserver libafsrpc libafsauthent
301         +case ${SYS_NAME} in \
302         alpha_dux*|sgi_*|sun*_5*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*[nof]bsd*|*_darwin_*) \
303                 ${COMPILE_PART1} dviced ${COMPILE_PART2} ;; \
304         *) \
305                 echo Not building DAFS viced for ${SYS_NAME} ;; \
306         esac
307
308 volser: cmd comerr usd kauth vlserver audit
309         +${COMPILE_PART1} volser ${COMPILE_PART2}
310
311 tvolser: project viced usd libafsrpc libafsauthent volser
312         +@case ${SYS_NAME} in                                           \
313         *_darwin_*|alpha_dux*|sgi_*|sun*_5*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*[no]bsd*)   \
314                 ${COMPILE_PART1} tvolser ${COMPILE_PART2} ;;            \
315         *)                                                              \
316                 echo Not building MT volser for ${SYS_NAME} ;;          \
317         esac
318
319 dvolser: project viced usd libafsrpc libafsauthent volser
320         +@case ${SYS_NAME} in                                           \
321         *_darwin_*|alpha_dux*|sgi_*|sun*_5*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*[no]bsd*)   \
322                 ${COMPILE_PART1} dvolser ${COMPILE_PART2} ;;            \
323         *)                                                              \
324                 echo Not building DAFS volser for ${SYS_NAME} ;;          \
325         esac
326
327 rxosdsrc: rxgen
328         +${COMPILE_PART1} rxosd ${COMPILE_PART2A} source
329
330 venus: cmd comerr volser ptserver libafscp libafsauthent
331         +${COMPILE_PART1} venus ${COMPILE_PART2}
332         +${COMPILE_PART1} venus/test ${COMPILE_PART2}
333
334 afsd: cmd comerr sys kauth libafsauthent @CLIENT_UAFS_DEP@
335         +${COMPILE_PART1} afsd ${COMPILE_PART2}
336
337 gtx: cmd comerr auth kauth
338         +set -x; \
339         if test "@LIB_curses@"; then \
340                 ${COMPILE_PART1} gtx ${COMPILE_PART2} ; \
341         else \
342                 echo Not building gtx, because no curses-headers found. ; \
343         fi
344
345 fsprobe: cmd comerr util fsint volser
346         +${COMPILE_PART1} fsprobe ${COMPILE_PART2}
347
348 scout: cmd comerr gtx fsprobe
349         +if test "@LIB_curses@"; then \
350                 ${COMPILE_PART1} scout ${COMPILE_PART2} ; \
351         else \
352                 echo Not building scout, because no curses-headers found. ; \
353         fi
354
355 uss: hcrypto kauth cmd comerr rx vlserver vol volser
356         +if test "@BUILD_USS@" = "yes"; then \
357                 ${COMPILE_PART1} uss ${COMPILE_PART2} ; \
358         else \
359                 echo Not building uss. ; \
360         fi
361
362 bozo: cmd comerr audit auth kauth volser
363         +${COMPILE_PART1} bozo ${COMPILE_PART2}
364
365 vfsck:  vol
366         +set -x; \
367         case ${SYS_NAME} in \
368         sgi_* | *linux* | rs_aix* | *_darwin* | ia64_hpux* | *fbsd* | *_obsd* | *_nbsd* ) \
369                 echo skip vfsck for ${SYS_NAME} ;; \
370          * ) \
371                 ${COMPILE_PART1} vfsck ${COMPILE_PART2} ;; \
372         esac
373
374 pam: auth libafsauthent
375         +set -x; \
376         if test "@HAVE_PAM@" = "yes"; then \
377                 ${COMPILE_PART1} pam ${COMPILE_PART2} ; \
378         else \
379                 echo Skipping pam for ${SYS_NAME} ; \
380         fi
381
382 tsm41: cmd comerr kauth rxkad
383         +set -x; \
384         case ${SYS_NAME} in \
385         rs_aix* ) \
386                 ${COMPILE_PART1} tsm41 ${COMPILE_PART2} ;; \
387         * ) \
388                 echo Skipping tsm41 for ${SYS_NAME} ;; \
389         esac
390
391 sgistuff: cmd comerr kauth rxkad
392         +set -x; \
393         case ${SYS_NAME} in \
394         sgi_* ) \
395                 ${COMPILE_PART1} sgistuff ${COMPILE_PART2} ;; \
396         * ) \
397                 echo Skipping sgistuff for ${SYS_NAME} ;; \
398         esac
399
400 aklog: auth comerr ptserver libafsauthent
401         +set -x; \
402         if test "@BUILD_KRB5@" = "yes"; then \
403                 ${COMPILE_PART1} aklog ${COMPILE_PART2} ; \
404         else \
405                 echo Skipping aklog for ${SYS_NAME} ; \
406         fi
407
408 authtools: pam tsm41 sgistuff aklog
409
410 platform: config cmd vol
411         +${COMPILE_PART1} platform ${COMPILE_PART2}
412
413 tools: config audit volser vlserver
414         +${COMPILE_PART1} tools ${COMPILE_PART2}
415
416 man-pages: config
417         +if test -d "doc/man-pages" ; then \
418                 cd doc/man-pages ${COMPILE_PART2} ; \
419         fi
420
421 #
422 # _depinstall targets - only build and install headers/sources that are needed by libafs/libuafs
423 #
424 # encode dependencies within the _depinstall targets as required
425 #
426 lwp_depinstall: config
427         +${COMPILE_PART1} lwp ${COMPILE_DEPINSTALL}
428
429 rx_depinstall: config
430         +${COMPILE_PART1} rx ${COMPILE_DEPINSTALL}
431
432 rxkad_depinstall: config comerr
433         +${COMPILE_PART1} rxkad ${COMPILE_DEPINSTALL}
434
435 ubik_depinstall: config comerr rxgen
436         +${COMPILE_PART1} ubik ${COMPILE_DEPINSTALL}
437
438 vlserver_depinstall: config rxgen ubik_depinstall auth_depinstall
439         +${COMPILE_PART1} vlserver ${COMPILE_DEPINSTALL}
440
441 tvlserver_depinstall: config rxgen ubik_depinstall auth_depinstall
442         +${COMPILE_PART1} tvlserver ${COMPILE_DEPINSTALL}
443
444 auth_depinstall: config rxgen comerr
445         +${COMPILE_PART1} auth ${COMPILE_DEPINSTALL}
446
447 fsint_depinstall: config rxgen
448         +${COMPILE_PART1} fsint ${COMPILE_DEPINSTALL}
449
450 rxstat_depinstall: config rxgen
451         +${COMPILE_PART1} rxstat ${COMPILE_DEPINSTALL}
452
453 libacl_depinstall: config
454         +${COMPILE_PART1} libacl ${COMPILE_DEPINSTALL}
455
456 afs_depinstall: config comerr
457         +${COMPILE_PART1} afs ${COMPILE_DEPINSTALL}
458
459 dir_depinstall: config
460         +${COMPILE_PART1} dir ${COMPILE_DEPINSTALL}
461
462 sys_depinstall: config rxgen
463         +${COMPILE_PART1} sys ${COMPILE_DEPINSTALL}
464
465 kauth_depinstall: config rxgen comerr
466         +${COMPILE_PART1} kauth ${COMPILE_DEPINSTALL}
467
468 ptserver_depinstall: config rxgen comerr
469         +${COMPILE_PART1} ptserver ${COMPILE_DEPINSTALL}
470
471 ${DEST}/bin/dedebug: dedebug
472         ${INSTALL} $? $@
473
474
475 #
476 # libafs build targets
477 #
478 libafs: config export rfc3961 hcrypto lwp_depinstall \
479         rx_depinstall vlserver_depinstall tvlserver_depinstall \
480         rxkad_depinstall fsint_depinstall \
481         libacl_depinstall afs_depinstall dir_depinstall \
482         rxstat_depinstall sys_depinstall auth_depinstall \
483         rxosdsrc
484         ${CONFIGTOOL} src/libafs/MakefileProto.${MKAFS_OSTYPE} src/libafs/Makefile ${SYS_NAME}
485         +${COMPILE_PART1} libafs ${COMPILE_PART2}
486
487 libafs_tree: export lwp_depinstall rx_depinstall vlserver_depinstall tvlserver_depinstall rxkad_depinstall fsint_depinstall \
488                 libacl_depinstall afs_depinstall dir_depinstall rxstat_depinstall sys_depinstall auth_depinstall
489         ${TOP_SRCDIR}/config/make_libafs_tree.pl \
490                 -sn $(SYS_NAME) \
491                 -os $(MKAFS_OSTYPE) \
492                 -t @TOP_OBJDIR@/libafs_tree \
493                 -o @TOP_OBJDIR@ \
494                 -p @srcdir@
495
496 #
497 # libuafs build targets
498 #
499
500 libuafs_setup: config export
501         ${CONFIGTOOL} src/libuafs/MakefileProto.${MKAFS_OSTYPE} src/libuafs/Makefile ${SYS_NAME}
502
503 libuafs: libuafs_setup vlserver_depinstall tvlserver_depinstall rx_depinstall fsint_depinstall \
504                 auth_depinstall dir_depinstall libacl_depinstall rxkad_depinstall \
505                 ubik_depinstall afs_depinstall kauth_depinstall ptserver_depinstall \
506                 rxstat_depinstall lwp_depinstall sys_depinstall cmd hcrypto
507         +set -x; \
508         case ${SYS_NAME} in \
509         hp_ux102* | *_obsd* | *_nbsd*| hp_ux11i | hp_ux112* | ia64_hpux112*) \
510                 echo Skipping libuafs for ${SYS_NAME} ;; \
511         * ) \
512                 ${COMPILE_PART1} libuafs ${COMPILE_PART2} ;; \
513         esac
514
515 afsweb: kauth
516         +${COMPILE_PART1} afsweb ${COMPILE_PART2}
517
518 update: cmd comerr auth sys
519         +${COMPILE_PART1} update ${COMPILE_PART2}
520
521 log: cmd comerr auth sys
522         +${COMPILE_PART1} log ${COMPILE_PART2}
523
524 bu_utils: cmd comerr usd
525         +${COMPILE_PART1} bu_utils ${COMPILE_PART2}
526
527 usd: cmd comerr
528         +${COMPILE_PART1} usd ${COMPILE_PART2}
529
530 bubasics: cmd comerr comerr rx
531         +${COMPILE_PART1} bubasics ${COMPILE_PART2}
532
533 butm: cmd comerr bubasics usd uss
534         +${COMPILE_PART1} butm ${COMPILE_PART2}
535
536 butc: cmd comerr bubasics butm budb bucoord cmd rxgen rx
537         +${COMPILE_PART1} butc ${COMPILE_PART2}
538
539 tbutc: cmd comerr bubasics butm budb bucoord cmd butc libadmin
540         +case ${SYS_NAME} in \
541         alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*_darwin_*) \
542                 ${COMPILE_PART1} tbutc ${COMPILE_PART2} ;; \
543         *) \
544                 echo Not building MT butc for ${SYS_NAME} ;; \
545         esac
546
547 budb: cmd comerr bubasics uss
548         +${COMPILE_PART1} budb ${COMPILE_PART2}
549
550 tbudb: budb tubik
551         +case ${SYS_NAME} in \
552         alpha_dux*|sgi_*|sun*_5*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*[nof]bsd*|*_darwin_*) \
553                 ${COMPILE_PART1} tbudb ${COMPILE_PART2} ;; \
554         *) \
555                 echo Not building MT budb for ${SYS_NAME} ;; \
556         esac
557
558 bucoord: cmd comerr bubasics budb volser butm
559         +${COMPILE_PART1} bucoord ${COMPILE_PART2}
560
561 xstat: cmd comerr fsint viced
562         +${COMPILE_PART1} xstat ${COMPILE_PART2}
563
564 afsmonitor: cmd comerr gtx xstat
565         +set -x; \
566         if test "@LIB_curses@"; then \
567                 ${COMPILE_PART1} afsmonitor ${COMPILE_PART2} ; \
568         else \
569                 echo Not building afsmonitor, because no curses-headers found. ; \
570         fi
571
572 tests: rxtests ubiktests rpctestlib viced
573
574 # pthread based user space RX library
575 libafsrpc: comerr fsint hcrypto lwp rx rxkad rxstat sys util
576         +case ${SYS_NAME} in \
577         alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*[nof]bsd*) \
578         ${COMPILE_PART1} libafsrpc ${COMPILE_PART2} ;; \
579         *_darwin_[1-6][0-9]) \
580                 echo Not building MT libafsrpc for ${SYS_NAME} ;; \
581         *_darwin_*) \
582                 ${COMPILE_PART1} libafsrpc  ${COMPILE_PART2} ;; \
583         *) \
584                 echo Not building MT libafsrpc for ${SYS_NAME} ;; \
585         esac
586
587 libafsauthent: audit auth kauth ubik util sys ptserver volser vlserver libafsrpc
588         +case ${SYS_NAME} in \
589         alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*[nof]bsd*) \
590         ${COMPILE_PART1} libafsauthent ${COMPILE_PART2} ;; \
591         *_darwin_[1-6][0-9]) \
592                 echo Not building MT libafsauthent for ${SYS_NAME} ;; \
593         *_darwin_*) \
594                 ${COMPILE_PART1} libafsauthent  ${COMPILE_PART2} ;; \
595         *) \
596                 echo Not building MT libafsauthent for ${SYS_NAME} ;; \
597         esac
598
599 kopenafs: config sys
600         +${COMPILE_PART1} kopenafs ${COMPILE_PART2}
601
602 libadmin_real: 
603         +${COMPILE_PART1} libadmin ${COMPILE_PART2}
604         +${COMPILE_PART1} libadmin/adminutil ${COMPILE_PART2}
605         +${COMPILE_PART1} libadmin/vos ${COMPILE_PART2}
606         +${COMPILE_PART1} libadmin/client ${COMPILE_PART2}
607         +${COMPILE_PART1} libadmin/kas ${COMPILE_PART2}
608         +${COMPILE_PART1} libadmin/pts ${COMPILE_PART2}
609         +${COMPILE_PART1} libadmin/bos ${COMPILE_PART2}
610         +${COMPILE_PART1} libadmin/cfg ${COMPILE_PART2}
611         +${COMPILE_PART1} libadmin/test ${COMPILE_PART2}
612         +${COMPILE_PART1} libadmin/samples ${COMPILE_PART2}
613
614 libadmin: libafsauthent bozo
615         +case ${SYS_NAME} in \
616         alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \
617                         $(MAKE) libadmin_real ;; \
618         *_darwin_[1-6][0-9]) \
619                 echo Not building MT libadmin for ${SYS_NAME} ;; \
620         *_darwin_*) \
621                         $(MAKE) libadmin_real ;; \
622         *) \
623                 echo Not building MT libadmin for ${SYS_NAME} ;; \
624         esac
625
626 libjafs: libadmin
627         +case ${SYS_NAME} in \
628         alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110) \
629         ${COMPILE_PART1} JAVA/libjafs  ${COMPILE_PART2} ;; \
630         *) \
631                 echo Not building MT libjafs for ${SYS_NAME} ;; \
632         esac
633
634 libjafsadm: libjafs
635
636 jafs: libjafs
637
638 jafsadm: libjafsadm
639
640 build_tools: config comerr rxgen
641         +${COMPILE_PART1} util ${COMPILE_PART2A} buildtools_clean
642
643 finale: project cmd comerr afsd butc tbutc tbudb @ENABLE_KERNEL_MODULE@ libuafs audit kauth log \
644         ptserver tptserver scout bu_utils ubik uss bozo @VFSCK@ volser tvolser tsalvaged \
645         dviced dvolser libafscp\
646         venus update xstat afsmonitor rxdebug libafsrpc rfc3961 hcrypto \
647         libafsauthent libadmin man-pages \
648         tools platform kopenafs authtools $(DIR_roken)
649         +${COMPILE_PART1} finale ${COMPILE_PART2}
650
651 finale_nolibafs: project cmd comerr afsd butc tbutc tbudb libuafs audit kauth log \
652         ptserver tptserver scout bu_utils ubik tubik uss bozo @VFSCK@ volser tvolser tsalvaged \
653         dviced dvolser libafscp\
654         venus update xstat afsmonitor rxdebug libafsrpc rfc3961 hcrypto \
655         libafsauthent libadmin man-pages \
656         tools platform kopenafs authtools $(DIR_roken)
657         +${COMPILE_PART1} finale ${COMPILE_PART2}
658
659 rpctestlib: util fsint rx opr libafsrpc libafsauthent
660         +${TEST_PART1} rpctestlib  ${COMPILE_PART2}
661
662 check test: finale_nolibafs
663         cd tests && $(MAKE) check
664
665 # Use washtool to ensure MakefileProto is current and obj/libafs exists.
666
667 force:
668
669 TARGET=finale
670 build: force
671         $(MAKE) $(TARGET) DEST=$(DEST) COMPILE_PART2B=$(COMPILE_PART2B) DESTDIR=$(DESTDIR)
672
673 kupdate: updatekdir libafs_setup libuafs_setup
674
675 blibafs:
676         $(MAKE) libafs
677
678 blibuafs:
679         $(MAKE) libuafs
680
681 bwebafs: sys
682         $(MAKE) libuafs
683
684 clean:
685         $(MAKE) clean2
686
687 clean2:
688         -${COMPILE_PART1} config ${COMPILE_CLEAN}
689         -${COMPILE_PART1} procmgmt ${COMPILE_CLEAN}
690         -${COMPILE_PART1} util ${COMPILE_CLEAN}
691         -${COMPILE_PART1} opr ${COMPILE_CLEAN}
692         -${COMPILE_PART1} libafscp ${COMPILE_CLEAN}
693         -${COMPILE_PART1} audit ${COMPILE_CLEAN}
694         -${COMPILE_PART1} comerr ${COMPILE_CLEAN}
695         -${COMPILE_PART1} cmd ${COMPILE_CLEAN}
696         -${COMPILE_PART1} lwp ${COMPILE_CLEAN}
697         -${COMPILE_PART1} rxgen ${COMPILE_CLEAN}
698         -${COMPILE_PART1} rx ${COMPILE_CLEAN}
699         -${COMPILE_PART1} rxstat ${COMPILE_CLEAN}
700         -${COMPILE_PART1} fsint ${COMPILE_CLEAN}
701         -${COMPILE_PART1} export ${COMPILE_CLEAN}
702         -${COMPILE_PART1} afs ${COMPILE_CLEAN}
703         -${COMPILE_PART1} sys ${COMPILE_CLEAN}
704         -${COMPILE_PART1} rxkad ${COMPILE_CLEAN}
705         -${COMPILE_PART1} auth ${COMPILE_CLEAN}
706         -${COMPILE_PART1} ubik ${COMPILE_CLEAN}
707         -${COMPILE_PART1} tubik ${COMPILE_CLEAN}
708         -${COMPILE_PART1} ptserver ${COMPILE_CLEAN}
709         -${COMPILE_PART1} tptserver ${COMPILE_CLEAN}
710         -${COMPILE_PART1} kauth ${COMPILE_CLEAN}
711         -${COMPILE_PART1} libacl ${COMPILE_CLEAN}
712         -${COMPILE_PART1} dir ${COMPILE_CLEAN}
713         -${COMPILE_PART1} vol ${COMPILE_CLEAN}
714         -${COMPILE_PART1} vlserver ${COMPILE_CLEAN}
715         -${COMPILE_PART1} tvlserver ${COMPILE_CLEAN}
716         -${COMPILE_PART1} viced ${COMPILE_CLEAN}
717         -${COMPILE_PART1} dviced ${COMPILE_CLEAN}
718         -${COMPILE_PART1} volser ${COMPILE_CLEAN}
719         -${COMPILE_PART1} tvolser ${COMPILE_CLEAN}
720         -${COMPILE_PART1} dvolser ${COMPILE_CLEAN}
721         -${COMPILE_PART1} tsalvaged ${COMPILE_CLEAN}
722         -${COMPILE_PART1} venus ${COMPILE_CLEAN}
723         -${COMPILE_PART1} venus/test ${COMPILE_CLEAN}
724         -${COMPILE_PART1} afsd ${COMPILE_CLEAN}
725         -${COMPILE_PART1} gtx ${COMPILE_CLEAN}
726         -${COMPILE_PART1} fsprobe ${COMPILE_CLEAN}
727         -${COMPILE_PART1} scout ${COMPILE_CLEAN}
728         -${COMPILE_PART1} uss ${COMPILE_CLEAN}
729         -${COMPILE_PART1} bozo ${COMPILE_CLEAN}
730         -${COMPILE_PART1} vfsck ${COMPILE_CLEAN}
731         -${COMPILE_PART1} sgistuff ${COMPILE_CLEAN}
732         -${COMPILE_PART1} tsm41 ${COMPILE_CLEAN}
733         -${COMPILE_PART1} sia ${COMPILE_CLEAN}
734         -${COMPILE_PART1} aklog ${COMPILE_CLEAN}
735         -${COMPILE_PART1} pam ${COMPILE_CLEAN}
736         -${COMPILE_PART1} afsweb ${COMPILE_CLEAN}
737         -${COMPILE_PART1} update ${COMPILE_CLEAN}
738         -${COMPILE_PART1} log ${COMPILE_CLEAN}
739         -${COMPILE_PART1} bu_utils ${COMPILE_CLEAN}
740         -${COMPILE_PART1} usd ${COMPILE_CLEAN}
741         -${COMPILE_PART1} bubasics ${COMPILE_CLEAN}
742         -${COMPILE_PART1} butm ${COMPILE_CLEAN}
743         -${COMPILE_PART1} butc ${COMPILE_CLEAN}
744         -${COMPILE_PART1} tbutc ${COMPILE_CLEAN}
745         -${COMPILE_PART1} budb ${COMPILE_CLEAN}
746         -${COMPILE_PART1} tbudb ${COMPILE_CLEAN}
747         -${COMPILE_PART1} bucoord ${COMPILE_CLEAN}
748         -${COMPILE_PART1} xstat ${COMPILE_CLEAN}
749         -${COMPILE_PART1} afsmonitor ${COMPILE_CLEAN}
750         -${COMPILE_PART1} rxdebug ${COMPILE_CLEAN}
751         -${COMPILE_PART1} libafsrpc ${COMPILE_CLEAN}
752         -${COMPILE_PART1} libafsauthent ${COMPILE_CLEAN}
753         -${COMPILE_PART1} kopenafs ${COMPILE_CLEAN}
754         -${COMPILE_PART1} tools ${COMPILE_CLEAN}
755         -${COMPILE_PART1} platform ${COMPILE_CLEAN}
756         -${COMPILE_PART1} libadmin ${COMPILE_CLEAN}
757         -${COMPILE_PART1} libadmin/adminutil ${COMPILE_CLEAN}
758         -${COMPILE_PART1} libadmin/client ${COMPILE_CLEAN}
759         -${COMPILE_PART1} libadmin/vos ${COMPILE_CLEAN}
760         -${COMPILE_PART1} libadmin/kas ${COMPILE_CLEAN}
761         -${COMPILE_PART1} libadmin/pts ${COMPILE_CLEAN}
762         -${COMPILE_PART1} libadmin/bos ${COMPILE_CLEAN}
763         -${COMPILE_PART1} libadmin/cfg ${COMPILE_CLEAN}
764         -${COMPILE_PART1} libadmin/test ${COMPILE_CLEAN}
765         -${COMPILE_PART1} libadmin/samples ${COMPILE_CLEAN}
766         -${COMPILE_PART1} JAVA/libjafs ${COMPILE_CLEAN}
767         -${COMPILE_PART1} finale ${COMPILE_CLEAN}
768         -${COMPILE_PART1} libafs ${COMPILE_CLEAN}
769         -${COMPILE_PART1} libuafs ${COMPILE_CLEAN}
770         -${COMPILE_PART1} rxosd ${COMPILE_CLEAN}
771         -${COMPILE_PART1} tests ${COMPILE_CLEAN}
772         -${COMPILE_PART1} crypto/hcrypto ${COMPILE_CLEAN}
773         -${COMPILE_PART1} roken ${COMPILE_CLEAN}
774         -${COMPILE_PART1} crypto/rfc3961 ${COMPILE_CLEAN}
775         -(cd src; /bin/rm cscope.out)
776         -(cd src/libafs; /bin/rm -rf afs afsint config rx)
777         -(cd src/libuafs; /bin/rm -rf afs afsint config rx)
778         -/bin/rm -rf ${TOP_INCDIR} ${TOP_LIBDIR} ${TOP_JLIBDIR}
779         -/bin/rm -rf libafs_tree ${SYS_NAME}
780
781 dist:
782         mkdir -p packages
783         ./build-tools/make-release --dir=packages HEAD
784
785 srpm:
786         (cd packages && ../src/packaging/RedHat/makesrpm.pl *-src.tar.bz2 *-doc.tar.bz2)
787
788 distclean: clean
789         /bin/rm -rf lib include packages
790         /bin/rm -f config.log config.cache config.status \
791         src/config/afsconfig.h src/config/stamp-h1 \
792         src/libafs/Makefile \
793         src/libuafs/Makefile \
794         Makefile \
795         src/afs/Makefile \
796         src/afsd/Makefile \
797         src/afsmonitor/Makefile \
798         src/afsweb/Makefile \
799         src/aklog/Makefile \
800         src/audit/Makefile \
801         src/auth/Makefile \
802         src/auth/test/Makefile \
803         src/bozo/Makefile \
804         src/bozo/test/Makefile \
805         src/bu_utils/Makefile \
806         src/bubasics/Makefile \
807         src/bucoord/Makefile \
808         src/budb/Makefile \
809         src/tbudb/Makefile \
810         src/butc/Makefile \
811         src/butm/Makefile \
812         src/cmd/Makefile \
813         src/cmd/test/Makefile \
814         src/comerr/Makefile \
815         src/comerr/test/Makefile \
816         src/config/Makefile \
817         src/config/Makefile.config \
818         src/config/Makefile.libtool \
819         src/config/Makefile.lwp \
820         src/config/Makefile.lwptool \
821         src/config/Makefile.pthread \
822         src/config/Makefile.shared \
823         src/config/Makefile.version \
824         src/config/Makefile.version-CML \
825         src/config/Makefile.version-NOCML \
826         src/config/shlib-build \
827         src/config/shlib-install \
828         src/crypto/hcrypto/Makefile \
829         src/crypto/rfc3961/Makefile \
830         src/dir/Makefile \
831         src/dir/test/Makefile \
832         src/dviced/Makefile \
833         src/dvolser/Makefile \
834         src/export/Makefile \
835         src/finale/Makefile \
836         src/fsint/Makefile \
837         src/fsprobe/Makefile \
838         src/gtx/Makefile \
839         src/JAVA/libjafs/Makefile \
840         src/kauth/Makefile \
841         src/kauth/test/Makefile \
842         src/kopenafs/Makefile \
843         src/libacl/Makefile \
844         src/libacl/test/Makefile \
845         src/libadmin/Makefile \
846         src/libadmin/adminutil/Makefile \
847         src/libadmin/bos/Makefile \
848         src/libadmin/cfg/Makefile \
849         src/libadmin/cfg/test/Makefile \
850         src/libadmin/client/Makefile \
851         src/libadmin/kas/Makefile \
852         src/libadmin/pts/Makefile \
853         src/libadmin/samples/Makefile \
854         src/libadmin/test/Makefile \
855         src/libadmin/vos/Makefile \
856         src/libafs/Makefile.common \
857         src/libafs/MakefileProto.${MKAFS_OSTYPE} \
858         ${DARWIN_PLIST} \
859         src/libafsauthent/Makefile \
860         src/libafsrpc/Makefile \
861         src/libuafs/Makefile.common \
862         src/libuafs/MakefileProto.${MKAFS_OSTYPE} \
863         src/log/Makefile \
864         src/log/test/Makefile \
865         src/lwp/Makefile \
866         src/lwp/test/Makefile \
867         src/opr/Makefile \
868         src/packaging/Debian/changelog \
869         src/packaging/MacOS/OpenAFS-debug.Description.plist \
870         src/packaging/MacOS/OpenAFS-debug.Info.plist \
871         src/packaging/MacOS/OpenAFS.Description.plist \
872         src/packaging/MacOS/OpenAFS.Info.plist \
873         src/packaging/MacOS/OpenAFS.info \
874         src/packaging/MacOS/buildpkg.sh \
875         src/packaging/RedHat/openafs.spec \
876         src/pam/Makefile \
877         src/platform/Makefile \
878         src/platform/${MKAFS_OSTYPE}/Makefile \
879         src/platform/DARWIN/growlagent/Makefile \
880         src/procmgmt/Makefile \
881         src/procmgmt/test/Makefile \
882         src/ptserver/Makefile \
883         src/tptserver/Makefile \
884         src/roken/Makefile \
885         src/rx/Makefile \
886         src/rx/bulk.example/Makefile \
887         src/rx/bulktest/Makefile \
888         src/rx/multi.example/Makefile \
889         src/rx/simple.example/Makefile \
890         src/rx/test/Makefile \
891         src/rxdebug/Makefile \
892         src/rxgen/Makefile \
893         src/rxkad/Makefile \
894         src/rxkad/test/Makefile \
895         src/rxosd/Makefile \
896         src/rxstat/Makefile \
897         src/scout/Makefile \
898         src/sgistuff/Makefile \
899         src/sys/Makefile \
900         src/tbutc/Makefile \
901         src/tests/Makefile \
902         src/tests/run-tests \
903         src/tests/auth/Makefile \
904         src/tools/Makefile \
905         src/tools/dumpscan/Makefile \
906         src/tools/rxperf/Makefile \
907         src/tsalvaged/Makefile \
908         src/tsm41/Makefile \
909         src/tvolser/Makefile \
910         src/ubik/Makefile \
911         src/tubik/Makefile \
912         src/update/Makefile \
913         src/usd/Makefile \
914         src/usd/test/Makefile \
915         src/uss/Makefile \
916         src/util/Makefile \
917         src/util/test/Makefile \
918         src/libafscp/Makefile \
919         src/venus/Makefile \
920         src/venus/test/Makefile \
921         src/vfsck/Makefile \
922         src/viced/Makefile \
923         src/vlserver/Makefile \
924         src/tvlserver/Makefile \
925         src/vol/Makefile \
926         src/vol/test/Makefile \
927         src/volser/Makefile \
928         src/xstat/Makefile  \
929         tests/Makefile \
930         tests/rpctestlib/Makefile \
931         tests/tap/Makefile \
932         tests/auth/Makefile \
933         tests/cmd/Makefile \
934         tests/common/Makefile \
935         tests/rx/Makefile \
936         tests/opr/Makefile \
937         tests/util/Makefile \
938         tests/volser/Makefile \
939         src/helper-splint.sh
940         if test -d doc/man-pages ; then \
941             rm -f doc/man-pages/Makefile doc/man-pages/install-man ; \
942         fi
943
944 pristine: distclean
945         /bin/rm -f src/config/afsconfig.h.in configure configure-libafs aclocal.m4
946
947 maintainer-clean: pristine