Makefile.powerpc revision 649
14Srgrimes# Copyright 1990 W. Jolitz
2509Srgrimes#	from: @(#)Makefile.i386	7.1 5/10/91
3974Sdg#	$Id: Makefile.i386,v 1.9 1993/10/23 06:46:24 nate 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
33798SwollmanINCLUDES= -I. -I$S -I$S/sys
34798SwollmanCOPTS=	${INCLUDES} ${IDENT} -DKERNEL -Di386 -DNPX
35798SwollmanASFLAGS=
36879SwollmanCFLAGS=	-O ${DEBUG} ${COPTS}
37798SwollmanLOAD_ADDRESS?=	FE000000
38798Swollman
39798SwollmanNORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $<
40798SwollmanNORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
41712SwollmanNORMAL_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 machdep.o
45712SwollmanSYSTEM_DEP=Makefile symbols.sort ${SYSTEM_OBJS}
46974SdgSYSTEM_LD_HEAD= 	@echo loading $@; rm -f $@
474SrgrimesSYSTEM_LD= @${LD} -z -T ${LOAD_ADDRESS} -o $@ -X vers.o ${SYSTEM_OBJS}
484SrgrimesSYSTEM_LD_TAIL= @echo rearranging symbols; symorder symbols.sort $@; \
494Srgrimes	${DBSYM} -fT ${LOAD_ADDRESS} $@; ${STRIP} -x $@; size $@; chmod 755 $@
504Srgrimes
514Srgrimes# (XXX) ok, this is weird.  but we've got a working ed, and a broken ex, and
524Srgrimes# the script is identical for either... -- cgd
53757Sdg#
54757SdgGPROF.EX=	/usr/src/lib/csu.i386/gprof.ex
554SrgrimesPROFILE_C=	${CC} -S -c ${CFLAGS} $< ; \
564Srgrimes		ed - $*.s < ${GPROF.EX} ; \
57849Sdg		${AS} -o $@ $*.s ; \
584Srgrimes		rm -f $*.s
59509Srgrimes
604Srgrimes%OBJS
61509Srgrimes
62509Srgrimes%CFILES
63509Srgrimes
644Srgrimes%LOAD
654Srgrimes
66509Srgrimesclean:
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 \
78715Swollman	    | sed 's/^	//' | sort -u > symbols.sort
794Srgrimes
80715Swollmanlocore.o: assym.s ${I386}/i386/locore.s machine/trap.h machine/psl.h \
81715Swollman	machine/pte.h ${I386}/isa/vector.s ${I386}/isa/icu.s \
82715Swollman	$S/sys/errno.h machine/specialreg.h ${I386}/isa/debug.h \
83715Swollman	${I386}/isa/icu.h ${I386}/isa/isa.h vector.h $S/net/netisr.h
84715Swollman	${CPP} -I. -DLOCORE ${COPTS} ${I386}/i386/locore.s | \
854Srgrimes		${AS} ${ASFLAGS} -o locore.o
864Srgrimes
874Srgrimesmachdep.o: ${I386}/i386/machdep.c Makefile
884Srgrimes	${CC} -c ${CFLAGS} -DLOAD_ADDRESS=0x${LOAD_ADDRESS} ${PROF} $<
894Srgrimes
904Srgrimes# the following is necessary because autoconf.o depends on #if GENERIC
914Srgrimesautoconf.o: Makefile
924Srgrimes
93757Sdg# depend on network configuration
94757Sdgaf.o uipc_proto.o locore.o: Makefile
954Srgrimes
964Srgrimes# depend on maxusers
974Srgrimesassym.s: Makefile
98757Sdg
99757Sdg# depends on KDB (cons.o also depends on GENERIC)
100757Sdgtrap.o cons.o: Makefile
101757Sdg
102757Sdgassym.s: genassym
103757Sdg	./genassym >assym.s
104757Sdg
105757Sdggenassym:
106757Sdg	${CC} ${INCLUDES} -DKERNEL ${IDENT} ${PARAM} \
107757Sdg		 ${I386}/i386/genassym.c -o genassym
108757Sdg
109757Sdgdepend: assym.s param.c
110757Sdg	sh /usr/bin/mkdep -DLOAD_ADDRESS=0x${LOAD_ADDRESS} ${COPTS} ${CFILES} ioconf.c param.c ${I386}/i386/conf.c
111757Sdg	sh /usr/bin/mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${I386}/i386/genassym.c
112757Sdg
113757Sdglinks:
114757Sdg	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
115509Srgrimes	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
116509Srgrimes	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
117509Srgrimes	  sort -u | comm -23 - dontlink | \
1184Srgrimes	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
1194Srgrimes	sh makelinks && rm -f dontlink
1204Srgrimes
1214Srgrimestags:
1224Srgrimes	@echo "see $S/kern/Makefile for tags"
1234Srgrimes
1244Srgrimesioconf.o: ioconf.c $S/sys/param.h machine/pte.h $S/sys/buf.h \
1254Srgrimes    ${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h
1264Srgrimes	${CC} -c ${CFLAGS} ioconf.c
127649Snate
128715Swollmanconf.o: ${I386}/i386/conf.c
129715Swollman	${CC} -traditional -c ${CFLAGS} ${I386}/i386/conf.c
130715Swollman
131715Swollmanparam.c: $S/conf/param.c
132715Swollman	-rm -f param.c
133715Swollman	cp $S/conf/param.c .
134715Swollman
1354Srgrimesparam.o: param.c Makefile
136715Swollman	${CC} -c ${CFLAGS} ${PARAM} param.c
137715Swollman
138715Swollmanvers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
1394Srgrimes	sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT}
140648Snate	${CC} ${CFLAGS} -c vers.c
1414Srgrimes
1424Srgrimes%RULES
143509Srgrimes
1444Srgrimes# DO NOT DELETE THIS LINE -- make depend uses it
1454Srgrimes
1464Srgrimes