Makefile.powerpc revision 757
14Srgrimes# Copyright 1990 W. Jolitz
2509Srgrimes#	from: @(#)Makefile.i386	7.1 5/10/91
32627Swollman#	$Id: Makefile.i386,v 1.12 1993/11/07 16:46:33 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
284SrgrimesDBSYM=	/usr/sbin/dbsym
292056Swollman
302056SwollmanS=	../..
312056SwollmanI386=	../../i386
324Srgrimes
332056SwollmanCWARNFLAGS=
342056SwollmanCOPTFLAGS=-O
354SrgrimesINCLUDES= -I. -I$S -I$S/sys
362112SwollmanCOPTS=	${INCLUDES} ${IDENT} -DKERNEL -Di386 -DNPX
37798SwollmanASFLAGS=
382408SbdeCFLAGS=	${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS}
392408SbdeLOAD_ADDRESS?=	FE000000
40798Swollman
41798SwollmanNORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $<
42798SwollmanNORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
43798SwollmanNORMAL_S= ${CPP} -I. -DLOCORE ${COPTS} $< | ${AS} ${ASFLAGS} -o $*.o
44712SwollmanDRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $<
454SrgrimesDRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
462408SbdeSYSTEM_OBJS=locore.o exception.o swtch.o support.o ${OBJS} param.o \
474Srgrimes	ioconf.o conf.o machdep.o
48712SwollmanSYSTEM_DEP=Makefile symbols.sort ${SYSTEM_OBJS}
49974SdgSYSTEM_LD_HEAD= 	@echo loading $@; rm -f $@
504SrgrimesSYSTEM_LD= @${LD} -z -T ${LOAD_ADDRESS} -o $@ -X vers.o ${SYSTEM_OBJS}
514SrgrimesSYSTEM_LD_TAIL= @echo rearranging symbols; symorder symbols.sort $@; \
524Srgrimes	${DBSYM} -fT ${LOAD_ADDRESS} $@; ${STRIP} -x $@; size $@; chmod 755 $@
532408Sbde
542408Sbde# (XXX) ok, this is weird.  but we've got a working ed, and a broken ex, and
554Srgrimes# the script is identical for either... -- cgd
564Srgrimes#
574SrgrimesGPROF.EX=	/usr/src/lib/csu.i386/gprof.ex
582408SbdePROFILE_C=	${CC} -S -c ${CFLAGS} $< ; \
592408Sbde		ed - $*.s < ${GPROF.EX} ; \
602408Sbde		${AS} -o $@ $*.s ; \
612408Sbde		rm -f $*.s
622408Sbde
632408Sbde%OBJS
641549Srgrimes
654Srgrimes%CFILES
661549Srgrimes
674Srgrimes%LOAD
681891Sdg
694Srgrimesclean:
70509Srgrimes	rm -f eddep *386bsd tags *.o locore.i [a-uw-z]*.s \
71509Srgrimes		errs linterrs makelinks genassym ,assym.s stamp-assym
72509Srgrimes
734Srgrimes#lint: /tmp param.c
744Srgrimes#	@lint -hbxn -I. -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \
75509Srgrimes#	  ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \
764Srgrimes#	    grep -v 'struct/union .* never defined' | \
774Srgrimes#	    grep -v 'possible pointer alignment problem'
784Srgrimes
794Srgrimessymbols.sort: ${I386}/i386/symbols.raw
804Srgrimes	grep -v '^#' ${I386}/i386/symbols.raw \
814Srgrimes	    | sed 's/^	//' | sort -u > symbols.sort
824Srgrimes
834Srgrimeslocore.o: assym.s ${I386}/i386/locore.s machine/trap.h machine/psl.h \
844Srgrimes	machine/pte.h ${I386}/isa/vector.s ${I386}/isa/icu.s \
852232Sjkh	$S/sys/errno.h machine/specialreg.h ${I386}/isa/debug.h \
862232Sjkh	${I386}/isa/icu.h ${I386}/isa/isa.h vector.h $S/net/netisr.h \
872232Sjkh	machine/asmacros.h
882232Sjkh	${CPP} -I. -DLOCORE ${COPTS} ${I386}/i386/locore.s | \
892232Sjkh		${AS} ${ASFLAGS} -o locore.o
902232Sjkh
912232Sjkhexception.o: assym.s ${I386}/i386/exception.s machine/trap.h \
922239Sjkh	${I386}/isa/vector.s ${I386}/isa/icu.s \
932239Sjkh	$S/sys/errno.h ${I386}/isa/icu.h ${I386}/isa/isa.h vector.h \
942232Sjkh	$S/net/netisr.h machine/asmacros.h
952232Sjkh	${CPP} -I. -DLOCORE ${COPTS} ${I386}/i386/exception.s | \
962232Sjkh		${AS} ${ASFLAGS} -o exception.o
972232Sjkh
982239Sjkhswtch.o: assym.s ${I386}/i386/swtch.s \
991549Srgrimes	$S/sys/errno.h ${I386}/isa/debug.h machine/asmacros.h
1002232Sjkh	${CPP} -I. ${COPTS} ${I386}/i386/swtch.s | \
1012514Sjkh		${AS} ${ASFLAGS} -o swtch.o
1022232Sjkh
1032232Sjkhsupport.o: assym.s ${I386}/i386/support.s \
1042232Sjkh	$S/sys/errno.h machine/asmacros.h
1052232Sjkh	${CPP} -I. ${COPTS} ${I386}/i386/support.s | \
1062232Sjkh		${AS} ${ASFLAGS} -o support.o
1074Srgrimes
1081569Srgrimesmachdep.o: ${I386}/i386/machdep.c Makefile
109715Swollman	${CC} -c ${CFLAGS} -DLOAD_ADDRESS=0x${LOAD_ADDRESS} ${PROF} $<
1104Srgrimes
111715Swollman# the following is necessary because autoconf.o depends on #if GENERIC
112715Swollmanautoconf.o: Makefile
113715Swollman
114715Swollman# depend on network configuration
115715Swollmanaf.o uipc_proto.o locore.o: Makefile
1164Srgrimes
1174Srgrimes# depends on KDB (cons.o also depends on GENERIC)
1184Srgrimestrap.o cons.o: Makefile
1194Srgrimes
1204Srgrimesassym.s: genassym
1212464Sbde	./genassym >,assym.s
1222408Sbde	if cmp -s assym.s ,assym.s; then \
1234Srgrimes		rm -f ,assym.s; \
1242408Sbde	else \
1252408Sbde		rm -f assym.s; \
1262408Sbde		mv ,assym.s assym.s; \
1272408Sbde	fi
128757Sdg
1294Srgrimes# Some of the defines that genassym outputs may well depend on the 
1304Srgrimes# value of kernel options.
1314Srgrimesgenassym:	Makefile
1324Srgrimes	${CC} ${INCLUDES} -DKERNEL ${IDENT} ${PARAM} \
1334Srgrimes		 ${I386}/i386/genassym.c -o genassym
1344Srgrimes
1354Srgrimesdepend: assym.s param.c
1364Srgrimes	sh /usr/bin/mkdep -DLOAD_ADDRESS=0x${LOAD_ADDRESS} ${COPTS} ${CFILES} ioconf.c param.c ${I386}/i386/conf.c
1374Srgrimes	sh /usr/bin/mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${I386}/i386/genassym.c
1382408Sbde
1392408Sbdelinks:
1402408Sbde	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
141649Snate	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
142715Swollman	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
143715Swollman	  sort -u | comm -23 - dontlink | \
144715Swollman	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
145715Swollman	sh makelinks && rm -f dontlink
146715Swollman
147715Swollmantags:
148715Swollman	@echo "see $S/kern/Makefile for tags"
1494Srgrimes
150715Swollmanioconf.o: ioconf.c $S/sys/param.h machine/pte.h $S/sys/buf.h \
151715Swollman    ${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h
152715Swollman	${CC} -c ${CFLAGS} ioconf.c
1534Srgrimes
1541030Snateconf.o: ${I386}/i386/conf.c
1554Srgrimes	${CC} -traditional -c ${CFLAGS} ${I386}/i386/conf.c
1562408Sbde
1571549Srgrimesparam.c: $S/conf/param.c
1582408Sbde	-rm -f param.c
1592408Sbde	cp $S/conf/param.c .
1602408Sbde
1612408Sbdeparam.o: param.c Makefile
1622408Sbde	${CC} -c ${CFLAGS} ${PARAM} param.c
1634Srgrimes
1644Srgrimesvers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
1654Srgrimes	sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT}
1664Srgrimes	${CC} ${CFLAGS} -c vers.c
1674Srgrimes
1684Srgrimes%RULES
1694Srgrimes
1704Srgrimes# DO NOT DELETE THIS LINE -- make depend uses it
1714Srgrimes
1724Srgrimes