Makefile.alpha revision 1.24
11.24Smycroft#	$NetBSD: Makefile.alpha,v 1.24 1996/09/09 21:06:55 mycroft Exp $
21.10Smycroft
31.1Scgd# Makefile for NetBSD
41.1Scgd#
51.1Scgd# This makefile is constructed from a machine description:
61.1Scgd#	config machineid
71.1Scgd# Most changes should be made in the machine description
81.10Smycroft#	/sys/arch/alpha/conf/``machineid''
91.1Scgd# after which you should do
101.10Smycroft#	config machineid
111.1Scgd# Machine generic makefile changes should be made in
121.10Smycroft#	/sys/arch/alpha/conf/Makefile.alpha
131.1Scgd# after which config should be rerun for all machines of that type.
141.1Scgd#
151.1Scgd# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
161.1Scgd#	IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
171.1Scgd#
181.1Scgd# -DTRACE	compile in kernel tracing hooks
191.1Scgd# -DQUOTA	compile in file system quotas
201.1Scgd
211.1Scgd# DEBUG is set to -g if debugging.
221.1Scgd# PROF is set to -pg if profiling.
231.1Scgd
241.13SmycroftCC?=	cc
251.13SmycroftLD?=	ld
261.19SmycroftMKDEP?=	mkdep
271.24SmycroftSTRIP?=	strip
281.1Scgd
291.1Scgd# source tree is located via $S relative to the compilation directory
301.23Smycroft.ifndef S
311.19SmycroftS!=	cd ../../../..; pwd
321.23Smycroft.endif
331.19SmycroftALPHA=	$S/arch/alpha
341.1Scgd
351.20SmycroftINCLUDES=	-I. -I$S/arch -I$S -nostdinc
361.21SmycroftCPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL \
371.21Smycroft		-Dalpha
381.22ScgdCWARNFLAGS?=	-Werror -Wall -Wstrict-prototypes -Wmissing-prototypes
391.19SmycroftCFLAGS=		${DEBUG} ${CWARNFLAGS} -O2 -mno-fp-regs
401.12SmycroftAFLAGS=		-x assembler-with-cpp -traditional-cpp -D_LOCORE
411.10SmycroftLINKFLAGS=	-N -Ttext fffffc0000230000 -e __start -G 4
421.24SmycroftSTRIPFLAGS=	-g -X -x
431.24Smycroft
441.24SmycroftHOSTED_CC=	${CC}
451.24SmycroftHOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
461.24SmycroftHOSTED_CFLAGS=	${CFLAGS}
471.1Scgd
481.1Scgd### find out what to use for libkern
491.1Scgd.include "$S/lib/libkern/Makefile.inc"
501.1Scgd.ifndef PROF
511.1ScgdLIBKERN=	${KERNLIB}
521.1Scgd.else
531.1ScgdLIBKERN=	${KERNLIB_PROF}
541.1Scgd.endif
551.1Scgd
561.5Schristos### find out what to use for libcompat
571.5Schristos.include "$S/compat/common/Makefile.inc"
581.5Schristos.ifndef PROF
591.5SchristosLIBCOMPAT=	${COMPATLIB}
601.5Schristos.else
611.5SchristosLIBCOMPAT=	${COMPATLIB_PROF}
621.5Schristos.endif
631.5Schristos
641.21Smycroft# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
651.21Smycroft# HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
661.1Scgd
671.10SmycroftNORMAL_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
681.12SmycroftNORMAL_S=	${CC} ${AFLAGS} ${CPPFLAGS} -c $<
691.1Scgd
701.24SmycroftHOSTED_C=	${HOSTED_CC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $<
711.20Smycroft
721.1Scgd%OBJS
731.1Scgd
741.1Scgd%CFILES
751.1Scgd
761.10Smycroft%SFILES
771.10Smycroft
781.1Scgd# load lines for config "xxx" will be emitted as:
791.1Scgd# xxx: ${SYSTEM_DEP} swapxxx.o
801.1Scgd#	${SYSTEM_LD_HEAD}
811.1Scgd#	${SYSTEM_LD} swapxxx.o
821.1Scgd#	${SYSTEM_LD_TAIL}
831.10SmycroftSYSTEM_OBJ=	locore.o \
841.14Scgd		param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
851.1ScgdSYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
861.10SmycroftSYSTEM_LD_HEAD=	@rm -f $@
871.10SmycroftSYSTEM_LD=	@echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
881.10Smycroft		${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
891.1ScgdSYSTEM_LD_TAIL=	@size $@; chmod 755 $@
901.10Smycroft
911.10SmycroftDEBUG?=
921.8Scgd.if ${DEBUG} == "-g"
931.10SmycroftLINKFLAGS+=	-X
941.10SmycroftSYSTEM_LD_TAIL+=; \
951.10Smycroft		echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
961.24Smycroft		echo ${STRIP} ${STRIPFLAGS} $@; ${STRIP} ${STRIPFLAGS} $@
971.8Scgd.else
981.19SmycroftLINKFLAGS+=	-S
991.8Scgd.endif
1001.1Scgd
1011.1Scgd%LOAD
1021.1Scgd
1031.10Smycroftassym.h: genassym
1041.10Smycroft	./genassym >assym.h
1051.10Smycroft
1061.10Smycroftgenassym: genassym.o
1071.10Smycroft	${CC} -o $@ genassym.o
1081.10Smycroft
1091.10Smycroftgenassym.o: ${ALPHA}/alpha/genassym.c
1101.21Smycroft	${HOSTED_C}
1111.10Smycroft
1121.10Smycroftparam.c: $S/conf/param.c
1131.10Smycroft	rm -f param.c
1141.10Smycroft	cp $S/conf/param.c .
1151.1Scgd
1161.10Smycroftparam.o: param.c Makefile
1171.21Smycroft	${NORMAL_C}
1181.1Scgd
1191.10Smycroftioconf.o: ioconf.c
1201.10Smycroft	${NORMAL_C}
1211.1Scgd
1221.10Smycroftnewvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
1231.10Smycroft	sh $S/conf/newvers.sh
1241.10Smycroft	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
1251.1Scgd
1261.1Scgd
1271.10Smycroftclean::
1281.14Scgd	rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
1291.10Smycroft	    [Ee]rrs linterrs makelinks genassym genassym.o assym.h
1301.1Scgd
1311.10Smycroftlint:
1321.21Smycroft	@lint -hbxncez -DGENERIC -Dvolatile= ${CPPFLAGS} -UKGDB \
1331.10Smycroft	    ${ALPHA}/alpha/Locore.c ${CFILES} ${ALPHA}/alpha/swapgeneric.c \
1341.10Smycroft	    ioconf.c param.c | \
1351.10Smycroft	    grep -v 'static function .* unused'
1361.1Scgd
1371.10Smycrofttags:
1381.10Smycroft	@echo "see $S/kern/Makefile for tags"
1391.1Scgd
1401.1Scgdlinks:
1411.1Scgd	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
1421.1Scgd	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
1431.1Scgd	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
1441.1Scgd	  sort -u | comm -23 - dontlink | \
1451.10Smycroft	  sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
1461.1Scgd	sh makelinks && rm -f dontlink
1471.1Scgd
1481.10SmycroftSRCS=	${ALPHA}/alpha/locore.s \
1491.14Scgd	param.c ioconf.c ${CFILES} ${SFILES}
1501.15Smycroftdepend:: .depend
1511.14Scgd.depend: ${SRCS} assym.h param.c
1521.19Smycroft	${MKDEP} ${AFLAGS} ${CPPFLAGS} ${ALPHA}/alpha/locore.s
1531.19Smycroft	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
1541.19Smycroft	${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
1551.24Smycroft	${MKDEP} -a ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} \
1561.24Smycroft	    ${ALPHA}/alpha/genassym.c
1571.10Smycroft
1581.1Scgd
1591.10Smycroft# depend on root or device configuration
1601.10Smycroftautoconf.o conf.o: Makefile
1611.10Smycroft 
1621.10Smycroft# depend on network or filesystem configuration 
1631.10Smycroftuipc_proto.o vfs_conf.o: Makefile 
1641.10Smycroft
1651.10Smycroft# depend on maxusers
1661.10Smycroftgenassym.o machdep.o: Makefile
1671.1Scgd
1681.10Smycroft# depend on CPU configuration 
1691.10Smycroftclock.o machdep.o apecs.o cia.o lca.o ioasic.o scc.o icasic.o: Makefile
1701.1Scgd
1711.1Scgd
1721.10Smycroftlocore.o: ${ALPHA}/alpha/locore.s assym.h
1731.10Smycroft	${NORMAL_S}
1741.1Scgd
1751.1Scgd%RULES
176