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