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