Makefile revision 1.26
11.26Stsutsui#	$NetBSD: Makefile,v 1.26 2014/01/12 15:26:28 tsutsui Exp $
21.3Slukem
31.4StsutsuiNOMAN= # defined
41.4Stsutsui
51.4Stsutsui.include <bsd.own.mk>
61.3Slukem.include <bsd.sys.mk>		# for HOST_SH
71.1Scdi
81.1ScdiS=	${.CURDIR}/../../../..
91.1ScdiMIPS=	${S}/arch/mips
101.1ScdiCOBALT=	${S}/arch/cobalt
111.12StsutsuiLIBSADIR=	${S}/lib/libsa
121.1Scdi
131.1Scdi# .PATH:	${.CURDIR}/../common
141.1Scdi
151.1ScdiBINMODE?= 444
161.2Ssimonb
171.2Ssimonb# XXX SHOULD NOT NEED TO DEFINE THESE!
181.2SsimonbLIBCRT0=
191.26StsutsuiLIBCRTI=
201.2SsimonbLIBC=
211.2SsimonbLIBCRTBEGIN=
221.2SsimonbLIBCRTEND=
231.1Scdi
241.19Stsutsuirealall: ${PROG}
251.1Scdi
261.6Scdi# Load @15Mb boundary as most (all?) of the Cobalt boxes
271.6Scdi# had been shipped with at least 16Mb.
281.6Scdi#
291.6Scdi# XXX The proper fix is to load at the kernel base address
301.6Scdi# and to relocate itself at the end of available memory.
311.6ScdiLOAD_ADDRESS?=0x80F00000
321.1Scdi
331.1ScdiCOMPORT?=0x0
341.1ScdiCOMSPEED?=115200
351.1ScdiCOMPROBE?=0xa020001c
361.1Scdi
371.16StsutsuiZSCHAN?=0x01		# 0x01: ZS_CHAN_A, 0x00: ZS_CHAN_B
381.16StsutsuiZSSPEED?=115200
391.16StsutsuiZSPROBE?=0xa020001c
401.16Stsutsui
411.1ScdiAFLAGS+=	-D_LOCORE -D_KERNEL -DASSEMBLER -mno-abicalls
421.1Scdi
431.1Scdi# -I${.CURDIR}/../.. done by Makefile.inc
441.1ScdiCPPFLAGS+=	-nostdinc -D_STANDALONE -DNO_ABICALLS -D_NO_PROM_DEFINES
451.20Stsutsui#CPPFLAGS+=	-D_DEBUG	\
461.20Stsutsui#		-DLIBSA_PRINTF_LONGLONG_SUPPORT -DLIBSA_PRINTF_WIDTH_SUPPORT
471.13StsutsuiCPPFLAGS+=	-I${.OBJDIR} -I${S} -I${S}/arch -I${LIBSADIR}
481.17StsutsuiCPPFLAGS+=	-DCONS_SERIAL -DCOMPORT=${COMPORT}
491.1ScdiCPPFLAGS+=	-DCOMSPEED=${COMSPEED} -DCOMPROBE=${COMPROBE}
501.17StsutsuiCPPFLAGS+=	-DCONS_ZS -DZSCHAN=${ZSCHAN}
511.16StsutsuiCPPFLAGS+=	-DZSSPEED=${ZSSPEED} -DZSPROBE=${ZSPROBE}
521.12StsutsuiCPPFLAGS+=	-DSUPPORT_DHCP -DSUPPORT_BOOTP
531.12Stsutsui#CPPFLAGS+=	-DBOOTP_DEBUG -DNETIF_DEBUG -DETHER_DEBUG -DNFS_DEBUG
541.12Stsutsui#CPPFLAGS+=	-DRPC_DEBUG -DRARP_DEBUG -DNET_DEBUG -DDEBUG -DPARANOID
551.1Scdi
561.1Scdi# compiler flags for smallest code size
571.23SmattCFLAGS=		-O2 -mmemcpy -ffreestanding -mno-abicalls -msoft-float -G 128
581.23Smatt.if ${MACHINE_ARCH} == "mips64el"
591.23SmattAFLAGS+=	-mips3 -mabi=32
601.23SmattCFLAGS+=	-mips3 -mabi=32
611.23SmattLINKFORMAT=	-m elf32ltsmip
621.23Smatt.endif
631.1Scdi
641.15StsutsuiCFLAGS+=	-Wall -Werror
651.15StsutsuiCFLAGS+=	-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
661.15StsutsuiCFLAGS+=	-Wno-pointer-sign
671.15Stsutsui
681.3SlukemNETBSD_VERS!=	${HOST_SH} ${S}/conf/osrelease.sh
691.1ScdiCPPFLAGS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
701.1Scdi
711.1ScdiLDSCRIPT?=	${MIPS}/conf/stand.ldscript
721.1Scdi
731.1ScdiPROG=		boot
741.1Scdi# common sources
751.5ScdiSRCS+=		start.S boot.c devopen.c conf.c clock.c bootinfo.c
761.7StsutsuiSRCS+=		prf.c com.c cons.c ns16550.c pciide.c tgets.c wdc.c wd.c
771.16StsutsuiSRCS+=		zs.c
781.14StsutsuiSRCS+=		cache.c pci.c nif_tlp.c tlp.c
791.18StsutsuiSRCS+=		lcd.c
801.12Stsutsui
811.12Stsutsui# XXX dev_net.c should really be in libsa, but it doesn't
821.12Stsutsui#     declare ip_convertaddr correctly.
831.12Stsutsui.PATH: ${LIBSADIR}
841.12StsutsuiSRCS+=		dev_net.c
851.1Scdi
861.1ScdiSRCS+=		vers.c
871.1ScdiCLEANFILES+=	vers.c
881.1Scdi
891.1Scdi### find out what to use for libkern
901.1ScdiKERN_AS=	library
911.1Scdi.include "${S}/lib/libkern/Makefile.inc"
921.1Scdi
931.1Scdi### find out what to use for libz
941.1ScdiZ_AS=		library
951.1Scdi.include "${S}/lib/libz/Makefile.inc"
961.1Scdi
971.1Scdi### find out what to use for libsa
981.1ScdiSA_AS=		library
991.1ScdiSAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes
1001.1Scdi.include "${S}/lib/libsa/Makefile.inc"
1011.1Scdi
1021.11SuweLIBS=		${SALIB} ${ZLIB} ${KERNLIB}
1031.1Scdi
1041.1Scdi.PHONY: vers.c
1051.1Scdivers.c: ${.CURDIR}/version
1061.22Sjoerg	${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
1071.22Sjoerg	    ${.CURDIR}/version "cobalt"
1081.1Scdi
1091.19Stsutsui${PROG}: ${LDSCRIPT} ${OBJS} ${LIBS}
1101.23Smatt	${LD} ${LINKFORMAT} -Map ${PROG}.map -N -x -Ttext ${LOAD_ADDRESS} \
1111.1Scdi	    -T ${LDSCRIPT} -e start -o ${PROG} ${OBJS} ${LIBS}
1121.24Smatt	${TOOL_GZIP} -c9 ${PROG} > ${PROG}.gz
1131.1Scdi	@${SIZE} ${PROG}
1141.1Scdi
1151.1ScdiCLEANFILES+=	${PROG}.map ${PROG}.elf ${PROG}.gz
1161.1Scdi
1171.21Sdhollandcleandir distclean: .WAIT cleanlibdir
1181.1Scdi
1191.1Scdicleanlibdir:
1201.8Sjmc	-rm -rf lib
1211.1Scdi
1221.19Stsutsui.include <bsd.klinks.mk>
1231.1Scdi.include <bsd.prog.mk>
124