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
8 # MakefileProto for IRIX systems
12 TOP_SRCDIR=@TOP_SRCDIR@
13 SYS_NAME=@AFS_SYSNAME@
15 include ../config/Makefile.${SYS_NAME}
17 # OS specific object files:
36 # System specific build commands and flags
47 # Turning off warnings regarding constant conditionals and not prototyped.
48 KDEFS=-D_K64U64 -D_KERNEL -DSTATIC=static -D_PAGESZ=16384 -D_MIPS3_ADDRSPACE \
49 -DTFP -non_shared -elf -xansi -64 -mips4 -TENV:kernel \
50 -TENV:misalignment=1 -OPT:space \
51 -D${CPUBOARD} -D${MPSP} -D${CPUARCH} -DAFS_SGIMP_ENV ${NODYNOPT} \
52 -jalr -woff 1209,1196,1496
54 # Turning off warnings regarding constant conditionals and not prototyped.
55 KDEFS_64BIT= -64 -D_K64U64 -D_PAGESZ=16384 -TENV:kernel -OPT:space \
57 R4000_LDFLAGS = -mips3 -64
58 R4000_KDEFS = -mips3 -DR4000_DADDIU_WAR -DFAST_LOCORE_TFAULT -DUSE_LGPAGES \
59 -DR4000 -DEVEREST -DBADVA_WAR -DMP_R4000_BADVA_WAR \
60 -DECC_RECOVER -DCLOCK_CTIME_IS_ABSOLUTE -D_SHAREII -D_HIBERNATORII \
61 -DPIOMEMOPS -DULI ${KDEFS_64BIT}
62 R8000_KDEFS = -mips4 -DTFP -DR8000 ${KDEFS_64BIT}
63 R8000_LDFLAGS = -mips4 -64
64 KDEFS= -I/usr/include -I/usr/include/sys -D_KERNEL -DSTATIC=static \
65 -D_MIPS3_ADDRSPACE -non_shared -elf -xansi \
67 -D${CPUBOARD} -D${MPSP} -DAFS_SGIMP_ENV ${NODYNOPT} \
68 -jalr -woff 1209,1196,1496
69 R10000_KDEFS = -mips4 -DR10000 -DEXPRESS -DIP28 -DI2_64 -DFAST_LOCORE_FAULT \
70 -DSCACHE_SET_ASSOC=2 -D_NO_UNCACHED_MEM_WAR -DMIPS4_ISA \
71 -DR10000_SPECULATION_WAR \
72 -OPT:quad_align_branch_targets=FALSE \
73 -OPT:quad_align_with_memops=FALSE -OPT:unroll_times=0 \
74 -DDEFAULTSEMAMETER=1 ${KDEFS_64BIT}
75 R10000_LDFLAGS = -mips4 -64
76 R4000_32_LDFLAGS = -mips2 -o32
77 R4000_32_KDEFS = -mips2 -o32 -elf -DEXPRESS -D_K32U64 -xansi\
78 -D_PAGESZ=4096 -D_KERNEL \
79 -DSTATIC=static -DBADVA_WAR -DJUMP_WAR -DPROBE_WAR -D_MEM_PARITY_WAR \
80 -D_TLB_LOOP_LIMIT -DTLBMOD_BADVADDR_WAR -D_VCE_AVOIDANCE \
81 -D_R4600_CACHEOP_WAR -D_R4600_2_0_CACHEOP_WAR -D_IRIX5_MIPS3 \
82 -D_IRIX5_MIPS4 -D_R5000_BADVADDR_WAR -D_R5000_JUMP_WAR -DMIPS4_ISA \
83 -DR4000 -DR4000PC -DR4600 -DR4600SC -DTRITON -DTRITON_INDYSC \
84 -Wc,-pic0 -fullwarn -non_shared -nostdinc -Wf,-XNp12000 \
85 -woff 1685,515,608,658,799,803,835,852,1048,1233,1499,1501 \
88 # Turning off warnings regarding constant conditionals and not prototyped.
89 # NOTE: Only for R5000 at the moment.
90 KDEFS= -I/usr/include -I/usr/include/sys -D_KERNEL -DSTATIC=static \
91 -non_shared -elf -xansi \
93 -D${CPUBOARD} -D${MPSP} -DAFS_SGIMP_ENV ${NODYNOPT} \
94 -jalr -woff 1209,1196,1496
95 R5000_LDFLAGS = -mips2 -o32
96 R5000_KDEFS = -DCRIME -DIP32 -DCRM -D_K32U64 -xansi -D_PAGESZ=4096 \
97 -D_KERNEL -DSTATIC=static -DPROBE_WAR -D_VCE_AVOIDANCE -DTILE_DATA \
98 -D_VCE_AVOIDANCE_DEBUG -D_R4600_CACHEOP_WAR -D_TLB_LOOP_LIMIT \
99 -D_R4600_2_0_CACHEOP_WAR -DP0_WAR -D_IRIX5_MIPS4 -D_IRIX5_MIPS3 \
100 -D_R5000_BADVADDR_WAR -DMIPS4_ISA -DSW_FAST_CACHE_SYNCH -DSWASH \
101 -D_R5000_CVT_WAR=1 -D_MTEXT_VFS -DR4000 -DR4000PC -DR4600 \
102 -DR4600SC -DTRITON -g -elf -mips2 -fullwarn -non_shared -nostdinc \
103 -mips2 -o32 -woff 1685,515,608,658,799,803,852,1048,1233,1499,1501 \
104 -Wf,-XNp12000 -DDEFAULTSEMAMETER=1
105 R10000_LDFLAGS = -mips2 -o32
106 R10000_KDEFS = -DCRIME -DIP32 -DCRM -D_K32U64 -xansi -D_K32U64 -D_PAGESZ=4096 \
107 -D_KERNEL -DSTATIC=static -D_VCE_AVOIDANCE -DTILE_DATA \
108 -DTLBMOD_BADVADDR_WAR -D_VCE_AVOIDANCE_DEBUG -D_TLB_LOOP_LIMIT \
109 -DP0_WAR -D_IRIX5_MIPS4 -D_IRIX5_MIPS3 -D_R5000_BADVADDR_WAR \
110 -DMIPS4_ISA -DSW_FAST_CACHE_SYNCH -DSWASH -DSCACHE_SET_ASSOC=2 \
111 -D_R5000_CVT_WAR=1 -D_MTEXT_VFS -DR10000_SPECULATION_WAR \
112 -DMH_R10000_SPECULATION_WAR -DSP -DIP32 -DR4000 -DR4000PC -DR4600 \
113 -DR4600SC -DTRITON -DR10000 -D_NO_R4000 -g -elf -mips2 -fullwarn \
114 -non_shared -nostdinc -mips2 -o32 \
115 -woff 1685,515,608,658,799,803,852,1048,1233,1499,1501 \
116 -Wf,-XNp12000 -DDEFAULTSEMAMETER=1
118 KDEFS= -I/usr/include -I/usr/include/sys -D_KERNEL -DSTATIC=static \
119 -non_shared -elf -xansi \
121 -D${CPUBOARD} -D${MPSP} -DAFS_SGIMP_ENV ${NODYNOPT} \
122 -jalr -woff 1209,1196,1496
123 R10000_LDFLAGS = -mips4 -64
124 R10000_KDEFS = -DKONA -DIP27 -DIP27 -DDISCONTIG_PHYSMEM -DNUMA_BASE -DNUMA_PM \
125 -DNUMA_TBORROW -DNUMA_MIGR_CONTROL -DNUMA_REPLICATION \
126 -DNUMA_REPL_CONTROL -DNUMA_SCHED -DLARGE_CPU_COUNT -DHUB2_NACK_WAR \
127 -DBRIDGE_ERROR_INTR_WAR -DMAPPED_KERNEL -DBHV_SYNCH -DHUB_ERR_STS_WAR \
128 -DHUB_MIGR_WAR -DNCR16C550 -DTL16PIR552 -DSN0_INTR_BROKEN -DFRU \
129 -DFORCE_ERRORS -DSN0_USE_BTE -DBTE_BZERO_WAR -DREV1_BRIDGE_SUPPORTED \
130 -DHUB_II_IFDR_WAR -xansi -DDISCONTIG_PHYSMEM -DNUMA_BASE -DNUMA_PM \
131 -DNUMA_TBORROW -DNUMA_MIGR_CONTROL -DNUMA_REPLICATION \
132 -DNUMA_REPL_CONTROL -DNUMA_SCHED -DLARGE_CPU_COUNT -DHUB2_NACK_WAR \
133 -DBRIDGE_ERROR_INTR_WAR -DMAPPED_KERNEL -DBHV_SYNCH \
134 -DHUB_ERR_STS_WAR -DHUB_MIGR_WAR -DNCR16C550 -DTL16PIR552 \
135 -DSN0_INTR_BROKEN -DFRU -DFORCE_ERRORS -DSN0_USE_BTE -DBTE_BZERO_WAR \
136 -DREV1_BRIDGE_SUPPORTED -DHUB_II_IFDR_WAR -D_PAGESZ=16384 -D_KERNEL \
137 -DSTATIC=static -D_MIPS3_ADDRSPACE -DSN0 -DMIPS4_ISA \
138 -DCLOCK_CTIME_IS_ABSOLUTE -DFAST_LOCORE_TFAULT -DULI -DCKPT \
139 -DIDLESTACK_FASTINT -DR10K_LLSC_WAR -DPTE_64BIT -DRMAPS \
140 -DPAGE_MIGRATION -DSW_FAST_CACHE_SYNCH -DINTR_KTHREADS \
141 -DMRSP_AS_MR -D_MP_NETLOCKS -DMP_STREAMS=1 -DIP27 -DR10000 \
142 -g -TENV:kernel -TENV:misalignment=1 -OPT:space \
143 -OPT:quad_align_branch_targets=FALSE \
144 -OPT:quad_align_with_memops=FALSE \
145 -OPT:unroll_times=0 -OPT:Olimit=5000 -TARG:processor=r10000 \
146 -FE:pointer_readonly -use_readonly_const -fullwarn \
147 -non_shared -mips4 -64 \
148 -woff 1685,515,608,658,799,803,852,1048,1233,1499,1501 \
151 # For Irix 6.5 we are building based on cpu board number rather than CPU number
152 # While -G 8 is recommended for space, we know that the table overflows when
153 # both AFS and DFS are compiled into the kernel. For Irix 6.5, define MP
154 # so we pick up locks.
155 KDEFS= -I/usr/include -I/usr/include/sys -DSTATIC=static -DAFS_SGIMP_ENV \
156 -DMP -D_KERNEL -DMP_STREAMS -D_MP_NETLOCKS -DMRSP_AS_MR \
157 -fullwarn -non_shared -G 0 \
158 -TENV:kernel -OPT:space -OPT:Olimit=0 -CG:unique_exit=on \
159 -TENV:X=1 -OPT:IEEE_arithmetic=1 -OPT:roundoff=0 \
160 -OPT:wrap_around_unsafe_opt=off \
161 ${CPU_KDEFS} -woff 1209,1196,1496
162 # 32 bit specific flags:
163 KDEFS_32 = -n32 -D_PAGESZ=4096 -mips3
164 # 64 bit specific flags:
165 KDEFS_64 = -64 -D_PAGESZ=16384 -D_MIPS3_ADDRSPACE -mips4
167 # CPU board specific flags:
168 IP19_KDEFS = -DIP19 -DEVEREST -DMP -DR4000 \
169 -mips3 -D_PAGESZ=16384 -D_MIPS3_ADDRSPACE -64
170 IP20_KDEFS = -DIP20 -DR4000 -DJUMP_WAR -DBADVA_WAR -DTRITON -DUSE_PCI_PIO \
172 IP21_KDEFS = -DIP21 -DEVEREST -DMP -DTFP -TARG:processor=r8000 $(KDEFS_64)
173 IP25_KDEFS = -DIP25 -DEVEREST -DMP -DR10000 -TARG:processor=r10000 $(KDEFS_64)
174 IP26_KDEFS = -DIP26 -DTFP -TARG:sync=off -TARG:processor=r8000 $(KDEFS_64)
175 IP27_KDEFS = -DIP27 -DR10000 -DMP -DSN -DSN0 -DMAPPED_KERNEL \
177 -DPTE_64BIT -DULI -DCKPT -DMIPS4_ISA -DR10K_LLSC_WAR -DNUMA_BASE \
178 -DNUMA_PM -DNUMA_TBORROW -DNUMA_MIGR_CONTROL -DNUMA_REPLICATION \
179 -DNUMA_REPL_CONTROL -DNUMA_SCHED -DCELL_PREPARE -DBHV_PREPARE \
180 -TARG:processor=r10000 $(KDEFS_64)
181 IP28_KDEFS = -DIP28 -DR10000 -DSCACHE_SET_ASSOC=2 -D_NO_UNCACHED_MEM_WAR \
182 -DR10000_SPECULATION_WAR -TARG:processor=r10000 \
183 -TARG:t5_no_spec_stores $(KDEFS_64)
184 IP30_KDEFS = -DIP30 -DR10000 -DMP -DCELL_PREPARE -DBHV_PREPARE \
185 -TARG:processor=r10000 $(KDEFS_64)
192 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
195 CFLAGS=-I. -I.. -I${TOP_SRCDIR}/config ${FSINCLUDES} $(DEFINES) -G 0 $(KDEFS) $(KOPTS) ${DBUG}
197 # This tells Makefile.common to use it's single directory build target.
198 #COMPDIRS = single_compdir
199 # This is the irix multiple directory target.
200 COMPDIRS = irix_compdirs
202 include Makefile.common
204 # Make all the directories, even if only building one.
206 PROCESSORS=R4000 R4000_32 R8000 R10000
208 PROCESSORS = R5000 R1000
212 PROCESSORS = IP19 IP20 IP21 IP25 IP26 IP27 IP28 IP30
215 KOBJ = STATIC MODLOAD
219 -rm -f h net netinet rpc ufs nfs machine sys
220 -ln -s /usr/include/sys h
221 -ln -s /usr/include/net /usr/include/netinet .
222 -ln -s /usr/include/rpc /usr/include/sys .
223 -ln -s /usr/include/sys/fs .
224 -mkdir ${DESTDIR}root.client/bin
226 BUILDPROCS="${PROCESSORS}" ; \
227 BUILDMPS="${MPS}" ; \
228 if [ "${CPUARCH}" != "" ] ; then \
229 BUILDPROCS=${CPUARCH}; \
232 for p in $${BUILDPROCS} ; do \
233 for n in $${BUILDMPS} ; do \
234 for t in ${KOBJ} ; do \
236 echo Making directory: $$dir; \
238 rm -f $$dir/Makefile.common $$dir/Makefile; \
239 ln -s ../Makefile.common $$dir/Makefile.common; \
240 ln -s ../Makefile $$dir/Makefile; \
245 BUILDPROCS="${PROCESSORS}" ; \
246 if [ "${IPNO}" != "" ] ; then \
247 BUILDPROCS="${IPNO}"; \
249 for p in $${BUILDPROCS} ; do \
250 for t in ${KOBJ} ; do \
252 echo Making directory: $$dir; \
254 rm -f $$dir/Makefile.common $$dir/Makefile; \
255 ln -s ../Makefile.common $$dir/Makefile.common; \
256 ln -s ../Makefile $$dir/Makefile; \
260 echo Setup compelete.
263 # Compile static and modload versions of the clients.
266 BUILDPROCS="${PROCESSORS}" ; \
267 if [ "${CPUARCH}" != "" ] ; then \
268 BUILDPROCS=${CPUARCH}; \
271 for p in $${BUILDPROCS} ; do \
272 for n in $${BUILDMPS} ; do \
273 for t in ${KOBJ} ; do \
275 echo Building directory: $$dir; \
279 CPU_KDEFS="${R4000_KDEFS}"; \
280 LDFLAGS="${R4000_LDFLAGS}";; \
283 CPU_KDEFS="${R4000_32_KDEFS}"; \
284 LDFLAGS="${R4000_32_LDFLAGS}";; \
287 CPU_KDEFS="${R5000_KDEFS}"; \
288 LDFLAGS="${R5000_LDFLAGS}";; \
291 CPU_KDEFS="${R8000_KDEFS}"; \
292 LDFLAGS="${R8000_LDFLAGS}";; \
300 <sgi_62 sgi_63 sgi_64>
301 CPU_KDEFS="${R10000_KDEFS}"; \
302 LDFLAGS="${R10000_LDFLAGS}";; \
303 *) echo "Unknown CPUARCH <$$p>" ; exit 1 ;; \
309 $(MAKE) CPUARCH=$$p MPSP=$$n $$t.libafs || exit $$?;\
316 BUILDPROCS="${PROCESSORS}" ; \
317 if [ "${IPNO}" != "" ] ; then \
318 BUILDPROCS="${IPNO}"; \
320 for p in $${BUILDPROCS} ; do \
321 for t in ${KOBJ} ; do \
323 echo Building directory: $$dir; \
324 LDFLAGS="${LDFLAGS_64}"; \
326 IP19) CPU_KDEFS="${IP19_KDEFS}";; \
327 IP20) CPU_KDEFS="${IP20_KDEFS}"; \
328 LDFLAGS="${LDFLAGS_32}";; \
329 IP21) CPU_KDEFS="${IP21_KDEFS}";; \
330 IP25) CPU_KDEFS="${IP25_KDEFS}";; \
331 IP26) CPU_KDEFS="${IP26_KDEFS}";; \
332 IP27) CPU_KDEFS="${IP27_KDEFS}";; \
333 IP28) CPU_KDEFS="${IP28_KDEFS}";; \
334 IP30) CPU_KDEFS="${IP30_KDEFS}";; \
335 *) echo Unknown IP number $$p ; exit 1 ;; \
338 MODLOAD) CPU_KDEFS="$${CPU_KDEFS} -TARG:force_jalr";; \
341 STATIC) echo X $${CPU_KDEFS} | sed 's/^X//' > $$dir/CPU_KDEFS;; \
346 $(MAKE) IPNO=$$p $$t.libafs || exit $$?; \
353 LIBAFSNONFSA = libafs.nonfs.a
354 COPYFILES = copyfiles
355 LINKFILES = linkfiles
357 STATICCLIENTDIR = ${DESTDIR}root.client/bin
358 MODLOADCLIENTDIR = ${DESTDIR}root.client/usr/vice/etc/sgiload
360 # Make the NFS and no-NFS clients for this directory.
361 # STATIC.libafs: ${LIBAFSNONFSA} ${COPYFILES} ${LINKFILES}
362 STATIC.libafs: ${LIBAFSNONFSA} ${COPYFILES} ${LINKFILES}
364 ${CP} ${LIBAFSNONFSA} \
365 ${STATICCLIENTDIR}/libafs.${MPSP}.${CPUARCH}.nonfs.a
367 ${CP} ${LIBAFSNONFSA} \
368 ${STATICCLIENTDIR}/libafs.${IPNO}.nonfs.a
371 ${LIBAFSNONFSA}: $(AFSAOBJS) $(AFSNONFSOBJS)
374 LIBAFSNONFSO = libaf.nonfs.o
376 # MODLOAD.libafs: ${LIBAFSNONFSO} ${COPYFILES} ${LINKFILES}
377 MODLOAD.libafs: ${LIBAFSNONFSO} ${COPYFILES} ${LINKFILES}
379 ${CP} ${LIBAFSNONFSO} \
380 ${MODLOADCLIENTDIR}/libafs.${MPSP}.${CPUARCH}.nonfs.o
382 ${CP} ${LIBAFSNONFSO} \
383 ${MODLOADCLIENTDIR}/libafs.${IPNO}.nonfs.o
386 ${LIBAFSNONFSO}: $(AFSAOBJS) $(AFSNONFSOBJS)
387 $(LD) ${LDFLAGS} -elf -r -d -G 0 -o ${LIBAFSNONFSO} \
388 $(AFSAOBJS) $(AFSNONFSOBJS)
391 ${CP} ../sgi_system ${STATICCLIENTDIR}/afs.sm
392 chmod 644 ${STATICCLIENTDIR}/afs.sm
393 ${CP} ../sgi_master ${STATICCLIENTDIR}/afs
394 chmod 644 ${STATICCLIENTDIR}/afs
396 # Create symlinks to clients we don't need to build.
397 # If this changes, also change the kdump symlinks.
400 ln -fs libafs.IP20.a ${DESTDIR}root.client/bin/libafs.IP22.a
401 ln -fs libafs.IP20.a ${DESTDIR}root.client/bin/libafs.IP32.a
402 ln -fs libafs.IP20.nonfs.a ${DESTDIR}root.client/bin/libafs.IP22.nonfs.a
403 ln -fs libafs.IP20.nonfs.a ${DESTDIR}root.client/bin/libafs.IP32.nonfs.a
404 ln -fs libafs.IP20.o ${DESTDIR}root.client/usr/vice/etc/sgiload/libafs.IP22.o
405 ln -fs libafs.IP20.o ${DESTDIR}root.client/usr/vice/etc/sgiload/libafs.IP32.o
406 ln -fs libafs.IP20.nonfs.o ${DESTDIR}root.client/usr/vice/etc/sgiload/libafs.IP22.nonfs.o
407 ln -fs libafs.IP20.nonfs.o ${DESTDIR}root.client/usr/vice/etc/sgiload/libafs.IP32.nonfs.o
412 # Object build rules:
414 afs_base64.o: $(AFS)/afs_base64.c
416 osi_groups.o: $(AFS)/osi_groups.c
418 osi_idbg.o: $(AFS)/osi_idbg.c
420 osi_inode.o: $(AFS)/osi_inode.c
422 osi_file.o: $(AFS)/osi_file.c
424 osi_misc.o: $(AFS)/osi_misc.c
426 osi_sleep.o: $(AFS)/osi_sleep.c
428 osi_vfsops_nfs.o: $(AFS)/osi_vfsops.c
429 $(CRULE1) -o osi_vfsops_nfs.o;
430 osi_vfsops.o: $(AFS)/osi_vfsops.c
431 $(CRULE1) -DAFS_NONFSTRANS;
432 osi_vm.o: $(AFS)/osi_vm.c
434 osi_vnodeops.o: $(AFS)/osi_vnodeops.c