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