Makefile.powerpc revision 715
14Srgrimes# Copyright 1990 W. Jolitz
2509Srgrimes#	from: @(#)Makefile.i386	7.1 5/10/91
3715Swollman#	$Id: Makefile.i386,v 1.11 1993/11/07 04:41:11 wollman Exp $
44Srgrimes#
5509Srgrimes# Makefile for FreeBSD
6509Srgrimes#
74Srgrimes# This makefile is constructed from a machine description:
84Srgrimes#	config machineid
94Srgrimes# Most changes should be made in the machine description
104Srgrimes#	/sys/i386/conf/``machineid''
114Srgrimes# after which you should do
124Srgrimes#	 config machineid
134Srgrimes# Generic makefile changes should be made in
144Srgrimes#	/sys/i386/conf/Makefile.i386
154Srgrimes# after which config should be rerun for all machines.
164Srgrimes#
174Srgrimes# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE INVISIBLE TO MAKEFILE
184Srgrimes#	IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
194Srgrimes#
204Srgrimes# -DTRACE	compile in kernel tracing hooks
214Srgrimes# -DQUOTA	compile in file system quotas
224Srgrimes#
234SrgrimesTOUCH=	touch -f -c
244SrgrimesLD=	/usr/bin/ld
254SrgrimesCC=	cc 
264SrgrimesCPP=	cpp
27509SrgrimesSTRIP=	strip
28509SrgrimesDBSYM=	/usr/sbin/dbsym
294Srgrimes
304SrgrimesS=	../..
314SrgrimesI386=	../../i386
324Srgrimes
33712SwollmanCWARNFLAGS=
34712SwollmanCOPTFLAGS=-O
354SrgrimesINCLUDES= -I. -I$S -I$S/sys
364SrgrimesCOPTS=	${INCLUDES} ${IDENT} -DKERNEL -Di386 -DNPX
374SrgrimesASFLAGS=
38712SwollmanCFLAGS=	${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS}
39509SrgrimesLOAD_ADDRESS?=	FE000000
404Srgrimes
414SrgrimesNORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $<
424SrgrimesNORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
434SrgrimesNORMAL_S= ${CPP} -I. -DLOCORE ${COPTS} $< | ${AS} ${ASFLAGS} -o $*.o
444SrgrimesDRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $<
454SrgrimesDRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
46603SrgrimesSYSTEM_OBJS=locore.o ${OBJS} param.o ioconf.o conf.o machdep.o
474SrgrimesSYSTEM_DEP=Makefile symbols.sort ${SYSTEM_OBJS}
484SrgrimesSYSTEM_LD_HEAD= 	@echo loading $@; rm -f $@
49509SrgrimesSYSTEM_LD= @${LD} -z -T ${LOAD_ADDRESS} -o $@ -X vers.o ${SYSTEM_OBJS}
504SrgrimesSYSTEM_LD_TAIL= @echo rearranging symbols; symorder symbols.sort $@; \
51509Srgrimes	${DBSYM} -fT ${LOAD_ADDRESS} $@; ${STRIP} -x $@; size $@; chmod 755 $@
524Srgrimes
53509Srgrimes# (XXX) ok, this is weird.  but we've got a working ed, and a broken ex, and
54509Srgrimes# the script is identical for either... -- cgd
55509Srgrimes#
564SrgrimesGPROF.EX=	/usr/src/lib/csu.i386/gprof.ex
574SrgrimesPROFILE_C=	${CC} -S -c ${CFLAGS} $< ; \
58509Srgrimes		ed - $*.s < ${GPROF.EX} ; \
594Srgrimes		${AS} -o $@ $*.s ; \
604Srgrimes		rm -f $*.s
614Srgrimes
624Srgrimes%OBJS
634Srgrimes
644Srgrimes%CFILES
654Srgrimes
664Srgrimes%LOAD
674Srgrimes
684Srgrimesclean:
694Srgrimes	rm -f eddep *386bsd tags *.o locore.i [a-uw-z]*.s \
70715Swollman		errs linterrs makelinks genassym ,assym.s stamp-assym
714Srgrimes
72715Swollman#lint: /tmp param.c
73715Swollman#	@lint -hbxn -I. -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \
74715Swollman#	  ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \
75715Swollman#	    grep -v 'struct/union .* never defined' | \
76715Swollman#	    grep -v 'possible pointer alignment problem'
774Srgrimes
784Srgrimessymbols.sort: ${I386}/i386/symbols.raw
794Srgrimes	grep -v '^#' ${I386}/i386/symbols.raw \
804Srgrimes	    | sed 's/^	//' | sort -u > symbols.sort
814Srgrimes
824Srgrimeslocore.o: assym.s ${I386}/i386/locore.s machine/trap.h machine/psl.h \
834Srgrimes	machine/pte.h ${I386}/isa/vector.s ${I386}/isa/icu.s \
844Srgrimes	$S/sys/errno.h machine/specialreg.h ${I386}/isa/debug.h \
854Srgrimes	${I386}/isa/icu.h ${I386}/isa/isa.h vector.h $S/net/netisr.h
864Srgrimes	${CPP} -I. -DLOCORE ${COPTS} ${I386}/i386/locore.s | \
874Srgrimes		${AS} ${ASFLAGS} -o locore.o
884Srgrimes
89509Srgrimesmachdep.o: ${I386}/i386/machdep.c Makefile
90509Srgrimes	${CC} -c ${CFLAGS} -DLOAD_ADDRESS=0x${LOAD_ADDRESS} ${PROF} $<
91509Srgrimes
924Srgrimes# the following is necessary because autoconf.o depends on #if GENERIC
934Srgrimesautoconf.o: Makefile
944Srgrimes
954Srgrimes# depend on network configuration
964Srgrimesaf.o uipc_proto.o locore.o: Makefile
974Srgrimes
984Srgrimes# depends on KDB (cons.o also depends on GENERIC)
994Srgrimestrap.o cons.o: Makefile
1004Srgrimes
101649Snateassym.s: genassym
102715Swollman	./genassym >,assym.s
103715Swollman	if cmp -s assym.s ,assym.s; then \
104715Swollman		rm -f ,assym.s; \
105715Swollman	else \
106715Swollman		rm -f assym.s; \
107715Swollman		mv ,assym.s assym.s; \
108715Swollman	fi
1094Srgrimes
110715Swollman# Some of the defines that genassym outputs may well depend on the 
111715Swollman# value of kernel options.
112715Swollmangenassym:	Makefile
1134Srgrimes	${CC} ${INCLUDES} -DKERNEL ${IDENT} ${PARAM} \
114648Snate		 ${I386}/i386/genassym.c -o genassym
1154Srgrimes
1164Srgrimesdepend: assym.s param.c
117509Srgrimes	sh /usr/bin/mkdep -DLOAD_ADDRESS=0x${LOAD_ADDRESS} ${COPTS} ${CFILES} ioconf.c param.c ${I386}/i386/conf.c
1184Srgrimes	sh /usr/bin/mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${I386}/i386/genassym.c
1194Srgrimes
1204Srgrimeslinks:
1214Srgrimes	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
1224Srgrimes	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
1234Srgrimes	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
1244Srgrimes	  sort -u | comm -23 - dontlink | \
1254Srgrimes	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
1264Srgrimes	sh makelinks && rm -f dontlink
1274Srgrimes
1284Srgrimestags:
1294Srgrimes	@echo "see $S/kern/Makefile for tags"
1304Srgrimes
1314Srgrimesioconf.o: ioconf.c $S/sys/param.h machine/pte.h $S/sys/buf.h \
1324Srgrimes    ${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h
1334Srgrimes	${CC} -c ${CFLAGS} ioconf.c
1344Srgrimes
135509Srgrimesconf.o: ${I386}/i386/conf.c
1364Srgrimes	${CC} -traditional -c ${CFLAGS} ${I386}/i386/conf.c
1374Srgrimes
138509Srgrimesparam.c: $S/conf/param.c
1394Srgrimes	-rm -f param.c
1404Srgrimes	cp $S/conf/param.c .
1414Srgrimes
1424Srgrimesparam.o: param.c Makefile
1434Srgrimes	${CC} -c ${CFLAGS} ${PARAM} param.c
1444Srgrimes
145509Srgrimesvers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
1464Srgrimes	sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT}
1474Srgrimes	${CC} ${CFLAGS} -c vers.c
1484Srgrimes
1494Srgrimes%RULES
1504Srgrimes
1514Srgrimes# DO NOT DELETE THIS LINE -- make depend uses it
1524Srgrimes
153