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