Makefile.sparc64 revision 1.21
1# $NetBSD: Makefile.sparc64,v 1.21 2000/04/13 09:23:38 mrg Exp $ 2 3# Makefile for NetBSD 4# 5# This makefile is constructed from a machine description: 6# config machineid 7# Most changes should be made in the machine description 8# /sys/arch/sparc64/conf/``machineid'' 9# after which you should do 10# config machineid 11# Machine generic makefile changes should be made in 12# /sys/arch/sparc64/conf/Makefile.sparc64 13# after which config should be rerun for all machines of that type. 14# 15# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE 16# IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING 17# 18# -DTRACE compile in kernel tracing hooks 19# -DQUOTA compile in file system quotas 20 21# DEBUG is set to -g if debugging. 22# PROF is set to -pg if profiling. 23 24.include "/etc/mk.conf" 25 26CC?= cc 27.if exists(/usr/ccs/bin/ld) 28LD?= /usr/ccs/bin/ld #Need to use Solaris ld to use the solaris loader 29.endif 30MKDEP?= mkdep 31STRIP?=strip 32SIZE?= size 33COPTS?= -O2 34#### Stuff for cross compiling 35NM?=nm 36LORDER?=lorder 37TSORT?=tsort 38 39 40# deal with Solaris vs. NetBSD build environments for now .. 41OS!=uname -s 42.if (${OS} == "NetBSD") 43USE_GENASSYM?= no 44.else 45USE_GENASSYM?= no 46AWK=nawk 47.endif 48 49.if exists(/usr/ccs/bin/ld) 50SVR4=-U__SVR4 -U__svr4__ -D__NetBSD__ 51.else 52SVR4= 53.endif 54 55# source tree is located via $S relative to the compilation directory 56.ifndef S 57S!= cd ../../../..; pwd 58.endif 59SPARC64= $S/arch/sparc64 60 61INCLUDES= -I. -I$S/arch -I$S -nostdinc 62CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL ${SVR4} 63CWARNFLAGS= -Wimplicit -Wunused -Wswitch -Wcomment -Wtrigraphs -Wchar-subscripts -Wparentheses -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 64#CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes 65CFLAGS= ${DEBUG} ${CWARNFLAGS} -O2 -Wa,-Av9a -mno-fpu 66AFLAGS= -x assembler-with-cpp -Wa,-Av9a -traditional-cpp -D_LOCORE 67LINKFLAGS= -N -p -Ttext f1000000 -e start >lderr 68STRIPFLAGS= -g 69 70%INCLUDES 71 72### find out what to use for libkern 73# KERN_AS= obj # bcopy, bzero, memcpy, memset, etc. are in locore.s 74.include "$S/lib/libkern/Makefile.inc" 75.ifndef PROF 76LIBKERN= ${KERNLIB} 77.else 78LIBKERN= ${KERNLIB_PROF} 79.endif 80 81### find out what to use for libcompat 82.include "$S/compat/common/Makefile.inc" 83.ifndef PROF 84LIBCOMPAT= ${COMPATLIB} 85.else 86LIBCOMPAT= ${COMPATLIB_PROF} 87.endif 88 89# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or 90# HOSTED, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file). 91 92NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< 93NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< 94 95%OBJS 96 97%CFILES 98 99%SFILES 100 101# load lines for config "xxx" will be emitted as: 102# xxx: ${SYSTEM_DEP} swapxxx.o 103# ${SYSTEM_LD_HEAD} 104# ${SYSTEM_LD} swapxxx.o 105# ${SYSTEM_LD_TAIL} 106SYSTEM_OBJ= locore.o \ 107 param.o ioconf.o ${OBJS} ${LIBCOMPAT} ${LIBKERN} 108SYSTEM_DEP= Makefile ${SYSTEM_OBJ} 109SYSTEM_LD_HEAD= @rm -f $@ 110SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \ 111 ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o 112SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@ 113 114DEBUG?= 115.if ${DEBUG} == "-g" 116LINKFLAGS+= -X 117SYSTEM_LD_TAIL+=; \ 118 echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \ 119 echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \ 120 ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb 121.else 122LINKFLAGS+= -S 123.endif 124 125%LOAD 126 127.if ${USE_GENASSYM} == "no" 128assym.h: $S/kern/genassym.sh ${SPARC64}/sparc64/genassym.cf 129 sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \ 130 < ${SPARC64}/sparc64/genassym.cf > assym.h.tmp && \ 131 mv -f assym.h.tmp assym.h 132.else 133HOSTED_CC= ${CC} 134HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//} 135HOSTED_CFLAGS= ${CFLAGS} 136 137HOSTED_C= ${HOSTED_CC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $< 138 139assym.h: genassym 140 ./genassym >assym.h 141 142genassym: genassym.o 143 ${CC} -o $@ genassym.o 144 145genassym.o: ${SPARC64}/sparc64/genassym.c 146 ${HOSTED_C} 147.endif 148 149param.c: $S/conf/param.c 150 rm -f param.c 151 cp $S/conf/param.c . 152 153param.o: param.c Makefile 154 ${NORMAL_C} 155 156ioconf.o: ioconf.c 157 ${NORMAL_C} 158 159newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 160 sh $S/conf/newvers.sh 161 ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c 162 163__CLEANKERNEL: .USE 164 @echo "${.TARGET}ing the kernel objects" 165 rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \ 166 [Ee]rrs lderr linterrs makelinks assym.h.tmp assym.h 167 168__CLEANDEPEND: .USE 169 rm -f .depend 170 171clean: __CLEANKERNEL 172 173cleandir distclean: __CLEANKERNEL __CLEANDEPEND 174 175lint: 176 @lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \ 177 ${SPARC64}/sparc64/Locore.c ${CFILES} \ 178 ioconf.c param.c | \ 179 grep -v 'static function .* unused' 180 181tags: 182 @echo "see $S/kern/Makefile for tags" 183 184links: 185 egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 186 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 187 echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 188 sort -u | comm -23 - dontlink | \ 189 sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks 190 sh makelinks && rm -f dontlink 191 192SRCS= ${SPARC64}/sparc64/locore.s \ 193 param.c ioconf.c ${CFILES} ${SFILES} 194depend: .depend 195.depend: ${SRCS} assym.h param.c 196 ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${SPARC64}/sparc64/locore.s 197 ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} 198.if (${SFILES} != "") 199 ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} 200.endif 201 sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \ 202 ${CPPFLAGS} < ${SPARC64}/sparc64/genassym.cf 203 @sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend 204 @rm -f assym.dep 205 206dependall: depend all 207 208 209# depend on root or device configuration 210autoconf.o conf.o: Makefile 211 212# depend on network or filesystem configuration 213uipc_proto.o vfs_conf.o: Makefile 214 215# depend on maxusers 216machdep.o: Makefile 217 218# depend on CPU configuration 219bwtwo.o cgsix.o cgthree.o cgtwo.o cons.o dma.o esp.o fb.o if_ie.o: Makefile 220ms.c obio.o zs.c autoconf.o clock.o cpu.o disksubr.o locore.o: Makefile 221machdep.o mem.o openprom.o pmap.o vm_machdep.o: Makefile 222 223 224locore.o: ${SPARC64}/sparc64/locore.s assym.h 225 ${NORMAL_S} 226 227%RULES 228