1 # $NetBSD: Makefile.amiga,v 1.26 1995/10/09 00:12:54 chopps Exp $ 2 3 # @(#)Makefile.hp300 7.10 (Berkeley) 6/27/91 4 # 5 # Makefile for 4.4 BSD 6 # 7 # This makefile is constructed from a machine description: 8 # config machineid 9 # Most changes should be made in the machine description 10 # /sys/conf/``machineid'' 11 # after which you should do 12 # config machineid 13 # Machine generic makefile changes should be made in 14 # /sys/conf/Makefile.``machinetype'' 15 # after which config should be rerun for all machines of that type. 16 # 17 # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE 18 # IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING 19 # 20 # -DTRACE compile in kernel tracing hooks 21 # -DQUOTA compile in file system quotas 22 23 24 # DEBUG is set to -g by config if debugging is requested (config -g). 25 # PROF is set to -pg by config if profiling is requested (config -p). 26 AS= as ${DEBUG} 27 CC= cc ${DEBUG} 28 CPP= cpp 29 LD= ld 30 TOUCH= touch -f -c 31 32 # source tree is located via $S relative to the compilation directory 33 S= ../../../.. 34 AMIGA= ../.. 35 36 INCLUDES= -I. -I$S/arch -I$S -I$S/sys 37 COPTS= ${INCLUDES} ${IDENT} -D_KERNEL -Dmc68020 -Damiga 38 CFLAGS= -O -Werror -fno-builtin -mc68020 -m68881 ${COPTS} 39 40 ### find out what to use for libkern 41 .include "$S/lib/libkern/Makefile.inc" 42 .ifndef PROF 43 LIBKERN= ${KERNLIB} 44 .else 45 LIBKERN= ${KERNLIB_PROF} 46 .endif 47 48 ### find out what to use for libcompat 49 .include "$S/compat/common/Makefile.inc" 50 .ifndef PROF 51 LIBCOMPAT= ${COMPATLIB} 52 .else 53 LIBCOMPAT= ${COMPATLIB_PROF} 54 .endif 55 56 ### for the Motorola 68040 Floating Point Software Product 57 .include "$S/arch/m68k/fpsp/Makefile.inc" 58 59 # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP} 60 # where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix, 61 # capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file 62 # is marked as config-dependent. 63 64 NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< 65 NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 66 67 DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< 68 DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 69 70 PROFILE_C= ${CC} -S -c ${COPTS} $<; \ 71 sed -e s/_mcount/mcount/ -e s/subrmcount/subr_mcount/ <$*.s | \ 72 ${AS} -o $@; \ 73 rm -f $*.s 74 75 NORMAL_S= ${CPP} ${COPTS} $< | ${AS} -o $@ 76 NORMAL_S_C= ${CPP} ${COPTS} ${PARAM} $< | ${AS} -o $@ 77 78 %OBJS 79 80 %CFILES 81 82 # load lines for config "xxx" will be emitted as: 83 # xxx: ${SYSTEM_DEP} swapxxx.o 84 # ${SYSTEM_LD_HEAD} 85 # ${SYSTEM_LD} swapxxx.o 86 # ${SYSTEM_LD_TAIL} 87 SYSTEM_OBJ= locore.o ${FPSP} vnode_if.o ${OBJS} param.o ioconf.o \ 88 ${LIBKERN} ${LIBCOMPAT} 89 SYSTEM_DEP= Makefile ${SYSTEM_OBJ} 90 SYSTEM_LD_HEAD= rm -f $@ 91 SYSTEM_LD= -@if [ X${DEBUG} = X-g ]; \ 92 then strip=-X; \ 93 else strip=-x; \ 94 fi; \ 95 echo ${LD} $$strip -n -T 0 -o $@ -e start '$${SYSTEM_OBJ}' vers.o; \ 96 ${LD} $$strip -n -T 0 -o $@ -e start ${SYSTEM_OBJ} vers.o 97 SYSTEM_LD_TAIL= @size $@; chmod 755 $@; \ 98 [ X${DEBUG} = X-g ] && { \ 99 echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \ 100 echo strip -d $@; strip -d $@; } || true 101 102 %LOAD 103 104 vers.o: newvers 105 106 newvers: 107 sh $S/conf/newvers.sh ${KERN_IDENT} 108 ${CC} $(CFLAGS) -c vers.c 109 110 clean:: 111 rm -f eddep *netbsd netbsd.gdb tags *.o locore.i [a-z]*.s \ 112 Errs errs linterrs makelinks genassym 113 114 lint: /tmp param.c 115 @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} -UKGDB \ 116 ${AMIGA}/amiga/Locore.c ${CFILES} ${AMIGA}/amiga/swapgeneric.c \ 117 ioconf.c param.c| \ 118 grep -v 'struct/union .* never defined' | \ 119 grep -v 'possible pointer alignment problem' 120 121 locore.o: assym.s ${AMIGA}/amiga/vectors.s ${AMIGA}/amiga/locore.s 122 locore.o: machine/trap.h machine/psl.h machine/pte.h machine/cpu.h 123 ${CPP} -DLOCORE ${COPTS} ${AMIGA}/amiga/locore.s | ${AS} -o locore.o 124 125 # the following is necessary because autoconf.o depends on #if GENERIC 126 autoconf.o: Makefile 127 128 # the following are necessary because the files depend on the types of 129 # hp cpu's included in the system configuration 130 machdep.o sys_machdep.o pmap.o pmap_bootstrap.o trap.o dma.o: Makefile 131 132 # depend on network or filesystem configuration 133 uipc_proto.o vfs_conf.o locore.o: Makefile 134 135 # depend on maxusers 136 assym.s: Makefile 137 138 assym.s: genassym 139 ./genassym >assym.s 140 141 genassym: 142 ${CC} -static ${INCLUDES} ${IDENT} ${PARAM} -Dmc68020 -Damiga \ 143 -o genassym ${AMIGA}/amiga/genassym.c 144 145 depend: assym.s param.c vnode_if.h grf_ultmscode.h 146 mkdep ${COPTS} ${CFILES} ioconf.c param.c 147 mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${AMIGA}/amiga/genassym.c 148 149 links: 150 egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 151 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 152 echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 153 sort -u | comm -23 - dontlink | \ 154 sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks 155 sh makelinks && rm -f dontlink 156 157 tags: 158 @echo "see $S/kern/Makefile for tags" 159 160 ioconf.o: ioconf.c 161 ${CC} -c ${CFLAGS} ioconf.c 162 163 param.c: $S/conf/param.c 164 rm -f param.c 165 cp $S/conf/param.c . 166 167 param.o: param.c Makefile 168 ${CC} -c ${CFLAGS} ${PARAM} param.c 169 vnode_if.c vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src 170 AWK="${AWK}" sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 171 172 grf_ultmscode.h: ${AMIGA}/dev/grf_ul.gsp 173 gspa < ${AMIGA}/dev/grf_ul.gsp | gspahextoc > grf_ultmscode.h 174 175 grf_ul.o: grf_ultmscode.h 176 177 %RULES 178