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