Makefile.powerpc revision 509
14Srgrimes# Copyright 1990 W. Jolitz
2509Srgrimes#	from: @(#)Makefile.i386	7.1 5/10/91
3509Srgrimes#	$Id$
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
334SrgrimesINCLUDES= -I. -I$S -I$S/sys
344SrgrimesCOPTS=	${INCLUDES} ${IDENT} -DKERNEL -Di386 -DNPX
354SrgrimesASFLAGS=
36241SnateCFLAGS=	-O ${DEBUG} ${COPTS}
37509SrgrimesLOAD_ADDRESS?=	FE000000
384Srgrimes
394SrgrimesNORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $<
404SrgrimesNORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
414SrgrimesNORMAL_S= ${CPP} -I. -DLOCORE ${COPTS} $< | ${AS} ${ASFLAGS} -o $*.o
424SrgrimesDRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $<
434SrgrimesDRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
444SrgrimesSYSTEM_OBJS=locore.o ${OBJS} param.o ioconf.o conf.o
454SrgrimesSYSTEM_DEP=Makefile symbols.sort ${SYSTEM_OBJS}
464SrgrimesSYSTEM_LD_HEAD= 	@echo loading $@; rm -f $@
47509SrgrimesSYSTEM_LD= @${LD} -z -T ${LOAD_ADDRESS} -o $@ -X vers.o ${SYSTEM_OBJS}
484SrgrimesSYSTEM_LD_TAIL= @echo rearranging symbols; symorder symbols.sort $@; \
49509Srgrimes	${DBSYM} -fT ${LOAD_ADDRESS} $@; ${STRIP} -x $@; size $@; chmod 755 $@
504Srgrimes
51509Srgrimes# (XXX) ok, this is weird.  but we've got a working ed, and a broken ex, and
52509Srgrimes# the script is identical for either... -- cgd
53509Srgrimes#
544SrgrimesGPROF.EX=	/usr/src/lib/csu.i386/gprof.ex
554SrgrimesPROFILE_C=	${CC} -S -c ${CFLAGS} $< ; \
56509Srgrimes		ed - $*.s < ${GPROF.EX} ; \
574Srgrimes		${AS} -o $@ $*.s ; \
584Srgrimes		rm -f $*.s
594Srgrimes
604Srgrimes%OBJS
614Srgrimes
624Srgrimes%CFILES
634Srgrimes
644Srgrimes%LOAD
654Srgrimes
664Srgrimesclean:
674Srgrimes	rm -f eddep *386bsd tags *.o locore.i [a-uw-z]*.s \
684Srgrimes		errs linterrs makelinks genassym
694Srgrimes
704Srgrimeslint: /tmp param.c
714Srgrimes	@lint -hbxn -I. -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \
724Srgrimes	  ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \
734Srgrimes	    grep -v 'struct/union .* never defined' | \
744Srgrimes	    grep -v 'possible pointer alignment problem'
754Srgrimes
764Srgrimessymbols.sort: ${I386}/i386/symbols.raw
774Srgrimes	grep -v '^#' ${I386}/i386/symbols.raw \
784Srgrimes	    | sed 's/^	//' | sort -u > symbols.sort
794Srgrimes
804Srgrimeslocore.o: assym.s ${I386}/i386/locore.s machine/trap.h machine/psl.h \
814Srgrimes	machine/pte.h ${I386}/isa/vector.s ${I386}/isa/icu.s \
824Srgrimes	$S/sys/errno.h machine/specialreg.h ${I386}/isa/debug.h \
834Srgrimes	${I386}/isa/icu.h ${I386}/isa/isa.h vector.h $S/net/netisr.h
844Srgrimes	${CPP} -I. -DLOCORE ${COPTS} ${I386}/i386/locore.s | \
854Srgrimes		${AS} ${ASFLAGS} -o locore.o
864Srgrimes
87509Srgrimesmachdep.o: ${I386}/i386/machdep.c Makefile
88509Srgrimes	${CC} -c ${CFLAGS} -DLOAD_ADDRESS=0x${LOAD_ADDRESS} ${PROF} $<
89509Srgrimes
904Srgrimes# the following is necessary because autoconf.o depends on #if GENERIC
914Srgrimesautoconf.o: Makefile
924Srgrimes
934Srgrimes# depend on network configuration
944Srgrimesaf.o uipc_proto.o locore.o: Makefile
954Srgrimes
964Srgrimes# depend on maxusers
974Srgrimesassym.s machdep.o: Makefile
984Srgrimes
994Srgrimes# depends on KDB (cons.o also depends on GENERIC)
1004Srgrimestrap.o cons.o: Makefile
1014Srgrimes
1024Srgrimesassym.s: $S/sys/param.h machine/pte.h $S/sys/buf.h \
1034Srgrimes    $S/sys/vmmeter.h \
1044Srgrimes    $S/sys/proc.h $S/sys/msgbuf.h machine/vmparam.h
1054Srgrimes
1064Srgrimesassym.s: genassym
1074Srgrimes	./genassym >assym.s
1084Srgrimes
1094Srgrimesgenassym:
1104Srgrimes	${CC} ${INCLUDES} -DKERNEL ${IDENT} ${PARAM} \
1114Srgrimes		 ${I386}/i386/genassym.c -o genassym
1124Srgrimes
1134Srgrimesdepend: assym.s param.c
114509Srgrimes	sh /usr/bin/mkdep -DLOAD_ADDRESS=0x${LOAD_ADDRESS} ${COPTS} ${CFILES} ioconf.c param.c ${I386}/i386/conf.c
1154Srgrimes	sh /usr/bin/mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${I386}/i386/genassym.c
1164Srgrimes
1174Srgrimeslinks:
1184Srgrimes	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
1194Srgrimes	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
1204Srgrimes	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
1214Srgrimes	  sort -u | comm -23 - dontlink | \
1224Srgrimes	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
1234Srgrimes	sh makelinks && rm -f dontlink
1244Srgrimes
1254Srgrimestags:
1264Srgrimes	@echo "see $S/kern/Makefile for tags"
1274Srgrimes
1284Srgrimesioconf.o: ioconf.c $S/sys/param.h machine/pte.h $S/sys/buf.h \
1294Srgrimes    ${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h
1304Srgrimes	${CC} -c ${CFLAGS} ioconf.c
1314Srgrimes
132509Srgrimesconf.o: ${I386}/i386/conf.c
1334Srgrimes	${CC} -traditional -c ${CFLAGS} ${I386}/i386/conf.c
1344Srgrimes
135509Srgrimesparam.c: $S/conf/param.c
1364Srgrimes	-rm -f param.c
1374Srgrimes	cp $S/conf/param.c .
1384Srgrimes
1394Srgrimesparam.o: param.c Makefile
1404Srgrimes	${CC} -c ${CFLAGS} ${PARAM} param.c
1414Srgrimes
142509Srgrimesvers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
1434Srgrimes	sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT}
1444Srgrimes	${CC} ${CFLAGS} -c vers.c
1454Srgrimes
1464Srgrimes%RULES
1474Srgrimes
1484Srgrimes# DO NOT DELETE THIS LINE -- make depend uses it
1494Srgrimes
150