1 # Copyright 2000, International Business Machines Corporation and others.
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
11 INSTALL=${SRCDIR}bin/install
12 WASHTOOL=${SRCDIR}bin/washtool
14 #WASHTOOLRCSUPDATE=${WASHTOOL} rcsupdate
16 WASHTOOLFLAGS=-argument install
18 COMPILE_PART1=${WASHTOOL} ${WASHTOOLCMD}
19 COMPILE_PART2=${WASHTOOLFLAGS}
21 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
23 # Enable build+install of obsolete and insecure packages
24 # Set to anything other than YES, or comment out to disable the build
27 # To compile AFS from scratch in the src tree run "make SYS_NAME=<type>".
28 # This recursively calls "make install ..." and does not depend on the
29 # existence of any non-standard programs.
30 # To compile a package and all its predecessors using washtool run
31 # "make <package>". This requires that @sys works, and that washtool,
32 # rcsupdate and our version of ci and co exist.
33 # To compile for the kernel type "make blibafs". This assumes washtool,
34 # install, rxgen, compile_et and others already exist and runs it with
35 # "-argument kinstall".
38 set ${SYS_NAME}/dest; $(MKDIR_IF_NEEDED)
39 $(MAKE) install "COMPILE_PART1=cd obj; cd" "COMPILE_PART2=; $(MAKE) install SYS_NAME=${SYS_NAME} DESTDIR=`pwd`/${SYS_NAME}/dest/ SRCDIR=`pwd`/${SYS_NAME}/dest/" "COMPILE_PART3=; $(MAKE) test SYS_NAME=${SYS_NAME} DESTDIR=`pwd`/${SYS_NAME}/dest/ SRCDIR=`pwd`/${SYS_NAME}/dest/" SYS_NAME=${SYS_NAME} "WASHTOOL=echo No washtool: "
42 -if test -f "${WASHTOOL}"; \
44 ${WASHTOOL} project . . -noretarget; \
45 ${WASHTOOL} destdir; \
50 ${WASHTOOL} project . . -noretarget
53 project: basics cmd comerr minproject # try and initialize project
56 ${COMPILE_PART1} config ${COMPILE_PART2}
58 pinstall: basics config
59 ${COMPILE_PART1} pinstall ${COMPILE_PART2}
61 procmgmt: basics config pinstall
62 ${COMPILE_PART1} procmgmt ${COMPILE_PART2}
64 util: basics pinstall procmgmt
65 ${COMPILE_PART1} util ${COMPILE_PART2}
67 audit: basics pinstall rx rxkad fsint
68 ${COMPILE_PART1} audit ${COMPILE_PART2}
71 ${COMPILE_PART1} comerr ${COMPILE_PART2}
74 ${COMPILE_PART1} cmd ${COMPILE_PART2}
75 @case ${SYS_NAME} in \
76 sgi_6* | sun4x_57 | sun4x_58 | hp_ux11* | sparc64_linux* | alpha_linux* ) \
77 ${COMPILE_PART1} cmd ${COMPILE_PART2} install64 ;; \
81 ${COMPILE_PART1} lwp ${COMPILE_PART2}
83 rxgen: minproject pinstall
84 ${COMPILE_PART1} rxgen ${COMPILE_PART2}
90 ${COMPILE_PART1} rx ${COMPILE_PART2}
93 ${COMPILE_PART1} rx ${COMPILE_PART2}
96 ${COMPILE_PART1} rxstat ${COMPILE_PART2}
99 ${COMPILE_PART1} rx ${COMPILE_PART2}
102 ${COMPILE_PART1} rx ${COMPILE_PART3}
104 fsint: project kfsint
106 kfsint: rxgen rxincls lwp
107 ${COMPILE_PART1} fsint ${COMPILE_PART2}
109 export2: project fsint
111 export: minproject fsint
112 @case ${SYS_NAME} in \
114 ${COMPILE_PART1} export ${COMPILE_PART2} ;; \
115 * ) echo skipping export for ${SYS_NAME} ;; \
118 afs: minproject export
119 ${COMPILE_PART1} afs ${COMPILE_PART2}
121 des: minproject config
122 if [ -f "obj/des/Makefile" ] ; then \
123 ${COMPILE_PART1} des ${COMPILE_PART2} ; \
125 ${COMPILE_PART1} des_stub ${COMPILE_PART2} ; \
128 sys: project des rx rxstat fsint
129 ${COMPILE_PART1} sys ${COMPILE_PART2}
132 ${WASHTOOL} object rxkad
133 ${WASHTOOL} object rxkad/domestic
134 ${COMPILE_PART1} rxkad ${COMPILE_PART2}
137 ${COMPILE_PART1} auth ${COMPILE_PART2}
139 auth: project comerr des lwp rx sys rxkad audit
140 ${COMPILE_PART1} auth ${COMPILE_PART2}
143 ${COMPILE_PART1} ubik ${COMPILE_PART2}
145 # cd obj/ubik; $(MAKE) test SYS_NAME=${SYS_NAME}
147 ${COMPILE_PART1} ubik ${COMPILE_PART3}
149 ptserver: project ubik cmd comerr auth audit
150 ${COMPILE_PART1} ptserver ${COMPILE_PART2}
152 kauth: project ubik cmd auth comerr ptserver audit libacl
153 ${COMPILE_PART1} kauth ${COMPILE_PART2}
155 dauth: project ubik cmd auth comerr
156 ${COMPILE_PART1} dauth ${COMPILE_PART2}
158 libacl: project ptserver
159 ${COMPILE_PART1} libacl ${COMPILE_PART2}
162 ${COMPILE_PART1} dir ${COMPILE_PART2}
165 ${COMPILE_PART1} dir ${COMPILE_PART2}
167 # Removed from sgi_* case below:
168 # ${COMPILE_PART1} sgiefs ${COMPILE_PART2};;
170 case ${SYS_NAME} in \
172 echo "SGI efs not supported" ;; \
174 echo No efs stuff for ${SYS_NAME};; \
177 vol: project dir afs sgiefs
178 ${COMPILE_PART1} vol ${COMPILE_PART2}
180 vlserver: project vol audit
181 ${COMPILE_PART1} vlserver ${COMPILE_PART2}
183 viced: project vlserver audit
184 ${COMPILE_PART1} viced ${COMPILE_PART2}
186 tviced: project viced vlserver libafsrpc libafsauthent
187 case ${SYS_NAME} in \
188 alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110) \
189 ${COMPILE_PART1} tviced ${COMPILE_PART2} ;; \
191 echo Not building MT viced for ${SYS_NAME} ;; \
194 volser: project tviced usd kauth audit
195 ${COMPILE_PART1} volser ${COMPILE_PART2}
197 venus: project volser ptserver
198 ${COMPILE_PART1} venus ${COMPILE_PART2}
199 ${COMPILE_PART1} venus/test ${COMPILE_PART2}
201 afsd: project sys kauth
202 ${COMPILE_PART1} afsd ${COMPILE_PART2}
205 ${COMPILE_PART1} null ${COMPILE_PART2}
207 gtx: project null auth # kauth rxkad ?
208 case ${SYS_NAME} in \
209 rs_aix* | sun4x_5? | sgi_6? | *linux* | ppc_darwin* | *fbsd*) \
210 rm -f ${DESTDIR}lib/afs/libtermlib.a; \
211 ln -s libnull.a ${DESTDIR}lib/afs/libtermlib.a; \
212 ${COMPILE_PART1} gtx ${COMPILE_PART2};; \
214 rm -f ${DESTDIR}lib/afs/libtermlib.a; \
215 ln -s /usr/lib/libtermlib.a ${DESTDIR}lib/afs/libtermlib.a; \
216 ${COMPILE_PART1} gtx ${COMPILE_PART2};; \
219 fsprobe: project util fsint
220 ${COMPILE_PART1} fsprobe ${COMPILE_PART2}
222 scout: project gtx fsprobe
223 ${COMPILE_PART1} scout ${COMPILE_PART2}
225 uss: des kauth project rx vlserver vol
226 ${COMPILE_PART1} uss ${COMPILE_PART2}
228 bozo: project ntp audit
229 ${COMPILE_PART1} bozo ${COMPILE_PART2}
232 # Removed from respective case statements below:
233 # ${COMPILE_PART1} vfsckaix42 ${COMPILE_PART2} ;;
234 # ${COMPILE_PART1} vfscksol25 ${COMPILE_PART2} ;;
235 # ${COMPILE_PART1} vfscksol26 ${COMPILE_PART2} ;;
236 # ${COMPILE_PART1} vfscksol27 ${COMPILE_PART2} ;;
237 vfsck: minproject vol
239 case ${SYS_NAME} in \
240 sgi_* | *linux* | rs_aix42 | ppc_darwin* | hp_ux* | *fbsd* ) \
241 echo skip vfsck for ${SYS_NAME} ;; \
243 ${COMPILE_PART1} vfsck ${COMPILE_PART2} ;; \
246 login: project kauth rxkad
248 case ${SYS_NAME} in \
250 ${COMPILE_PART1} sgistuff ${COMPILE_PART2} ;; \
252 ${WASHTOOL} object login ; \
253 ${COMPILE_PART1} tsm41 ${COMPILE_PART2} ;; \
255 ${COMPILE_PART1} sia ${COMPILE_PART2} ;; \
257 ${COMPILE_PART1} login ${COMPILE_PART2} ;; \
258 sun4x_* | hp_ux11* | *linux* | *fbsd* ) \
259 ${COMPILE_PART1} pam ${COMPILE_PART2} ;; \
261 echo Skipping login for ${SYS_NAME} ;; \
263 ${COMPILE_PART1} login ${COMPILE_PART2} ;; \
295 libafs: minproject libafs_setup ${KERNELDIR}
296 ${COMPILE_PART1} libafs ${COMPILE_PART2}
298 libuafs: minproject libuafs_setup ${UKERNELDIR}
300 case ${SYS_NAME} in \
302 echo Skipping libuafs for ${SYS_NAME} ;; \
304 ${COMPILE_PART1} libuafs ${COMPILE_PART2} ;; \
307 afsweb: minproject kauth dauth
308 ${COMPILE_PART1} afsweb ${COMPILE_PART2}
311 ${COMPILE_PART1} update ${COMPILE_PART2}
314 ${COMPILE_PART1} log ${COMPILE_PART2}
317 ${COMPILE_PART1} bu_utils ${COMPILE_PART2}
320 ${COMPILE_PART1} usd ${COMPILE_PART2}
322 bubasics: project comerr
323 ${COMPILE_PART1} bubasics ${COMPILE_PART2}
325 butm: project bubasics usd
326 ${COMPILE_PART1} butm ${COMPILE_PART2}
328 butc: project bubasics butm budb bucoord cmd
329 ${COMPILE_PART1} butc ${COMPILE_PART2}
331 tbutc: project bubasics butm budb bucoord cmd butc
332 case ${SYS_NAME} in \
333 alpha_dux*|sgi_*|sun4x_*|rs_aix4*|*linux*|hp_ux110) \
334 ${COMPILE_PART1} tbutc ${COMPILE_PART2} ;; \
336 echo Not building MT butc for ${SYS_NAME} ;; \
339 budb: project bubasics
340 ${COMPILE_PART1} budb ${COMPILE_PART2}
342 bucoord: project bubasics budb volser
343 ${COMPILE_PART1} bucoord ${COMPILE_PART2}
346 ${COMPILE_PART1} xstat ${COMPILE_PART2}
348 afsmonitor: project gtx xstat
349 ${COMPILE_PART1} afsmonitor ${COMPILE_PART2}
352 # Washtool internal targets
355 case ${SYS_NAME} in \
357 echo skip ircs for ${SYS_NAME} ;; \
359 ${COMPILE_PART1} ircs ${COMPILE_PART2} ;; \
363 case ${SYS_NAME} in \
365 echo skip wash for ${SYS_NAME} ;; \
367 ${COMPILE_PART1} wash ${COMPILE_PART2} ;; \
370 tests: rxtests ubiktests
372 # pthread based user space RX library
373 libafsrpc: rx rxkad des
374 case ${SYS_NAME} in \
375 alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110) \
376 ${COMPILE_PART1} libafsrpc ${COMPILE_PART2} ;; \
378 echo Not building MT libafsrpc for ${SYS_NAME} ;; \
381 libafsauthent: ubik auth kauth libafsrpc
382 case ${SYS_NAME} in \
383 alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110) \
384 ${COMPILE_PART1} libafsauthent ${COMPILE_PART2} ;; \
386 echo Not building MT libafsrpc for ${SYS_NAME} ;; \
390 ${COMPILE_PART1} libadmin ${COMPILE_PART2}
391 ${COMPILE_PART1} libadmin/adminutil ${COMPILE_PART2}
392 ${COMPILE_PART1} libadmin/vos ${COMPILE_PART2}
393 ${COMPILE_PART1} libadmin/client ${COMPILE_PART2}
394 ${COMPILE_PART1} libadmin/kas ${COMPILE_PART2}
395 ${COMPILE_PART1} libadmin/pts ${COMPILE_PART2}
396 ${COMPILE_PART1} libadmin/bos ${COMPILE_PART2}
397 ${COMPILE_PART1} libadmin/cfg ${COMPILE_PART2}
398 ${COMPILE_PART1} libadmin/test ${COMPILE_PART2}
399 ${COMPILE_PART1} libadmin/samples ${COMPILE_PART2}
401 libadmin: libafsauthent bozo
402 case ${SYS_NAME} in \
403 alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110) \
404 $(MAKE) libadmin_real SYS_NAME=$(SYS_NAME) \
405 WASHTOOL="$(WASHTOOL)" \
406 COMPILE_PART1="$(COMPILE_PART1)" \
407 COMPILE_PART2="$(COMPILE_PART2)" \
408 SRCDIR=$(SRCDIR) DESTDIR=$(DESTDIR) \
409 DBG_DEFS=$(DBG_DEFS) ;; \
411 echo Not building MT libadmin for ${SYS_NAME} ;; \
414 finale: project cmd comerr afsd allrcmds butc tbutc libafs libuafs audit kauth log package \
415 ptserver scout bu_utils ubik uss bozo vfsck volser \
416 venus update xstat afsmonitor dauth tests libafsrpc \
417 libafsauthent libadmin
418 ${COMPILE_PART1} finale ${COMPILE_PART2}
420 # Use washtool to ensure MakefileProto is current and obj/libafs exists.
422 libafs_setup: config minproject export
423 # How about if no RCSUPDATE exists?
424 # Well then you're going to lose. Or, if you insist, set
425 # WASHTOOLRCSUPDATE to be a no-op
426 # Warning: The next few lines are _extremely_ sensitive to spaces and tabs.
427 ${WASHTOOL} object libafs
428 case ${SYS_NAME} in \
432 MKAFS_OSTYPE=HPUX;; \
434 MKAFS_OSTYPE=LINUX;; \
436 MKAFS_OSTYPE=FBSD;; \
440 MKAFS_OSTYPE=IRIX;; \
442 MKAFS_OSTYPE=SOLARIS;; \
444 MKAFS_OSTYPE=DARWIN;; \
446 echo WARNING: No MakefileProto for sys ${SYS_NAME} ; \
448 obj/config/config src/libafs/MakefileProto.$$MKAFS_OSTYPE obj/libafs/Makefile ${SYS_NAME}
450 libuafs_setup: config minproject export
451 # How about if no RCSUPDATE exists?
452 # Well then you're going to lose. Or, if you insist, set
453 # WASHTOOLRCSUPDATE to be a no-op
454 ${WASHTOOL} object libuafs
455 case ${SYS_NAME} in \
457 MKAFS_OSTYPE=HPUX;; \
459 MKAFS_OSTYPE=LINUX;; \
461 MKAFS_OSTYPE=FBSD;; \
465 MKAFS_OSTYPE=SOLARIS;; \
469 MKAFS_OSTYPE=IRIX;; \
471 MKAFS_OSTYPE=DARWIN;; \
473 echo WARNING: No MakefileProto for sys ${SYS_NAME} ; \
475 obj/config/config src/libuafs/MakefileProto.$$MKAFS_OSTYPE obj/libuafs/Makefile ${SYS_NAME}
477 # "COMPILE_PART1=${COMPILE_PART1}" "COMPILE_PART2=${COMPILE_PART2}" SYS_NAME=${SYS_NAME} ;;
481 $(MAKE) $(TARGET) "SYS_NAME=${SYS_NAME}" "WASHTOOL=${WASHTOOL}" \
482 "COMPILE_PART1=${COMPILE_PART1}" \
483 "COMPILE_PART2=${COMPILE_PART2}" \
484 DESTDIR=`pwd`/${SYS_NAME}/dest/ \
485 SRCDIR=`pwd`/${SYS_NAME}/dest/ \
486 "DBG_DEFS=${DBG_DEFS}"
488 # sgi: "NON_SHARED=-non_shared"
490 # ${WASHTOOL} rcsupdate ${KERNELDIR} libafs
492 kupdate: updatekdir libafs_setup libuafs_setup
495 $(MAKE) libafs "WASHTOOL=${WASHTOOL}" "WASHTOOLFLAGS=-argument kinstall" SYS_NAME=${SYS_NAME} "CPUARCH=${CPUARCH}" "MPSP=${MPSP}" "DBG_DEFS=${DBG_DEFS}"
498 $(MAKE) libuafs "WASHTOOL=${WASHTOOL}" "WASHTOOLFLAGS=-argument ukinstall" SYS_NAME=${SYS_NAME} "CPUARCH=${CPUARCH}" "MPSP=${MPSP}" "DBG_DEFS=${DBG_DEFS}"
501 $(MAKE) libuafs "WASHTOOL=${WASHTOOL}" "WASHTOOLFLAGS=-argument webinstall" SYS_NAME=${SYS_NAME} "CPUARCH=${CPUARCH}" "MPSP=${MPSP}" "DBG_DEFS=${DBG_DEFS}"
504 ${WASHTOOL} every "cd obj/%s; $(MAKE) clean" -rootd obj
507 ${WASHTOOL} every -command \
508 'cd rcs/%s; echo ; echo In %s:; if test x = "x`/bin/ls RCS/*,v`"; then exit 0; else rlog -I RCS/*,v; fi'
511 echo "Remove the obj directory"
512 - /bin/rm -rf @sys/obj/* ;
513 - /bin/rm -rf @sys/dest/* ;
514 - /bin/mkdir @sys/obj ;
515 echo "Create the obj directories"
518 for file in `find [!NW]* -type d -print` ; do \
519 /bin/mkdir $${here}/obj/$${file} ; \
521 echo "Create the obj file links"
524 for file in `find [!NW]* -type f -print` ; do \
525 /bin/ln -s `pwd`/$${file} $${here}/obj/$${file} ; \
529 # Below targets are all deprecated, insecure, or obsolte,
530 # see README.OBSOLETE and README.INSECURE for more info
534 @case ${WITH_DEPRECATED} in \
535 YES) ${COMPILE_PART1} mpp ${COMPILE_PART2} ;; \
536 *) echo skipping deprecated target: mpp ;; \
540 @case ${WITH_DEPRECATED} in \
541 YES) ${COMPILE_PART1} package ${COMPILE_PART2} ;; \
542 *) echo skipping deprecated target: package ;; \
545 package.files: package
546 @case ${WITH_DEPRECATED} in \
547 YES) ${DESTDIR}/bin/makepkgfiles afs.dev ;; \
548 *) echo skipping deprecated target: package.files ;; \
552 @case ${WITH_DEPRECATED} in \
553 YES) case ${SYS_NAME} in \
554 sun4x_58 | *linux* | *fbsd* | ppc_darwin* ) echo skipping ntp for ${SYS_NAME} ;; \
555 * ) ${COMPILE_PART1} ntp ${COMPILE_PART2} ;; \
557 *) echo skipping deprecated target: ntp ;; \
560 sgistuff: project rlogind
561 @case ${WITH_DEPRECATED} in \
562 YES) case ${SYS_NAME} in \
563 sgi_* ) ${COMPILE_PART1} sgistuff ${COMPILE_PART2} ;; \
564 * ) echo skipping sgistuff for ${SYS_NAME} ;; \
566 *) echo skipping deprecated target: sgistuff ;; \
569 ftpd43+: project kauth rxkad
570 @case ${WITH_DEPRECATED} in \
571 YES) case ${SYS_NAME} in \
572 rs_aix* | sun4x_55 | *linux*) \
573 ${COMPILE_PART1} ftpd43+ ${COMPILE_PART2} ;; \
574 *) echo skip ftpd43+ for ${SYS_NAME} ;; \
576 *) echo skipping deprecated target: ftpd43+ ;; \
579 inetd: project kauth rxkad
580 @case ${WITH_DEPRECATED} in \
581 YES) ${COMPILE_PART1} inetd ${COMPILE_PART2} ;; \
582 *) echo skipping deprecated target: inetd ;; \
586 @case ${WITH_DEPRECATED} in \
587 YES) ${COMPILE_PART1} rsh ${COMPILE_PART2} ;; \
588 *) echo skipping deprecated target: rsh ;; \
591 rlogind: project rsh ftpd43+ login
592 @case ${WITH_DEPRECATED} in \
593 YES) case ${SYS_NAME} in \
594 rs_aix*) ${COMPILE_PART1} rlogind ${COMPILE_PART2} ;; \
595 *) echo skipping rlogind for ${SYS_NAME} ;; \
597 *) echo skipping deprecated target: rlogind ;; \
600 rcp: project rsh inetd
601 @case ${WITH_DEPRECATED} in \
602 YES) case ${SYS_NAME} in \
603 sgi_* ) echo skip rcp for ${SYS_NAME} ;; \
604 *) ${COMPILE_PART1} rcp ${COMPILE_PART2} ;; \
606 *) echo skipping deprecated target: rcp ;; \
609 allrcmds: project rcp rlogind