1 1.37 mycroft # $NetBSD: Makefile.amiga,v 1.37 1996/02/09 02:21:17 mycroft 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.32 chopps AS= as 25 1.35 mycroft AWK= awk 26 1.35 mycroft CC= cc 27 1.13 chopps CPP= cpp 28 1.35 mycroft LD= ld 29 1.35 mycroft STRIP= strip -d 30 1.1 mw TOUCH= touch -f -c 31 1.1 mw 32 1.1 mw # source tree is located via $S relative to the compilation directory 33 1.1 mw S= ../../../.. 34 1.1 mw AMIGA= ../.. 35 1.1 mw 36 1.35 mycroft INCLUDES= -I. -I$S/arch -I$S 37 1.35 mycroft CPPFLAGS= ${INCLUDES} ${IDENT} -D_KERNEL -Dmc68020 -Damiga 38 1.35 mycroft CFLAGS= ${DEBUG} -O2 -Werror -mc68020 -msoft-float 39 1.37 mycroft AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE 40 1.35 mycroft LINKFLAGS= -n -Ttext 0 -e start 41 1.1 mw 42 1.4 mw ### find out what to use for libkern 43 1.4 mw .include "$S/lib/libkern/Makefile.inc" 44 1.4 mw .ifndef PROF 45 1.4 mw LIBKERN= ${KERNLIB} 46 1.4 mw .else 47 1.4 mw LIBKERN= ${KERNLIB_PROF} 48 1.4 mw .endif 49 1.20 chopps 50 1.24 christos ### find out what to use for libcompat 51 1.24 christos .include "$S/compat/common/Makefile.inc" 52 1.24 christos .ifndef PROF 53 1.24 christos LIBCOMPAT= ${COMPATLIB} 54 1.24 christos .else 55 1.24 christos LIBCOMPAT= ${COMPATLIB_PROF} 56 1.24 christos .endif 57 1.24 christos 58 1.20 chopps ### for the Motorola 68040 Floating Point Software Product 59 1.20 chopps .include "$S/arch/m68k/fpsp/Makefile.inc" 60 1.20 chopps 61 1.1 mw # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP} 62 1.1 mw # where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix, 63 1.1 mw # capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file 64 1.1 mw # is marked as config-dependent. 65 1.1 mw 66 1.35 mycroft NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< 67 1.35 mycroft NORMAL_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $< 68 1.1 mw 69 1.35 mycroft DRIVER_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< 70 1.35 mycroft DRIVER_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $< 71 1.1 mw 72 1.37 mycroft NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< 73 1.37 mycroft NORMAL_S_C= ${CC} ${AFLAGS} ${CPPFLAGS} ${PARAM} -c $< 74 1.1 mw 75 1.29 jtc .SUFFIXES: .o .g 76 1.29 jtc 77 1.29 jtc .g.o: ; echo This is a dummy rule and should not be executed. 78 1.29 jtc 79 1.29 jtc NORMAL_G= gspa < $< | gspahextoc > $*.c; ${CC} -c ${CFLAGS} ${PROF} $*.c 80 1.29 jtc 81 1.1 mw %OBJS 82 1.1 mw 83 1.1 mw %CFILES 84 1.1 mw 85 1.35 mycroft %SFILES 86 1.35 mycroft 87 1.1 mw # load lines for config "xxx" will be emitted as: 88 1.1 mw # xxx: ${SYSTEM_DEP} swapxxx.o 89 1.1 mw # ${SYSTEM_LD_HEAD} 90 1.1 mw # ${SYSTEM_LD} swapxxx.o 91 1.1 mw # ${SYSTEM_LD_TAIL} 92 1.35 mycroft SYSTEM_OBJ= locore.o ${FPSP} \ 93 1.35 mycroft vnode_if.o param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT} 94 1.1 mw SYSTEM_DEP= Makefile ${SYSTEM_OBJ} 95 1.35 mycroft SYSTEM_LD_HEAD= @rm -f $@ 96 1.35 mycroft SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \ 97 1.35 mycroft ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o 98 1.35 mycroft SYSTEM_LD_TAIL= @size $@; chmod 755 $@ 99 1.35 mycroft 100 1.35 mycroft DEBUG?= 101 1.35 mycroft .if ${DEBUG} == "-g" 102 1.35 mycroft LINKFLAGS+= -X 103 1.35 mycroft SYSTEM_LD_TAIL+=; \ 104 1.1 mw echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \ 105 1.35 mycroft echo ${STRIP} $@; ${STRIP} $@ 106 1.35 mycroft .else 107 1.35 mycroft LINKFLAGS+= -x 108 1.35 mycroft .endif 109 1.1 mw 110 1.1 mw %LOAD 111 1.3 mw 112 1.35 mycroft assym.h: genassym 113 1.35 mycroft ./genassym >assym.h 114 1.35 mycroft 115 1.35 mycroft genassym: genassym.o 116 1.35 mycroft ${CC} -o $@ genassym.o 117 1.35 mycroft 118 1.35 mycroft genassym.o: ${AMIGA}/amiga/genassym.c 119 1.35 mycroft ${NORMAL_C_C} 120 1.1 mw 121 1.35 mycroft vnode_if.c vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src 122 1.35 mycroft AWK="${AWK}" sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 123 1.35 mycroft 124 1.35 mycroft param.c: $S/conf/param.c 125 1.35 mycroft rm -f param.c 126 1.35 mycroft cp $S/conf/param.c . 127 1.1 mw 128 1.35 mycroft param.o: param.c Makefile 129 1.35 mycroft ${NORMAL_C_C} 130 1.35 mycroft 131 1.35 mycroft ioconf.o: ioconf.c 132 1.35 mycroft ${NORMAL_C} 133 1.1 mw 134 1.35 mycroft newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 135 1.35 mycroft sh $S/conf/newvers.sh 136 1.35 mycroft ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c 137 1.1 mw 138 1.1 mw 139 1.35 mycroft clean:: 140 1.35 mycroft rm -f eddep *netbsd netbsd.gdb tags vnode_if.[ch] *.[io] [a-z]*.s \ 141 1.35 mycroft [Ee]rrs linterrs makelinks genassym genassym.o assym.h 142 1.1 mw 143 1.35 mycroft lint: 144 1.35 mycroft @lint -hbxncez -DGENERIC -Dvolatile= ${CPPFLAGS} ${PARAM} -UKGDB \ 145 1.35 mycroft ${AMIGA}/amiga/Locore.c ${CFILES} ${AMIGA}/amiga/swapgeneric.c \ 146 1.35 mycroft ioconf.c param.c | \ 147 1.35 mycroft grep -v 'static function .* unused' 148 1.1 mw 149 1.35 mycroft tags: 150 1.35 mycroft @echo "see $S/kern/Makefile for tags" 151 1.1 mw 152 1.1 mw links: 153 1.1 mw egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 154 1.1 mw sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 155 1.1 mw echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 156 1.1 mw sort -u | comm -23 - dontlink | \ 157 1.35 mycroft sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks 158 1.1 mw sh makelinks && rm -f dontlink 159 1.1 mw 160 1.35 mycroft SRCS= ${AMIGA}/amiga/locore.s \ 161 1.35 mycroft vnode_if.c param.c ioconf.c ${CFILES} ${SFILES} 162 1.35 mycroft depend: .depend 163 1.35 mycroft .depend: ${SRCS} assym.h vnode_if.h param.c 164 1.37 mycroft mkdep ${AFLAGS} ${CPPFLAGS} ${AMIGA}/amiga/locore.s 165 1.35 mycroft mkdep -a ${CFLAGS} ${CPPFLAGS} vnode_if.c param.c ioconf.c ${CFILES} 166 1.37 mycroft mkdep -a ${AFLAGS} ${CPPFLAGS} ${SFILES} 167 1.35 mycroft mkdep -a ${CFLAGS} ${CPPFLAGS} ${PARAM} ${AMIGA}/amiga/genassym.c 168 1.35 mycroft 169 1.35 mycroft 170 1.35 mycroft # depend on root or device configuration 171 1.35 mycroft autoconf.o conf.o: Makefile 172 1.35 mycroft 173 1.35 mycroft # depend on network or filesystem configuration 174 1.35 mycroft uipc_proto.o vfs_conf.o: Makefile 175 1.35 mycroft 176 1.35 mycroft # depend on maxusers 177 1.35 mycroft genassym.o machdep.o: Makefile 178 1.1 mw 179 1.35 mycroft # depend on CPU configuration 180 1.35 mycroft amiga_init.o locore.o pmap.o sys_machdep.o bzsc.o flsc.o sbic.o sfas.o: Makefile 181 1.1 mw 182 1.1 mw 183 1.35 mycroft locore.o: ${AMIGA}/amiga/locore.s assym.h 184 1.35 mycroft ${NORMAL_S} 185 1.1 mw 186 1.1 mw %RULES 187