Makefile.sparc64 revision 1.14
1# $NetBSD: Makefile.sparc64,v 1.14 1999/12/30 16:19:00 eeh 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 35STRIPFLAGS= -S 36NM?=nm 37LORDER?=lorder 38TSORT?=tsort 39 40 41# deal with Solaris vs. NetBSD build environments for now .. 42OS!=uname -s 43.if (${OS} == "NetBSD") 44USE_GENASSYM?= no 45.else 46USE_GENASSYM?= no 47AWK=nawk 48.endif 49 50.if exists(/usr/ccs/bin/ld) 51SVR4=-U__SVR4 -U__svr4__ -D__NetBSD__ 52.else 53SVR4= 54.endif 55 56# source tree is located via $S relative to the compilation directory 57.ifndef S 58S!= cd ../../../..; pwd 59.endif 60SPARC64= $S/arch/sparc64 61 62INCLUDES= -I. -I$S/arch -I$S -nostdinc 63CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL ${SVR4} 64CWARNFLAGS= -Wimplicit -Wunused -Wswitch -Wcomment -Wtrigraphs -Wchar-subscripts -Wuninitialized -Wparentheses -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 65#CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes 66CFLAGS= ${DEBUG} ${CWARNFLAGS} -O2 -Wa,-Av9a -mno-fpu 67AFLAGS= -x assembler-with-cpp -Wa,-Av9a -traditional-cpp -D_LOCORE 68LINKFLAGS= -N -p -Ttext f1000000 -e start >lderr 69#STRIPFLAGS= -d 70 71%INCLUDES 72 73### find out what to use for libkern 74# KERN_AS= obj # bcopy, bzero, memcpy, memset, etc. are in locore.s 75.include "$S/lib/libkern/Makefile.inc" 76.ifndef PROF 77LIBKERN= ${KERNLIB} 78.else 79LIBKERN= ${KERNLIB_PROF} 80.endif 81 82### find out what to use for libcompat 83.include "$S/compat/common/Makefile.inc" 84.ifndef PROF 85LIBCOMPAT= ${COMPATLIB} 86.else 87LIBCOMPAT= ${COMPATLIB_PROF} 88.endif 89 90# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or 91# HOSTED, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file). 92 93NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< 94NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< 95 96%OBJS 97 98%CFILES 99 100%SFILES 101 102# load lines for config "xxx" will be emitted as: 103# xxx: ${SYSTEM_DEP} swapxxx.o 104# ${SYSTEM_LD_HEAD} 105# ${SYSTEM_LD} swapxxx.o 106# ${SYSTEM_LD_TAIL} 107SYSTEM_OBJ= locore.o \ 108 param.o ioconf.o ${OBJS} ${LIBCOMPAT} ${LIBKERN} 109SYSTEM_DEP= Makefile ${SYSTEM_OBJ} 110SYSTEM_LD_HEAD= @rm -f $@ 111SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \ 112 ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o 113SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@ 114 115DEBUG?= 116.if ${DEBUG} == "-g" 117LINKFLAGS+= -X 118SYSTEM_LD_TAIL+=; \ 119 echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \ 120 echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \ 121 ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb 122.else 123LINKFLAGS+= -S 124.endif 125 126%LOAD 127 128.if ${USE_GENASSYM} == "no" 129assym.h: $S/kern/genassym.sh ${SPARC64}/sparc64/genassym.cf 130 sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \ 131 < ${SPARC64}/sparc64/genassym.cf > assym.h.tmp && \ 132 mv -f assym.h.tmp assym.h 133.else 134HOSTED_CC= ${CC} 135HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//} 136HOSTED_CFLAGS= ${CFLAGS} 137 138HOSTED_C= ${HOSTED_CC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $< 139 140assym.h: genassym 141 ./genassym >assym.h 142 143genassym: genassym.o 144 ${CC} -o $@ genassym.o 145 146genassym.o: ${SPARC64}/sparc64/genassym.c 147 ${HOSTED_C} 148.endif 149 150param.c: $S/conf/param.c 151 rm -f param.c 152 cp $S/conf/param.c . 153 154param.o: param.c Makefile 155 ${NORMAL_C} 156 157ioconf.o: ioconf.c 158 ${NORMAL_C} 159 160newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 161 sh $S/conf/newvers.sh 162 ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c 163 164 165clean: cleankernel 166cleankernel: 167 rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \ 168 [Ee]rrs lderr linterrs makelinks assym.h.tmp assym.h 169 170lint: 171 @lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \ 172 ${SPARC64}/sparc64/Locore.c ${CFILES} \ 173 ioconf.c param.c | \ 174 grep -v 'static function .* unused' 175 176tags: 177 @echo "see $S/kern/Makefile for tags" 178 179links: 180 egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 181 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 182 echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 183 sort -u | comm -23 - dontlink | \ 184 sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks 185 sh makelinks && rm -f dontlink 186 187SRCS= ${SPARC64}/sparc64/locore.s \ 188 param.c ioconf.c ${CFILES} ${SFILES} 189depend: .depend 190.depend: ${SRCS} assym.h param.c 191 ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${SPARC64}/sparc64/locore.s 192 ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} 193.if (${SFILES} != "") 194 ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} 195.endif 196 sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \ 197 ${CPPFLAGS} < ${SPARC64}/sparc64/genassym.cf 198 @sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend 199 @rm -f assym.dep 200 201# depend on root or device configuration 202autoconf.o conf.o: Makefile 203 204# depend on network or filesystem configuration 205uipc_proto.o vfs_conf.o: Makefile 206 207# depend on maxusers 208machdep.o: Makefile 209 210# depend on CPU configuration 211bwtwo.o cgsix.o cgthree.o cgtwo.o cons.o dma.o esp.o fb.o if_ie.o: Makefile 212ms.c obio.o zs.c autoconf.o clock.o cpu.o disksubr.o locore.o: Makefile 213machdep.o mem.o openprom.o pmap.o vm_machdep.o: Makefile 214 215 216locore.o: ${SPARC64}/sparc64/locore.s assym.h 217 ${NORMAL_S} 218 219%RULES 220