Makefile.alpha revision 1.15
11.15Smycroft#	$NetBSD: Makefile.alpha,v 1.15 1996/05/11 16:11:30 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.13SmycroftAS?=	as
251.13SmycroftCC?=	cc
261.13SmycroftCPP?=	cpp
271.13SmycroftLD?=	ld
281.13SmycroftSTRIP?=	strip -g -X -x
291.13SmycroftTOUCH?=	touch -f -c
301.1Scgd
311.1Scgd# source tree is located via $S relative to the compilation directory
321.1ScgdS=	../../../..
331.1ScgdALPHA=	../..
341.1Scgd
351.10SmycroftINCLUDES=	-I. -I$S/arch -I$S
361.10SmycroftCPPFLAGS=	${INCLUDES} ${IDENT} -D_KERNEL -Dalpha
371.10SmycroftCFLAGS=		${DEBUG} -Werror -mno-fp-regs
381.12SmycroftAFLAGS=		-x assembler-with-cpp -traditional-cpp -D_LOCORE
391.10SmycroftLINKFLAGS=	-N -Ttext fffffc0000230000 -e __start -G 4
401.1Scgd
411.1Scgd### find out what to use for libkern
421.1Scgd.include "$S/lib/libkern/Makefile.inc"
431.1Scgd.ifndef PROF
441.1ScgdLIBKERN=	${KERNLIB}
451.1Scgd.else
461.1ScgdLIBKERN=	${KERNLIB_PROF}
471.1Scgd.endif
481.1Scgd
491.5Schristos### find out what to use for libcompat
501.5Schristos.include "$S/compat/common/Makefile.inc"
511.5Schristos.ifndef PROF
521.5SchristosLIBCOMPAT=	${COMPATLIB}
531.5Schristos.else
541.5SchristosLIBCOMPAT=	${COMPATLIB_PROF}
551.5Schristos.endif
561.5Schristos
571.1Scgd# compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
581.1Scgd# where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
591.1Scgd# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
601.1Scgd# is marked as config-dependent.
611.1Scgd
621.10SmycroftNORMAL_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
631.10SmycroftNORMAL_C_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
641.10Smycroft
651.10SmycroftDRIVER_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
661.10SmycroftDRIVER_C_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
671.10Smycroft
681.12SmycroftNORMAL_S=	${CC} ${AFLAGS} ${CPPFLAGS} -c $<
691.12SmycroftNORMAL_S_C=	${CC} ${AFLAGS} ${CPPFLAGS} ${PARAM} -c $<
701.1Scgd
711.1Scgd%OBJS
721.1Scgd
731.1Scgd%CFILES
741.1Scgd
751.10Smycroft%SFILES
761.10Smycroft
771.1Scgd# load lines for config "xxx" will be emitted as:
781.1Scgd# xxx: ${SYSTEM_DEP} swapxxx.o
791.1Scgd#	${SYSTEM_LD_HEAD}
801.1Scgd#	${SYSTEM_LD} swapxxx.o
811.1Scgd#	${SYSTEM_LD_TAIL}
821.10SmycroftSYSTEM_OBJ=	locore.o \
831.14Scgd		param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
841.1ScgdSYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
851.10SmycroftSYSTEM_LD_HEAD=	@rm -f $@
861.10SmycroftSYSTEM_LD=	@echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
871.10Smycroft		${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
881.1ScgdSYSTEM_LD_TAIL=	@size $@; chmod 755 $@
891.10Smycroft
901.10SmycroftDEBUG?=
911.8Scgd.if ${DEBUG} == "-g"
921.10SmycroftLINKFLAGS+=	-X
931.10SmycroftSYSTEM_LD_TAIL+=; \
941.10Smycroft		echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
951.10Smycroft		echo ${STRIP} $@; ${STRIP} $@
961.8Scgd.else
971.10SmycroftLINKFLAGS+=	-x
981.8Scgd.endif
991.1Scgd
1001.1Scgd%LOAD
1011.1Scgd
1021.10Smycroftassym.h: genassym
1031.10Smycroft	./genassym >assym.h
1041.10Smycroft
1051.10Smycroftgenassym: genassym.o
1061.10Smycroft	${CC} -o $@ genassym.o
1071.10Smycroft
1081.10Smycroftgenassym.o: ${ALPHA}/alpha/genassym.c
1091.10Smycroft	${NORMAL_C_C}
1101.10Smycroft
1111.10Smycroftparam.c: $S/conf/param.c
1121.10Smycroft	rm -f param.c
1131.10Smycroft	cp $S/conf/param.c .
1141.1Scgd
1151.10Smycroftparam.o: param.c Makefile
1161.10Smycroft	${NORMAL_C_C}
1171.1Scgd
1181.10Smycroftioconf.o: ioconf.c
1191.10Smycroft	${NORMAL_C}
1201.1Scgd
1211.10Smycroftnewvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
1221.10Smycroft	sh $S/conf/newvers.sh
1231.10Smycroft	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
1241.1Scgd
1251.1Scgd
1261.10Smycroftclean::
1271.14Scgd	rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
1281.10Smycroft	    [Ee]rrs linterrs makelinks genassym genassym.o assym.h
1291.1Scgd
1301.10Smycroftlint:
1311.10Smycroft	@lint -hbxncez -DGENERIC -Dvolatile= ${CPPFLAGS} ${PARAM} -UKGDB \
1321.10Smycroft	    ${ALPHA}/alpha/Locore.c ${CFILES} ${ALPHA}/alpha/swapgeneric.c \
1331.10Smycroft	    ioconf.c param.c | \
1341.10Smycroft	    grep -v 'static function .* unused'
1351.1Scgd
1361.10Smycrofttags:
1371.10Smycroft	@echo "see $S/kern/Makefile for tags"
1381.1Scgd
1391.1Scgdlinks:
1401.1Scgd	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
1411.1Scgd	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
1421.1Scgd	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
1431.1Scgd	  sort -u | comm -23 - dontlink | \
1441.10Smycroft	  sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
1451.1Scgd	sh makelinks && rm -f dontlink
1461.1Scgd
1471.10SmycroftSRCS=	${ALPHA}/alpha/locore.s \
1481.14Scgd	param.c ioconf.c ${CFILES} ${SFILES}
1491.15Smycroftdepend:: .depend
1501.14Scgd.depend: ${SRCS} assym.h param.c
1511.12Smycroft	mkdep ${AFLAGS} ${CPPFLAGS} ${ALPHA}/alpha/locore.s
1521.14Scgd	mkdep -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
1531.12Smycroft	mkdep -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
1541.10Smycroft	mkdep -a ${CFLAGS} ${CPPFLAGS} ${PARAM} ${ALPHA}/alpha/genassym.c
1551.10Smycroft
1561.1Scgd
1571.10Smycroft# depend on root or device configuration
1581.10Smycroftautoconf.o conf.o: Makefile
1591.10Smycroft 
1601.10Smycroft# depend on network or filesystem configuration 
1611.10Smycroftuipc_proto.o vfs_conf.o: Makefile 
1621.10Smycroft
1631.10Smycroft# depend on maxusers
1641.10Smycroftgenassym.o machdep.o: Makefile
1651.1Scgd
1661.10Smycroft# depend on CPU configuration 
1671.10Smycroftclock.o machdep.o apecs.o cia.o lca.o ioasic.o scc.o icasic.o: Makefile
1681.1Scgd
1691.1Scgd
1701.10Smycroftlocore.o: ${ALPHA}/alpha/locore.s assym.h
1711.10Smycroft	${NORMAL_S}
1721.1Scgd
1731.1Scgd%RULES
174