Makefile.powerpc revision 770
194536Sobrien# Copyright 1990 W. Jolitz
238889Sjdp#	from: @(#)Makefile.i386	7.1 5/10/91
394536Sobrien#	$Id: Makefile.i386,v 1.14 1993/11/15 21:06:08 paul Exp $
438889Sjdp#
538889Sjdp# Makefile for FreeBSD
638889Sjdp#
738889Sjdp# This makefile is constructed from a machine description:
833965Sjdp#	config machineid
938889Sjdp# Most changes should be made in the machine description
1038889Sjdp#	/sys/i386/conf/``machineid''
1138889Sjdp# after which you should do
1233965Sjdp#	 config machineid
1338889Sjdp# Generic makefile changes should be made in
1438889Sjdp#	/sys/i386/conf/Makefile.i386
1538889Sjdp# after which config should be rerun for all machines.
1638889Sjdp#
1738889Sjdp# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE INVISIBLE TO MAKEFILE
1833965Sjdp#	IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
1933965Sjdp#
2038889Sjdp# -DTRACE	compile in kernel tracing hooks
2133965Sjdp# -DQUOTA	compile in file system quotas
2233965Sjdp#
2338889SjdpTOUCH=	touch -f -c
2438889SjdpLD=	/usr/bin/ld
2538889SjdpCC=	cc 
2638889SjdpCPP=	cpp
2738889SjdpSTRIP=	strip
2838889SjdpDBSYM=	/usr/sbin/dbsym
2933965Sjdp
3038889SjdpS=	../..
3133965SjdpI386=	../../i386
3233965Sjdp
3338889SjdpCWARNFLAGS=
3433965SjdpCOPTFLAGS=-O
3560484SobrienINCLUDES= -I. -I$S -I$S/sys
3660484SobrienCOPTS=	${INCLUDES} ${IDENT} -DKERNEL -Di386 -DNPX
3738889SjdpASFLAGS=
3838889SjdpCFLAGS=	${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS}
3938889SjdpLOAD_ADDRESS?=	FE000000
4033965Sjdp
4138889SjdpNORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $<
4238889SjdpNORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
4338889SjdpNORMAL_S= ${CPP} -I. -DLOCORE ${COPTS} $< | ${AS} ${ASFLAGS} -o $*.o
4438889SjdpDRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $<
4538889SjdpDRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
4638889SjdpSYSTEM_OBJS=locore.o exception.o swtch.o support.o ${OBJS} param.o \
4738889Sjdp	ioconf.o conf.o machdep.o
4833965SjdpSYSTEM_DEP=Makefile symbols.sort ${SYSTEM_OBJS}
4960484SobrienSYSTEM_LD_HEAD= 	@echo loading $@; rm -f $@
5033965SjdpSYSTEM_LD= @${LD} -z -T ${LOAD_ADDRESS} -o $@ -X vers.o ${SYSTEM_OBJS}
5138889SjdpSYSTEM_LD_TAIL= @echo rearranging symbols; symorder symbols.sort $@; \
5238889Sjdp	${DBSYM} -fT ${LOAD_ADDRESS} $@; ${STRIP} -x $@; size $@; chmod 755 $@
5333965Sjdp
5438889Sjdp# (XXX) ok, this is weird.  but we've got a working ed, and a broken ex, and
5538889Sjdp# the script is identical for either... -- cgd
5638889Sjdp#
5738889SjdpGPROF.EX=	/usr/src/lib/csu.i386/gprof.ex
5838889SjdpPROFILE_C=	${CC} -S -c ${CFLAGS} $< ; \
5938889Sjdp		ed - $*.s < ${GPROF.EX} ; \
6038889Sjdp		${AS} -o $@ $*.s ; \
6138889Sjdp		rm -f $*.s
6238889Sjdp
6338889Sjdp%OBJS
6438889Sjdp
6538889Sjdp%CFILES
6633965Sjdp
6760484Sobrien%LOAD
6838889Sjdp
6938889Sjdpclean:
7038889Sjdp	rm -f eddep *386bsd tags *.o locore.i [a-uw-z]*.s \
7138889Sjdp		errs linterrs makelinks genassym ,assym.s stamp-assym
7260484Sobrien
7360484Sobrien#lint: /tmp param.c
7433965Sjdp#	@lint -hbxn -I. -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \
7538889Sjdp#	  ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \
7638889Sjdp#	    grep -v 'struct/union .* never defined' | \
7738889Sjdp#	    grep -v 'possible pointer alignment problem'
7877298Sobrien
7977298Sobriensymbols.sort: ${I386}/i386/symbols.raw
8060484Sobrien	grep -v '^#' ${I386}/i386/symbols.raw \
8160484Sobrien	    | sed 's/^	//' | sort -u > symbols.sort
8238889Sjdp
8338889Sjdplocore.o: assym.s ${I386}/i386/locore.s machine/trap.h machine/psl.h \
8477298Sobrien	machine/pte.h ${I386}/isa/vector.s ${I386}/isa/icu.s \
8577298Sobrien	$S/sys/errno.h machine/specialreg.h ${I386}/isa/debug.h \
8660484Sobrien	${I386}/isa/icu.h ${I386}/isa/isa.h vector.h $S/net/netisr.h \
8760484Sobrien	machine/asmacros.h
8860484Sobrien	${CPP} -I. -DLOCORE ${COPTS} ${I386}/i386/locore.s | \
8960484Sobrien		${AS} ${ASFLAGS} -o locore.o
9038889Sjdp
9160484Sobrienexception.o: assym.s ${I386}/i386/exception.s machine/trap.h \
9260484Sobrien	${I386}/isa/vector.s ${I386}/isa/icu.s \
9360484Sobrien	$S/sys/errno.h ${I386}/isa/icu.h ${I386}/isa/isa.h vector.h \
9460484Sobrien	$S/net/netisr.h machine/asmacros.h
9560484Sobrien	${CPP} -I. -DLOCORE ${COPTS} ${I386}/i386/exception.s | \
9638889Sjdp		${AS} ${ASFLAGS} -o exception.o
9738889Sjdp
9838889Sjdpswtch.o: assym.s ${I386}/i386/swtch.s \
9938889Sjdp	$S/sys/errno.h ${I386}/isa/debug.h machine/asmacros.h
10060484Sobrien	${CPP} -I. ${COPTS} ${I386}/i386/swtch.s | \
10160484Sobrien		${AS} ${ASFLAGS} -o swtch.o
10260484Sobrien
10377298Sobriensupport.o: assym.s ${I386}/i386/support.s \
10438889Sjdp	$S/sys/errno.h machine/asmacros.h
10560484Sobrien	${CPP} -I. ${COPTS} ${I386}/i386/support.s | \
10660484Sobrien		${AS} ${ASFLAGS} -o support.o
10733965Sjdp
10877298Sobrienmachdep.o: ${I386}/i386/machdep.c Makefile
10938889Sjdp	${CC} -c ${CFLAGS} -DLOAD_ADDRESS=0x${LOAD_ADDRESS} ${PROF} $<
11060484Sobrien
11160484Sobrien# the following is necessary because autoconf.o depends on #if GENERIC
11238889Sjdpautoconf.o: Makefile
11360484Sobrien
11460484Sobrien# depend on network configuration
11538889Sjdpaf.o uipc_proto.o locore.o: Makefile
11638889Sjdp
11789857Sobrien# depends on KDB (cons.o also depends on GENERIC)
11889857Sobrientrap.o cons.o: Makefile
11938889Sjdp
12089857Sobrienassym.s: genassym
12189857Sobrien	./genassym >,assym.s
12289857Sobrien	if cmp -s assym.s ,assym.s; then \
12360484Sobrien		rm -f ,assym.s; \
12438889Sjdp	else \
12538889Sjdp		rm -f assym.s; \
12633965Sjdp		mv ,assym.s assym.s; \
12738889Sjdp	fi
12833965Sjdp
12933965Sjdp# Some of the defines that genassym outputs may well depend on the 
13033965Sjdp# value of kernel options.
13160484Sobriengenassym:	Makefile
13233965Sjdp	${CC} ${INCLUDES} -DKERNEL ${IDENT} ${PARAM} \
13360484Sobrien		 ${I386}/i386/genassym.c -o genassym
13433965Sjdp
13538889Sjdpdepend: assym.s param.c
136104834Sobrien	sh /usr/bin/mkdep -DLOAD_ADDRESS=0x${LOAD_ADDRESS} ${COPTS} ${CFILES} ioconf.c param.c ${I386}/i386/conf.c
137104834Sobrien	sh /usr/bin/mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${I386}/i386/genassym.c
13833965Sjdp
139104834Sobrienlinks:
14038889Sjdp	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
14177298Sobrien	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
14277298Sobrien	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
14377298Sobrien	  sort -u | comm -23 - dontlink | \
14433965Sjdp	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
14533965Sjdp	sh makelinks && rm -f dontlink
14633965Sjdp
14738889Sjdptags:
14833965Sjdp	@echo "see $S/kern/Makefile for tags"
14933965Sjdp
15033965Sjdpioconf.o: ioconf.c $S/sys/param.h machine/pte.h $S/sys/buf.h \
15133965Sjdp    ${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h
15233965Sjdp	${CC} -c ${CFLAGS} ioconf.c
15333965Sjdp
15489857Sobrienconf.o: ${I386}/i386/conf.c
15578828Sobrien	${CC} -traditional -c ${CFLAGS} ${I386}/i386/conf.c
15678828Sobrien
15778828Sobrienparam.c: $S/conf/param.c
15878828Sobrien	-rm -f param.c
15989857Sobrien	cp $S/conf/param.c .
16033965Sjdp
16160484Sobrienparam.o: param.c Makefile
16289857Sobrien	${CC} -c ${CFLAGS} ${PARAM} param.c
16389857Sobrien
16489857Sobrienvers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
16578828Sobrien	sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT}
16678828Sobrien	${CC} ${CFLAGS} -c vers.c
16778828Sobrien
16878828Sobrien%RULES
16989857Sobrien
17033965Sjdp# DO NOT DELETE THIS LINE -- make depend uses it
17160484Sobrien
17289857Sobrien