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