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
28 # To compile AFS from scratch in the src tree run "make SYS_NAME=<type>".
29 # This recursively calls "make install ..." and does not depend on the
30 # existence of any non-standard programs.
31 # To compile a package and all its predecessors using washtool run
32 # "make <package>". This requires that @sys works, and that washtool,
33 # rcsupdate and our version of ci and co exist.
34 # To compile for the kernel type "make blibafs". This assumes washtool,
35 # install, rxgen, compile_et and others already exist and runs it with
36 # "-argument kinstall".
39 set ${SYS_NAME}/dest; $(MKDIR_IF_NEEDED)
40 $(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/ TOP_SRCDIR=`pwd`/${SYS_NAME}/obj" "COMPILE_PART3=; $(MAKE) SYS_NAME=${SYS_NAME} DESTDIR=`pwd`/${SYS_NAME}/dest/ SRCDIR=`pwd`/${SYS_NAME}/dest/ TOP_SRCDIR=`pwd`/${SYS_NAME}/obj" SYS_NAME=${SYS_NAME} "WASHTOOL=echo No washtool: "
43 -if test -f "${WASHTOOL}"; \
45 ${WASHTOOL} project . . -noretarget; \
46 ${WASHTOOL} destdir; \
51 ${WASHTOOL} project . . -noretarget
54 project: basics cmd comerr minproject # try and initialize project
57 ${COMPILE_PART1} config ${COMPILE_PART2}
59 pinstall: basics config
60 ${COMPILE_PART1} pinstall ${COMPILE_PART2}
62 procmgmt: basics config pinstall
63 ${COMPILE_PART1} procmgmt ${COMPILE_PART2}
65 util: basics pinstall procmgmt
66 ${COMPILE_PART1} util ${COMPILE_PART2}
68 kernutil: basics pinstall
69 ${COMPILE_PART1} util ${COMPILE_PART3} kinstall
71 audit: basics pinstall rx rxkad fsint
72 ${COMPILE_PART1} audit ${COMPILE_PART2}
75 ${COMPILE_PART1} comerr ${COMPILE_PART2}
78 ${COMPILE_PART1} cmd ${COMPILE_PART2}
79 @case ${SYS_NAME} in \
80 sgi_6* | sun4x_57 | sun4x_58 | hp_ux11* | sparc64_linux* | alpha_linux* ) \
81 ${COMPILE_PART1} cmd ${COMPILE_PART2} install64 ;; \
85 ${COMPILE_PART1} lwp ${COMPILE_PART2}
87 rxgen: minproject pinstall
88 ${COMPILE_PART1} rxgen ${COMPILE_PART2}
94 ${COMPILE_PART1} rx ${COMPILE_PART2}
97 ${COMPILE_PART1} rx ${COMPILE_PART2}
100 ${COMPILE_PART1} rxstat ${COMPILE_PART2}
103 ${COMPILE_PART1} rxstat ${COMPILE_PART3} kinstall
106 ${COMPILE_PART1} rx ${COMPILE_PART3} kinstall
109 ${COMPILE_PART1} rx ${COMPILE_PART3} test
111 fsint: project kfsint
112 ${COMPILE_PART1} fsint ${COMPILE_PART2}
114 kfsint: rxgen rxincls
115 ${COMPILE_PART1} fsint ${COMPILE_PART3} kinstall
117 export2: project fsint
119 export: minproject kfsint
120 @case ${SYS_NAME} in \
122 ${COMPILE_PART1} export ${COMPILE_PART2} ;; \
123 * ) echo skipping export for ${SYS_NAME} ;; \
127 ${COMPILE_PART1} afs ${COMPILE_PART2}
129 des: minproject config
130 if [ -f "obj/des/Makefile" ] ; then \
131 ${COMPILE_PART1} des ${COMPILE_PART2} ; \
133 ${COMPILE_PART1} des_stub ${COMPILE_PART2} ; \
136 sys: project des rx rxstat fsint
137 ${COMPILE_PART1} sys ${COMPILE_PART2}
140 ${WASHTOOL} object rxkad
141 ${WASHTOOL} object rxkad/domestic
142 ${COMPILE_PART1} rxkad ${COMPILE_PART2}
144 kernrxkad: minproject
145 ${WASHTOOL} object rxkad
146 ${WASHTOOL} object rxkad/domestic
147 ${COMPILE_PART1} rxkad ${COMPILE_PART3} kinstall
150 ${COMPILE_PART1} auth ${COMPILE_PART2}
152 auth: project comerr des lwp rx sys rxkad audit
153 ${COMPILE_PART1} auth ${COMPILE_PART2}
156 ${COMPILE_PART1} ubik ${COMPILE_PART2}
158 # cd obj/ubik; $(MAKE) test SYS_NAME=${SYS_NAME}
160 ${COMPILE_PART1} ubik ${COMPILE_PART3}
162 ptserver: project ubik cmd comerr auth audit
163 ${COMPILE_PART1} ptserver ${COMPILE_PART2}
165 kauth: project ubik cmd auth comerr ptserver audit libacl
166 ${COMPILE_PART1} kauth ${COMPILE_PART2}
168 dauth: project ubik cmd auth comerr
169 ${COMPILE_PART1} dauth ${COMPILE_PART2}
172 ${COMPILE_PART1} libacl ${COMPILE_PART3} kinstall
174 libacl: project ptserver
175 ${COMPILE_PART1} libacl ${COMPILE_PART2}
178 ${COMPILE_PART1} dir ${COMPILE_PART3} kinstall
181 ${COMPILE_PART1} dir ${COMPILE_PART2}
184 ${COMPILE_PART1} vol ${COMPILE_PART2}
186 vlserver: project vol audit
187 ${COMPILE_PART1} vlserver ${COMPILE_PART2}
189 kvlserver: minproject
190 ${COMPILE_PART1} vlserver ${COMPILE_PART3} kinstall
192 viced: project vlserver audit
193 ${COMPILE_PART1} viced ${COMPILE_PART2}
195 tviced: project viced vlserver libafsrpc libafsauthent
196 case ${SYS_NAME} in \
197 alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110) \
198 ${COMPILE_PART1} tviced ${COMPILE_PART2} ;; \
200 echo Not building MT viced for ${SYS_NAME} ;; \
203 volser: project tviced usd kauth audit
204 ${COMPILE_PART1} volser ${COMPILE_PART2}
206 venus: project volser ptserver
207 ${COMPILE_PART1} venus ${COMPILE_PART2}
208 ${COMPILE_PART1} venus/test ${COMPILE_PART2}
210 afsd: project sys kauth
211 ${COMPILE_PART1} afsd ${COMPILE_PART2}
214 ${COMPILE_PART1} null ${COMPILE_PART2}
216 gtx: project null auth # kauth rxkad ?
217 case ${SYS_NAME} in \
218 rs_aix* | sun4x_5? | sgi_6? | *linux* | ppc_darwin* | *fbsd*) \
219 rm -f ${DESTDIR}lib/afs/libtermlib.a; \
220 ln -s libnull.a ${DESTDIR}lib/afs/libtermlib.a; \
221 ${COMPILE_PART1} gtx ${COMPILE_PART2};; \
223 rm -f ${DESTDIR}lib/afs/libtermlib.a; \
224 ln -s /usr/lib/libtermlib.a ${DESTDIR}lib/afs/libtermlib.a; \
225 ${COMPILE_PART1} gtx ${COMPILE_PART2};; \
228 fsprobe: project util fsint
229 ${COMPILE_PART1} fsprobe ${COMPILE_PART2}
231 scout: project gtx fsprobe
232 ${COMPILE_PART1} scout ${COMPILE_PART2}
234 uss: des kauth project rx vlserver vol
235 ${COMPILE_PART1} uss ${COMPILE_PART2}
237 bozo: project ntp audit
238 ${COMPILE_PART1} bozo ${COMPILE_PART2}
241 # Removed from respective case statements below:
242 # ${COMPILE_PART1} vfsckaix42 ${COMPILE_PART2} ;;
243 # ${COMPILE_PART1} vfscksol25 ${COMPILE_PART2} ;;
244 # ${COMPILE_PART1} vfscksol26 ${COMPILE_PART2} ;;
245 # ${COMPILE_PART1} vfscksol27 ${COMPILE_PART2} ;;
246 vfsck: minproject vol
248 case ${SYS_NAME} in \
249 sgi_* | *linux* | rs_aix42 | ppc_darwin* | hp_ux* | *fbsd* ) \
250 echo skip vfsck for ${SYS_NAME} ;; \
252 ${COMPILE_PART1} vfsck ${COMPILE_PART2} ;; \
255 login: project kauth rxkad
257 case ${SYS_NAME} in \
259 ${COMPILE_PART1} sgistuff ${COMPILE_PART2} ;; \
261 ${WASHTOOL} object login ; \
262 ${COMPILE_PART1} tsm41 ${COMPILE_PART2} ;; \
264 ${COMPILE_PART1} sia ${COMPILE_PART2} ;; \
266 ${COMPILE_PART1} login ${COMPILE_PART2} ;; \
267 sun4x_* | hp_ux11* | *linux* | *fbsd* ) \
268 ${COMPILE_PART1} pam ${COMPILE_PART2} ;; \
270 echo Skipping login for ${SYS_NAME} ;; \
272 ${COMPILE_PART1} login ${COMPILE_PART2} ;; \
301 libafs: minproject libafs_setup ${KERNELDIR}
302 ${COMPILE_PART1} libafs ${COMPILE_PART2}
304 libuafs: minproject libuafs_setup ${UKERNELDIR}
306 case ${SYS_NAME} in \
308 echo Skipping libuafs for ${SYS_NAME} ;; \
310 ${COMPILE_PART1} libuafs ${COMPILE_PART2} ;; \
313 afsweb: minproject kauth dauth
314 ${COMPILE_PART1} afsweb ${COMPILE_PART2}
317 ${COMPILE_PART1} update ${COMPILE_PART2}
320 ${COMPILE_PART1} log ${COMPILE_PART2}
323 ${COMPILE_PART1} bu_utils ${COMPILE_PART2}
326 ${COMPILE_PART1} usd ${COMPILE_PART2}
328 bubasics: project comerr
329 ${COMPILE_PART1} bubasics ${COMPILE_PART2}
331 butm: project bubasics usd
332 ${COMPILE_PART1} butm ${COMPILE_PART2}
334 butc: project bubasics butm budb bucoord cmd
335 ${COMPILE_PART1} butc ${COMPILE_PART2}
337 tbutc: project bubasics butm budb bucoord cmd butc
338 case ${SYS_NAME} in \
339 alpha_dux*|sgi_*|sun4x_*|rs_aix4*|*linux*|hp_ux110) \
340 ${COMPILE_PART1} tbutc ${COMPILE_PART2} ;; \
342 echo Not building MT butc for ${SYS_NAME} ;; \
345 budb: project bubasics
346 ${COMPILE_PART1} budb ${COMPILE_PART2}
348 bucoord: project bubasics budb volser
349 ${COMPILE_PART1} bucoord ${COMPILE_PART2}
352 ${COMPILE_PART1} xstat ${COMPILE_PART2}
354 afsmonitor: project gtx xstat
355 ${COMPILE_PART1} afsmonitor ${COMPILE_PART2}
358 # Washtool internal targets
361 case ${SYS_NAME} in \
363 echo skip ircs for ${SYS_NAME} ;; \
365 ${COMPILE_PART1} ircs ${COMPILE_PART2} ;; \
369 case ${SYS_NAME} in \
371 echo skip wash for ${SYS_NAME} ;; \
373 ${COMPILE_PART1} wash ${COMPILE_PART2} ;; \
376 tests: rxtests ubiktests
378 # pthread based user space RX library
379 libafsrpc: rx rxkad des
380 case ${SYS_NAME} in \
381 alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110) \
382 ${COMPILE_PART1} libafsrpc ${COMPILE_PART2} ;; \
384 echo Not building MT libafsrpc for ${SYS_NAME} ;; \
387 libafsauthent: ubik auth kauth libafsrpc
388 case ${SYS_NAME} in \
389 alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110) \
390 ${COMPILE_PART1} libafsauthent ${COMPILE_PART2} ;; \
392 echo Not building MT libafsrpc for ${SYS_NAME} ;; \
396 ${COMPILE_PART1} libadmin ${COMPILE_PART2}
397 ${COMPILE_PART1} libadmin/adminutil ${COMPILE_PART2}
398 ${COMPILE_PART1} libadmin/vos ${COMPILE_PART2}
399 ${COMPILE_PART1} libadmin/client ${COMPILE_PART2}
400 ${COMPILE_PART1} libadmin/kas ${COMPILE_PART2}
401 ${COMPILE_PART1} libadmin/pts ${COMPILE_PART2}
402 ${COMPILE_PART1} libadmin/bos ${COMPILE_PART2}
403 ${COMPILE_PART1} libadmin/cfg ${COMPILE_PART2}
404 ${COMPILE_PART1} libadmin/test ${COMPILE_PART2}
405 ${COMPILE_PART1} libadmin/samples ${COMPILE_PART2}
407 libadmin: libafsauthent bozo
408 case ${SYS_NAME} in \
409 alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110) \
410 $(MAKE) libadmin_real SYS_NAME=$(SYS_NAME) \
411 WASHTOOL="$(WASHTOOL)" \
412 COMPILE_PART1="$(COMPILE_PART1)" \
413 COMPILE_PART2="$(COMPILE_PART2)" \
414 SRCDIR=$(SRCDIR) DESTDIR=$(DESTDIR) \
415 DBG_DEFS=$(DBG_DEFS) ;; \
417 echo Not building MT libadmin for ${SYS_NAME} ;; \
420 finale: project cmd comerr afsd allrcmds butc tbutc libafs libuafs audit kauth log package \
421 ptserver scout bu_utils ubik uss bozo vfsck volser \
422 venus update xstat afsmonitor dauth tests libafsrpc \
423 libafsauthent libadmin
424 ${COMPILE_PART1} finale ${COMPILE_PART2}
426 # Use washtool to ensure MakefileProto is current and obj/libafs exists.
428 libafs_setup: config minproject export
429 # How about if no RCSUPDATE exists?
430 # Well then you're going to lose. Or, if you insist, set
431 # WASHTOOLRCSUPDATE to be a no-op
432 # Warning: The next few lines are _extremely_ sensitive to spaces and tabs.
433 ${WASHTOOL} object libafs
434 case ${SYS_NAME} in \
438 MKAFS_OSTYPE=HPUX;; \
440 MKAFS_OSTYPE=LINUX;; \
442 MKAFS_OSTYPE=FBSD;; \
446 MKAFS_OSTYPE=IRIX;; \
448 MKAFS_OSTYPE=SOLARIS;; \
450 MKAFS_OSTYPE=DARWIN;; \
452 echo WARNING: No MakefileProto for sys ${SYS_NAME} ; \
454 obj/config/config src/libafs/MakefileProto.$$MKAFS_OSTYPE obj/libafs/Makefile ${SYS_NAME}
456 libuafs_setup: config minproject export
457 # How about if no RCSUPDATE exists?
458 # Well then you're going to lose. Or, if you insist, set
459 # WASHTOOLRCSUPDATE to be a no-op
460 ${WASHTOOL} object libuafs
461 case ${SYS_NAME} in \
463 MKAFS_OSTYPE=HPUX;; \
465 MKAFS_OSTYPE=LINUX;; \
467 MKAFS_OSTYPE=FBSD;; \
471 MKAFS_OSTYPE=SOLARIS;; \
475 MKAFS_OSTYPE=IRIX;; \
477 MKAFS_OSTYPE=DARWIN;; \
479 echo WARNING: No MakefileProto for sys ${SYS_NAME} ; \
481 obj/config/config src/libuafs/MakefileProto.$$MKAFS_OSTYPE obj/libuafs/Makefile ${SYS_NAME}
483 # "COMPILE_PART1=${COMPILE_PART1}" "COMPILE_PART2=${COMPILE_PART2}" SYS_NAME=${SYS_NAME} ;;
487 $(MAKE) $(TARGET) "SYS_NAME=${SYS_NAME}" "WASHTOOL=${WASHTOOL}" \
488 "COMPILE_PART1=${COMPILE_PART1}" \
489 "COMPILE_PART2=${COMPILE_PART2}" \
490 DESTDIR=`pwd`/${SYS_NAME}/dest/ \
491 SRCDIR=`pwd`/${SYS_NAME}/dest/ \
492 "DBG_DEFS=${DBG_DEFS}"
494 # sgi: "NON_SHARED=-non_shared"
496 # ${WASHTOOL} rcsupdate ${KERNELDIR} libafs
498 kupdate: updatekdir libafs_setup libuafs_setup
501 $(MAKE) libafs "WASHTOOL=${WASHTOOL}" "WASHTOOLFLAGS=-argument kinstall" SYS_NAME=${SYS_NAME} "CPUARCH=${CPUARCH}" "MPSP=${MPSP}" "DBG_DEFS=${DBG_DEFS}"
504 $(MAKE) libuafs "WASHTOOL=${WASHTOOL}" "WASHTOOLFLAGS=-argument ukinstall" SYS_NAME=${SYS_NAME} "CPUARCH=${CPUARCH}" "MPSP=${MPSP}" "DBG_DEFS=${DBG_DEFS}"
507 $(MAKE) libuafs "WASHTOOL=${WASHTOOL}" "WASHTOOLFLAGS=-argument webinstall" SYS_NAME=${SYS_NAME} "CPUARCH=${CPUARCH}" "MPSP=${MPSP}" "DBG_DEFS=${DBG_DEFS}"
510 ${WASHTOOL} every "cd obj/%s; $(MAKE) clean" -rootd obj
513 ${WASHTOOL} every -command \
514 'cd rcs/%s; echo ; echo In %s:; if test x = "x`/bin/ls RCS/*,v`"; then exit 0; else rlog -I RCS/*,v; fi'
517 echo "Remove the obj directory"
518 - /bin/rm -rf @sys/obj/* ;
519 - /bin/rm -rf @sys/dest/* ;
520 - /bin/mkdir @sys/obj ;
521 echo "Create the obj directories"
524 for file in `find [!NW]* -type d -print` ; do \
525 /bin/mkdir $${here}/obj/$${file} ; \
527 echo "Create the obj file links"
530 for file in `find [!NW]* -type f -print` ; do \
531 /bin/ln -s `pwd`/$${file} $${here}/obj/$${file} ; \
533 /bin/ln -s $${here}/obj/afsconfig.h.in $${here}/obj/config/afsconfig.h ;
535 # config.h link will eventually be replaced with generating the file
536 # directly from config.h.in via configure run. I'm linking instead of
537 # copying to ease development for now
540 # Below targets are all deprecated, insecure, or obsolte,
541 # see README.OBSOLETE and README.INSECURE for more info
545 @case ${WITH_OBSOLETE} in \
546 YES) ${COMPILE_PART1} mpp ${COMPILE_PART2} ;; \
547 *) echo skipping deprecated target: mpp ;; \
551 @case ${WITH_OBSOLETE} in \
552 YES) ${COMPILE_PART1} package ${COMPILE_PART2} ;; \
553 *) echo skipping deprecated target: package ;; \
556 package.files: package
557 @case ${WITH_OBSOLETE} in \
558 YES) ${DESTDIR}/bin/makepkgfiles afs.dev ;; \
559 *) echo skipping deprecated target: package.files ;; \
563 @case ${WITH_OBSOLETE} in \
564 YES) case ${SYS_NAME} in \
565 sun4x_58 | *linux* | *fbsd* | ppc_darwin* ) echo skipping ntp for ${SYS_NAME} ;; \
566 * ) ${COMPILE_PART1} ntp ${COMPILE_PART2} ;; \
568 *) echo skipping deprecated target: ntp ;; \
571 sgistuff: project rlogind
572 @case ${WITH_OBSOLETE} in \
573 YES) case ${SYS_NAME} in \
574 sgi_* ) ${COMPILE_PART1} sgistuff ${COMPILE_PART2} ;; \
575 * ) echo skipping sgistuff for ${SYS_NAME} ;; \
577 *) echo skipping deprecated target: sgistuff ;; \
580 ftpd43+: project kauth rxkad
581 @case ${WITH_INSECURE} in \
582 YES) case ${SYS_NAME} in \
583 rs_aix* | sun4x_55 | *linux*) \
584 ${COMPILE_PART1} ftpd43+ ${COMPILE_PART2} ;; \
585 *) echo skip ftpd43+ for ${SYS_NAME} ;; \
587 *) echo skipping deprecated target: ftpd43+ ;; \
590 inetd: project kauth rxkad
591 @case ${WITH_INSECURE} in \
592 YES) ${COMPILE_PART1} inetd ${COMPILE_PART2} ;; \
593 *) echo skipping deprecated target: inetd ;; \
597 @case ${WITH_INSECURE} in \
598 YES) ${COMPILE_PART1} rsh ${COMPILE_PART2} ;; \
599 *) echo skipping deprecated target: rsh ;; \
602 rlogind: project rsh ftpd43+ login
603 @case ${WITH_INSECURE} in \
604 YES) case ${SYS_NAME} in \
605 rs_aix*) ${COMPILE_PART1} rlogind ${COMPILE_PART2} ;; \
606 *) echo skipping rlogind for ${SYS_NAME} ;; \
608 *) echo skipping deprecated target: rlogind ;; \
611 rcp: project rsh inetd
612 @case ${WITH_INSECURE} in \
613 YES) case ${SYS_NAME} in \
614 sgi_* ) echo skip rcp for ${SYS_NAME} ;; \
615 *) ${COMPILE_PART1} rcp ${COMPILE_PART2} ;; \
617 *) echo skipping deprecated target: rcp ;; \
620 allrcmds: project rcp rlogind