Makefile.powerpc revision 1891
1# Copyright 1990 W. Jolitz 2# from: @(#)Makefile.i386 7.1 5/10/91 3# $Id: Makefile.i386,v 1.26 1994/05/26 13:38:01 rgrimes Exp $ 4# 5# Makefile for FreeBSD 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/i386/conf/``machineid'' 11# after which you should do 12# config machineid 13# Generic makefile changes should be made in 14# /sys/i386/conf/Makefile.i386 15# after which config should be rerun for all machines. 16# 17# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE INVISIBLE 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# 23TOUCH= touch -f -c 24LD= /usr/bin/ld 25CC= cc 26CPP= cpp 27DBSYM= /usr/sbin/dbsym 28 29S= ../.. 30I386= ../../i386 31 32CWARNFLAGS=-W -Wreturn-type -Wcomment 33# 34# The following flags are next up for working on: 35# -Wredundant-decls -Wnested-externs 36# 37# When working on removing warnings from code, the `-Werror' flag should be 38# of material assistance. 39# 40COPTFLAGS=-O 41INCLUDES= -I. -I$S -I$S/sys 42COPTS= ${INCLUDES} ${IDENT} -DKERNEL -Di386 -DNPX 43ASFLAGS= 44CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} 45LOAD_ADDRESS?= F0100000 46 47NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< 48NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 49NORMAL_S= ${CPP} -I. -DLOCORE ${COPTS} $< | ${AS} ${ASFLAGS} -o $*.o 50DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< 51DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 52SYSTEM_OBJS=locore.o exception.o swtch.o support.o ${OBJS} param.o \ 53 ioconf.o conf.o machdep.o vnode_if.o 54SYSTEM_DEP=Makefile symbols.sort ${SYSTEM_OBJS} libkern.a 55SYSTEM_LD_HEAD= @echo loading $@; rm -f $@ 56SYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o libkern.a 57SYSTEM_LD_TAIL= @echo rearranging symbols; symorder symbols.sort $@; \ 58 ${DBSYM} -fT ${LOAD_ADDRESS} $@; size $@; chmod 755 $@ 59 60# (XXX) ok, this is weird. but we've got a working ed, and a broken ex, and 61# the script is identical for either... -- cgd 62# 63GPROF.EX= /usr/src/lib/csu.i386/gprof.ex 64PROFILE_C= ${CC} -S -c ${CFLAGS} $< ; \ 65 ed - $*.s < ${GPROF.EX} ; \ 66 ${AS} -o $@ $*.s ; \ 67 rm -f $*.s 68 69%OBJS 70 71%CFILES 72 73%LOAD 74 75libkern.a: 76 -@if [ X${PROF} = X ]; \ 77 then ln -s $S/libkern/obj/libkern.a libkern.a; \ 78 else ln -s $S/libkern/obj/libkern_p.a libkern.a; \ 79 fi; \ 80 echo ln -s $S/libkern/obj/libkern.a libkern.a 81 82clean: 83 rm -f eddep *kernel tags *.o locore.i [a-uw-z]*.s \ 84 errs linterrs makelinks genassym ,assym.s stamp-assym 85 86#lint: /tmp param.c 87# @lint -hbxn -I. -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \ 88# ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \ 89# grep -v 'struct/union .* never defined' | \ 90# grep -v 'possible pointer alignment problem' 91 92symbols.sort: ${I386}/i386/symbols.raw 93 grep -v '^#' ${I386}/i386/symbols.raw \ 94 | sed 's/^ //' | sort -u > symbols.sort 95 96locore.o: assym.s ${I386}/i386/locore.s machine/trap.h machine/psl.h \ 97 machine/pte.h ${I386}/isa/vector.s ${I386}/isa/icu.s \ 98 $S/sys/errno.h machine/specialreg.h \ 99 ${I386}/isa/icu.h ${I386}/isa/isa.h vector.h $S/net/netisr.h \ 100 machine/asmacros.h 101 ${CPP} -I. -DLOCORE ${COPTS} ${I386}/i386/locore.s | \ 102 ${AS} ${ASFLAGS} -o locore.o 103 104exception.o: assym.s ${I386}/i386/exception.s machine/trap.h \ 105 ${I386}/isa/vector.s ${I386}/isa/icu.s \ 106 $S/sys/errno.h ${I386}/isa/icu.h ${I386}/isa/isa.h vector.h \ 107 $S/net/netisr.h machine/asmacros.h 108 ${CPP} -I. -DLOCORE ${COPTS} ${I386}/i386/exception.s | \ 109 ${AS} ${ASFLAGS} -o exception.o 110 111swtch.o: assym.s ${I386}/i386/swtch.s \ 112 $S/sys/errno.h machine/asmacros.h 113 ${CPP} -I. ${COPTS} ${I386}/i386/swtch.s | \ 114 ${AS} ${ASFLAGS} -o swtch.o 115 116support.o: assym.s ${I386}/i386/support.s \ 117 $S/sys/errno.h machine/asmacros.h 118 ${CPP} -I. ${COPTS} ${I386}/i386/support.s | \ 119 ${AS} ${ASFLAGS} -o support.o 120 121machdep.o: ${I386}/i386/machdep.c Makefile 122 ${CC} -c ${CFLAGS} -DLOAD_ADDRESS=0x${LOAD_ADDRESS} ${PROF} $< 123 124# the following is necessary because autoconf.o depends on #if GENERIC 125autoconf.o: Makefile 126 127# depend on network configuration 128af.o uipc_proto.o locore.o: Makefile 129 130# depends on KDB (cons.o also depends on GENERIC) 131trap.o cons.o: Makefile 132 133assym.s: genassym 134 ./genassym >,assym.s 135 if cmp -s assym.s ,assym.s; then \ 136 rm -f ,assym.s; \ 137 else \ 138 rm -f assym.s; \ 139 mv ,assym.s assym.s; \ 140 fi 141 142# Some of the defines that genassym outputs may well depend on the 143# value of kernel options. 144genassym: Makefile 145 ${CC} ${INCLUDES} -DKERNEL ${IDENT} ${PARAM} \ 146 ${I386}/i386/genassym.c -static -o genassym 147 148depend: assym.s param.c vnode_if.h 149 sh /usr/bin/mkdep -DLOAD_ADDRESS=0x${LOAD_ADDRESS} ${COPTS} ${CFILES} ioconf.c param.c ${I386}/i386/conf.c 150 sh /usr/bin/mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${I386}/i386/genassym.c 151 152links: 153 egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 154 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 155 echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 156 sort -u | comm -23 - dontlink | \ 157 sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks 158 sh makelinks && rm -f dontlink 159 160tags: 161 @echo "see $S/kern/Makefile for tags" 162 163ioconf.o: ioconf.c $S/sys/param.h machine/pte.h $S/sys/buf.h \ 164 ${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h 165 ${CC} -c ${CFLAGS} ioconf.c 166 167conf.o: ${I386}/i386/conf.c $S/sys/conf.h 168 ${CC} -c ${CFLAGS} ${I386}/i386/conf.c 169 170param.c: $S/conf/param.c 171 -rm -f param.c 172 cp $S/conf/param.c . 173 174param.o: param.c Makefile 175 ${CC} -c ${CFLAGS} ${PARAM} param.c 176 177vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 178 sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT} 179 ${CC} ${CFLAGS} -c vers.c 180 181vnode_if.c: $S/kern/vnode_if.sh $S/kern/vnode_if.src 182 sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 183vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src 184 sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 185 186%RULES 187 188# DO NOT DELETE THIS LINE -- make depend uses it 189 190