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