1 1.67 is # $NetBSD: Makefile.amiga,v 1.67 1997/10/09 20:40:25 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.38 mycroft CC?= cc 25 1.67 is AS?= as 26 1.38 mycroft LD?= ld 27 1.46 mycroft MKDEP?= mkdep 28 1.64 lukem SIZE?= size 29 1.50 mycroft STRIP?= strip 30 1.52 veego COPTS?= -O2 31 1.1 mw 32 1.1 mw # source tree is located via $S relative to the compilation directory 33 1.49 mycroft .ifndef S 34 1.46 mycroft S!= cd ../../../..; pwd 35 1.49 mycroft .endif 36 1.46 mycroft AMIGA= $S/arch/amiga 37 1.1 mw 38 1.47 mycroft INCLUDES= -I. -I$S/arch -I$S -nostdinc 39 1.48 mycroft CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL \ 40 1.62 mycroft -Dmc68020 -Damiga -DFPCOPROC 41 1.56 veego CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes 42 1.40 is .if empty(IDENT:M-DM68060) 43 1.46 mycroft CMACHFLAGS= -m68020 44 1.40 is .else 45 1.46 mycroft CMACHFLAGS= -m68060 -Wa,-m68030 46 1.40 is .endif 47 1.52 veego CFLAGS= ${DEBUG} ${CWARNFLAGS} ${COPTS} ${CMACHFLAGS} -msoft-float 48 1.37 mycroft AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE 49 1.35 mycroft LINKFLAGS= -n -Ttext 0 -e start 50 1.50 mycroft STRIPFLAGS= -d 51 1.50 mycroft 52 1.4 mw ### find out what to use for libkern 53 1.4 mw .include "$S/lib/libkern/Makefile.inc" 54 1.4 mw .ifndef PROF 55 1.4 mw LIBKERN= ${KERNLIB} 56 1.4 mw .else 57 1.4 mw LIBKERN= ${KERNLIB_PROF} 58 1.4 mw .endif 59 1.20 chopps 60 1.24 christos ### find out what to use for libcompat 61 1.24 christos .include "$S/compat/common/Makefile.inc" 62 1.24 christos .ifndef PROF 63 1.24 christos LIBCOMPAT= ${COMPATLIB} 64 1.24 christos .else 65 1.24 christos LIBCOMPAT= ${COMPATLIB_PROF} 66 1.24 christos .endif 67 1.24 christos 68 1.20 chopps ### for the Motorola 68040 Floating Point Software Product 69 1.20 chopps .include "$S/arch/m68k/fpsp/Makefile.inc" 70 1.20 chopps 71 1.41 is ### for the Motorola 68060 Software Support Package 72 1.44 is .include "$S/arch/m68k/060sp/Makefile.inc" 73 1.41 is 74 1.48 mycroft # compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or 75 1.48 mycroft # HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file). 76 1.1 mw 77 1.35 mycroft NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< 78 1.37 mycroft NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< 79 1.1 mw 80 1.29 jtc .SUFFIXES: .o .g 81 1.29 jtc 82 1.29 jtc .g.o: ; echo This is a dummy rule and should not be executed. 83 1.29 jtc 84 1.29 jtc NORMAL_G= gspa < $< | gspahextoc > $*.c; ${CC} -c ${CFLAGS} ${PROF} $*.c 85 1.29 jtc 86 1.1 mw %OBJS 87 1.1 mw 88 1.1 mw %CFILES 89 1.1 mw 90 1.35 mycroft %SFILES 91 1.35 mycroft 92 1.1 mw # load lines for config "xxx" will be emitted as: 93 1.1 mw # xxx: ${SYSTEM_DEP} swapxxx.o 94 1.1 mw # ${SYSTEM_LD_HEAD} 95 1.1 mw # ${SYSTEM_LD} swapxxx.o 96 1.1 mw # ${SYSTEM_LD_TAIL} 97 1.66 is SYSTEM_OBJ= locore.o ${FPSP} \ 98 1.39 cgd param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT} 99 1.1 mw SYSTEM_DEP= Makefile ${SYSTEM_OBJ} 100 1.35 mycroft SYSTEM_LD_HEAD= @rm -f $@ 101 1.35 mycroft SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \ 102 1.35 mycroft ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o 103 1.64 lukem SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@ 104 1.35 mycroft 105 1.35 mycroft DEBUG?= 106 1.35 mycroft .if ${DEBUG} == "-g" 107 1.35 mycroft LINKFLAGS+= -X 108 1.35 mycroft SYSTEM_LD_TAIL+=; \ 109 1.1 mw echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \ 110 1.50 mycroft echo ${STRIP} ${STRIPFLAGS} $@; ${STRIP} ${STRIPFLAGS} $@ 111 1.35 mycroft .else 112 1.46 mycroft LINKFLAGS+= -S 113 1.35 mycroft .endif 114 1.1 mw 115 1.1 mw %LOAD 116 1.3 mw 117 1.56 veego assym.h: ${AMIGA}/amiga/genassym.cf $S/kern/genassym.sh 118 1.56 veego sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \ 119 1.56 veego < ${AMIGA}/amiga/genassym.cf > assym.h.tmp && \ 120 1.56 veego mv -f assym.h.tmp assym.h 121 1.1 mw 122 1.35 mycroft param.c: $S/conf/param.c 123 1.35 mycroft rm -f param.c 124 1.35 mycroft cp $S/conf/param.c . 125 1.1 mw 126 1.35 mycroft param.o: param.c Makefile 127 1.48 mycroft ${NORMAL_C} 128 1.35 mycroft 129 1.35 mycroft ioconf.o: ioconf.c 130 1.35 mycroft ${NORMAL_C} 131 1.1 mw 132 1.35 mycroft newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 133 1.35 mycroft sh $S/conf/newvers.sh 134 1.35 mycroft ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c 135 1.1 mw 136 1.63 christos __CLEANKERNEL: .USE 137 1.63 christos @echo "${.TARGET}ing the kernel objects" 138 1.63 christos rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \ 139 1.63 christos [Ee]rrs linterrs makelinks assym.h.tmp assym.h 140 1.63 christos 141 1.63 christos __CLEANDEPEND: .USE 142 1.63 christos rm -f .depend 143 1.1 mw 144 1.63 christos clean: __CLEANKERNEL 145 1.63 christos 146 1.63 christos cleandir: __CLEANKERNEL __CLEANDEPEND 147 1.1 mw 148 1.35 mycroft lint: 149 1.54 perry @lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \ 150 1.61 mycroft ${CFILES} ioconf.c param.c | \ 151 1.35 mycroft grep -v 'static function .* unused' 152 1.1 mw 153 1.35 mycroft tags: 154 1.35 mycroft @echo "see $S/kern/Makefile for tags" 155 1.1 mw 156 1.1 mw links: 157 1.1 mw egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 158 1.1 mw sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 159 1.1 mw echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 160 1.1 mw sort -u | comm -23 - dontlink | \ 161 1.35 mycroft sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks 162 1.1 mw sh makelinks && rm -f dontlink 163 1.1 mw 164 1.35 mycroft SRCS= ${AMIGA}/amiga/locore.s \ 165 1.39 cgd param.c ioconf.c ${CFILES} ${SFILES} 166 1.53 veego depend: .depend 167 1.39 cgd .depend: ${SRCS} assym.h param.c 168 1.46 mycroft ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AMIGA}/amiga/locore.s 169 1.46 mycroft ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} 170 1.46 mycroft ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} 171 1.59 leo sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \ 172 1.59 leo ${CPPFLAGS} < ${AMIGA}/amiga/genassym.cf 173 1.59 leo @sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend 174 1.59 leo @rm -f assym.dep 175 1.59 leo 176 1.35 mycroft 177 1.35 mycroft # depend on root or device configuration 178 1.35 mycroft autoconf.o conf.o: Makefile 179 1.35 mycroft 180 1.35 mycroft # depend on network or filesystem configuration 181 1.35 mycroft uipc_proto.o vfs_conf.o: Makefile 182 1.35 mycroft 183 1.35 mycroft # depend on maxusers 184 1.56 veego machdep.o: Makefile 185 1.1 mw 186 1.35 mycroft # depend on CPU configuration 187 1.65 veego amiga_init.o locore.o pmap.o sys_machdep.o: Makefile 188 1.65 veego bzsc.o bztzsc.o cbiisc.o cbsc.o flsc.o sbic.o: Makefile 189 1.60 is 190 1.60 is # depends on defined(DRACO) 191 1.60 is a2kbbc.o: Makefile 192 1.1 mw 193 1.58 is # LEV6_DEFER blocks usage of audio interupt 3: 194 1.58 is aucc.o cc.o: Makefile 195 1.1 mw 196 1.35 mycroft locore.o: ${AMIGA}/amiga/locore.s assym.h 197 1.35 mycroft ${NORMAL_S} 198 1.1 mw 199 1.1 mw %RULES 200