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