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