Makefile revision 93924
1139825Simp# $FreeBSD: head/sys/boot/ia64/ski/Makefile 93924 2002-04-06 04:16:58Z peter $
21541Srgrimes
31541Srgrimes.PATH: ${.CURDIR}/../common
41541Srgrimes
51541SrgrimesPROG= 		skiload
61541SrgrimesNOMAN=
71541SrgrimesNEWVERSWHAT=	"ia64 SKI boot" ${MACHINE_ARCH}
81541Srgrimes
91541SrgrimesSRCS+=		main.c conf.c
101541Srgrimes
111541Srgrimes# Enable BootForth
121541SrgrimesBOOT_FORTH=	yes
131541SrgrimesCFLAGS+=	-g
141541SrgrimesCFLAGS+=	-I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/ia64
151541Srgrimes.if BOOT_FORTH
161541SrgrimesCFLAGS+=	-DBOOT_FORTH
171541Srgrimes.if exists(${.OBJDIR}/../../ficl/libficl.a)
181541SrgrimesLIBFICL=	${.OBJDIR}/../../ficl/libficl.a
191541Srgrimes.else
201541SrgrimesLIBFICL=	${.CURDIR}/../../ficl/libficl.a
211541Srgrimes.endif
221541Srgrimes.else
231541SrgrimesLIBFICL=
241541Srgrimes.endif
251541Srgrimes
261541Srgrimes# where to get libstand from
271541Srgrimes#XXX need a better way to do this
281541SrgrimesLIBSTAND=       ${.CURDIR}/../../../../lib/libstand/libstand.a
291541Srgrimes.if !exists(${LIBSTAND})
301541SrgrimesLIBSTAND=       ${.OBJDIR}/../../../../lib/libstand/libstand.a
311541Srgrimes.if !exists(${LIBSTAND})
321541SrgrimesLIBSTAND=       -lstand
331541Srgrimes.endif
341541Srgrimes.endif
3550477Speter
361541Srgrimes.if exists(${.OBJDIR}/../libski/libski.a)
371541SrgrimesLIBSKI=		${.OBJDIR}/../libski/libski.a
382165Spaul.else
392165SpaulLIBSKI=		${.CURDIR}/../libski/libski.a
402165Spaul.endif
4155205Speter
4217649Speter# Always add MI sources 
4317649Speter.PATH: ${.CURDIR}/../../common
4492719Salfred.include <${.CURDIR}/../../common/Makefile.inc>
4517649Speter
4613545SjulianCFLAGS+= -I-
471541SrgrimesCFLAGS+= -I${.CURDIR}/../include
481541SrgrimesCFLAGS+= -I${.CURDIR}/../include/${MACHINE_ARCH}
491541SrgrimesCFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}
501541SrgrimesCFLAGS+= -I${.CURDIR}/../../.. -I.
511541SrgrimesCFLAGS+= -I${.CURDIR}/../libski
521541SrgrimesCFLAGS+= -DLOADER
531541SrgrimesCFLAGS+= -ffreestanding
541541Srgrimes
551541SrgrimesLDFLAGS=	-nostdlib -T ${.CURDIR}/ldscript.ia64
561541Srgrimes
571541SrgrimesCLEANFILES+=	vers.c vers.o ${PROG}.list
581541SrgrimesCLEANFILES+=	loader.help
591541SrgrimesCLEANFILES+=	machine
601541Srgrimes
611541Srgrimesall: ${PROG}
621541Srgrimes
631541Srgrimesvers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
641541Srgrimes	sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
651541Srgrimes	${CC} -c vers.c
661541Srgrimes
671541Srgrimes${PROG}.help:	help.common help.efi
681541Srgrimes	cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk \
691541Srgrimes	    > ${.TARGET}
701541Srgrimes
711541Srgrimesbeforeinstall:
721541Srgrimes.if exists(${.OBJDIR}/${PROG}.help)
731541Srgrimes	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
741541Srgrimes	    ${.OBJDIR}/${PROG}.help ${DESTDIR}/boot
751541Srgrimes.endif
761541Srgrimes
771541Srgrimes# Other fragments still to be brought in from ../Makfile.booters?
781541Srgrimesstart.o: ${.CURDIR}/../libefi/arch/${MACHINE_ARCH}/start.S
791541Srgrimes	${CC} -c ${CFLAGS} ${.IMPSRC}
801541Srgrimes
811541Srgrimesmachine:
821541Srgrimes	ln -sf ${.CURDIR}/../../../${MACHINE_ARCH}/include machine
8396755Strhodes
841541Srgrimes${PROG}: ${OBJS} ${LIBFICL} ${LIBSKI} vers.o
851541Srgrimes	${LD} ${LDFLAGS} -o ${PROG} -M \
861541Srgrimes	    ${OBJS} vers.o \
871541Srgrimes	    ${LIBFICL} ${LIBSTAND} ${LIBSKI} ${LIBSTAND} \
881541Srgrimes	    > ${.OBJDIR}/${PROG}.list
891541Srgrimes
901541Srgrimes.include <bsd.prog.mk>
911541Srgrimes
921541Srgrimesbeforedepend ${OBJS}: machine
931541Srgrimes