1 1.73 is # $NetBSD: Makefile.amiga,v 1.73 1998/05/24 19:32:51 is Exp $ 2 1.21 cgd 3 1.35 mycroft # Makefile for NetBSD 4 1.1 mw # 5 1.1 mw # This makefile is constructed from a machine description: 6 1.1 mw # config machineid 7 1.1 mw # Most changes should be made in the machine description 8 1.35 mycroft # /sys/arch/amiga/conf/``machineid'' 9 1.1 mw # after which you should do 10 1.35 mycroft # config machineid 11 1.1 mw # Machine generic makefile changes should be made in 12 1.35 mycroft # /sys/arch/amiga/conf/Makefile.amiga 13 1.1 mw # after which config should be rerun for all machines of that type. 14 1.1 mw # 15 1.1 mw # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE 16 1.1 mw # IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING 17 1.1 mw # 18 1.1 mw # -DTRACE compile in kernel tracing hooks 19 1.1 mw # -DQUOTA compile in file system quotas 20 1.1 mw 21 1.35 mycroft # DEBUG is set to -g if debugging. 22 1.35 mycroft # PROF is set to -pg if profiling. 23 1.1 mw 24 1.69 thorpej AR?= ar 25 1.69 thorpej AS?= as 26 1.38 mycroft CC?= cc 27 1.69 thorpej CPP?= cpp 28 1.38 mycroft LD?= ld 29 1.68 thorpej LORDER?=lorder 30 1.46 mycroft MKDEP?= mkdep 31 1.68 thorpej NM?= nm 32 1.69 thorpej RANLIB?=ranlib 33 1.64 lukem SIZE?= size 34 1.50 mycroft STRIP?= strip 35 1.68 thorpej TSORT?= tsort -q 36 1.69 thorpej 37 1.52 veego COPTS?= -O2 38 1.1 mw 39 1.1 mw # source tree is located via $S relative to the compilation directory 40 1.49 mycroft .ifndef S 41 1.46 mycroft S!= cd ../../../..; pwd 42 1.49 mycroft .endif 43 1.46 mycroft AMIGA= $S/arch/amiga 44 1.1 mw 45 1.70 tv HAVE_GCC28!= ${CC} --version | egrep "^(2\.8|egcs)" ; echo 46 1.47 mycroft INCLUDES= -I. -I$S/arch -I$S -nostdinc 47 1.48 mycroft CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL \ 48 1.62 mycroft -Dmc68020 -Damiga -DFPCOPROC 49 1.70 tv CWARNFLAGS?= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes 50 1.70 tv .if (${HAVE_GCC28} != "") 51 1.70 tv CWARNFLAGS+= -Wno-main 52 1.70 tv .endif 53 1.73 is .if empty(IDENT:M-DM68060) 54 1.46 mycroft CMACHFLAGS= -m68020 55 1.40 is .else 56 1.46 mycroft CMACHFLAGS= -m68060 -Wa,-m68030 57 1.40 is .endif 58 1.52 veego CFLAGS= ${DEBUG} ${CWARNFLAGS} ${COPTS} ${CMACHFLAGS} -msoft-float 59 1.37 mycroft AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE 60 1.35 mycroft LINKFLAGS= -n -Ttext 0 -e start 61 1.50 mycroft STRIPFLAGS= -d 62 1.50 mycroft 63 1.4 mw ### find out what to use for libkern 64 1.4 mw .include "$S/lib/libkern/Makefile.inc" 65 1.4 mw .ifndef PROF 66 1.4 mw LIBKERN= ${KERNLIB} 67 1.4 mw .else 68 1.4 mw LIBKERN= ${KERNLIB_PROF} 69 1.4 mw .endif 70 1.20 chopps 71 1.24 christos ### find out what to use for libcompat 72 1.24 christos .include "$S/compat/common/Makefile.inc" 73 1.24 christos .ifndef PROF 74 1.24 christos LIBCOMPAT= ${COMPATLIB} 75 1.24 christos .else 76 1.24 christos LIBCOMPAT= ${COMPATLIB_PROF} 77 1.24 christos .endif 78 1.24 christos 79 1.20 chopps ### for the Motorola 68040 Floating Point Software Product 80 1.20 chopps .include "$S/arch/m68k/fpsp/Makefile.inc" 81 1.20 chopps 82 1.41 is ### for the Motorola 68060 Software Support Package 83 1.44 is .include "$S/arch/m68k/060sp/Makefile.inc" 84 1.41 is 85 1.48 mycroft # compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or 86 1.48 mycroft # HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file). 87 1.1 mw 88 1.35 mycroft NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< 89 1.37 mycroft NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< 90 1.1 mw 91 1.29 jtc .SUFFIXES: .o .g 92 1.29 jtc 93 1.29 jtc .g.o: ; echo This is a dummy rule and should not be executed. 94 1.29 jtc 95 1.29 jtc NORMAL_G= gspa < $< | gspahextoc > $*.c; ${CC} -c ${CFLAGS} ${PROF} $*.c 96 1.29 jtc 97 1.1 mw %OBJS 98 1.1 mw 99 1.1 mw %CFILES 100 1.1 mw 101 1.35 mycroft %SFILES 102 1.35 mycroft 103 1.1 mw # load lines for config "xxx" will be emitted as: 104 1.1 mw # xxx: ${SYSTEM_DEP} swapxxx.o 105 1.1 mw # ${SYSTEM_LD_HEAD} 106 1.1 mw # ${SYSTEM_LD} swapxxx.o 107 1.1 mw # ${SYSTEM_LD_TAIL} 108 1.66 is SYSTEM_OBJ= locore.o ${FPSP} \ 109 1.39 cgd param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT} 110 1.1 mw SYSTEM_DEP= Makefile ${SYSTEM_OBJ} 111 1.35 mycroft SYSTEM_LD_HEAD= @rm -f $@ 112 1.35 mycroft SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \ 113 1.35 mycroft ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o 114 1.64 lukem SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@ 115 1.35 mycroft 116 1.35 mycroft DEBUG?= 117 1.35 mycroft .if ${DEBUG} == "-g" 118 1.35 mycroft LINKFLAGS+= -X 119 1.35 mycroft SYSTEM_LD_TAIL+=; \ 120 1.1 mw echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \ 121 1.50 mycroft echo ${STRIP} ${STRIPFLAGS} $@; ${STRIP} ${STRIPFLAGS} $@ 122 1.35 mycroft .else 123 1.46 mycroft LINKFLAGS+= -S 124 1.35 mycroft .endif 125 1.1 mw 126 1.1 mw %LOAD 127 1.3 mw 128 1.56 veego assym.h: ${AMIGA}/amiga/genassym.cf $S/kern/genassym.sh 129 1.56 veego sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \ 130 1.56 veego < ${AMIGA}/amiga/genassym.cf > assym.h.tmp && \ 131 1.56 veego mv -f assym.h.tmp assym.h 132 1.1 mw 133 1.35 mycroft param.c: $S/conf/param.c 134 1.35 mycroft rm -f param.c 135 1.35 mycroft cp $S/conf/param.c . 136 1.1 mw 137 1.35 mycroft param.o: param.c Makefile 138 1.48 mycroft ${NORMAL_C} 139 1.35 mycroft 140 1.35 mycroft ioconf.o: ioconf.c 141 1.35 mycroft ${NORMAL_C} 142 1.1 mw 143 1.35 mycroft newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 144 1.35 mycroft sh $S/conf/newvers.sh 145 1.35 mycroft ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c 146 1.1 mw 147 1.63 christos __CLEANKERNEL: .USE 148 1.63 christos @echo "${.TARGET}ing the kernel objects" 149 1.63 christos rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \ 150 1.63 christos [Ee]rrs linterrs makelinks assym.h.tmp assym.h 151 1.63 christos 152 1.63 christos __CLEANDEPEND: .USE 153 1.63 christos rm -f .depend 154 1.1 mw 155 1.63 christos clean: __CLEANKERNEL 156 1.63 christos 157 1.63 christos cleandir: __CLEANKERNEL __CLEANDEPEND 158 1.1 mw 159 1.35 mycroft lint: 160 1.54 perry @lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \ 161 1.61 mycroft ${CFILES} ioconf.c param.c | \ 162 1.35 mycroft grep -v 'static function .* unused' 163 1.1 mw 164 1.35 mycroft tags: 165 1.35 mycroft @echo "see $S/kern/Makefile for tags" 166 1.1 mw 167 1.1 mw links: 168 1.1 mw egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 169 1.1 mw sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 170 1.1 mw echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 171 1.1 mw sort -u | comm -23 - dontlink | \ 172 1.35 mycroft sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks 173 1.1 mw sh makelinks && rm -f dontlink 174 1.1 mw 175 1.35 mycroft SRCS= ${AMIGA}/amiga/locore.s \ 176 1.39 cgd param.c ioconf.c ${CFILES} ${SFILES} 177 1.53 veego depend: .depend 178 1.39 cgd .depend: ${SRCS} assym.h param.c 179 1.46 mycroft ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AMIGA}/amiga/locore.s 180 1.46 mycroft ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} 181 1.46 mycroft ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} 182 1.59 leo sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \ 183 1.59 leo ${CPPFLAGS} < ${AMIGA}/amiga/genassym.cf 184 1.59 leo @sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend 185 1.59 leo @rm -f assym.dep 186 1.59 leo 187 1.35 mycroft 188 1.35 mycroft # depend on root or device configuration 189 1.35 mycroft autoconf.o conf.o: Makefile 190 1.35 mycroft 191 1.72 is # depend on network configuration 192 1.72 is uipc_proto.o: Makefile 193 1.35 mycroft 194 1.35 mycroft # depend on maxusers 195 1.56 veego machdep.o: Makefile 196 1.1 mw 197 1.35 mycroft # depend on CPU configuration 198 1.72 is # GRF_AGA, LIMITMEM, DRACO 199 1.72 is amiga_init.o: Makefile 200 1.72 is 201 1.72 is # lots of things: 202 1.72 is locore.o: Makefile 203 1.72 is 204 1.72 is # NKPTADD 205 1.72 is pmap.o: Makefile 206 1.60 is 207 1.60 is # depends on defined(DRACO) 208 1.60 is a2kbbc.o: Makefile 209 1.1 mw 210 1.58 is # LEV6_DEFER blocks usage of audio interupt 3: 211 1.58 is aucc.o cc.o: Makefile 212 1.1 mw 213 1.35 mycroft locore.o: ${AMIGA}/amiga/locore.s assym.h 214 1.35 mycroft ${NORMAL_S} 215 1.1 mw 216 1.1 mw %RULES 217