Makefile revision 106143
150477Speter# $FreeBSD: head/sys/boot/pc98/loader/Makefile 102556 2002-08-29 02:02:28Z peter $ 243561Skato 343561SkatoBASE= loader 443561SkatoPROG= ${BASE} 543561SkatoSTRIP= 648351SpeterNEWVERSWHAT= "bootstrap loader" pc98 743561SkatoBINDIR?= /boot 883368SruINSTALLFLAGS= -b 943561Skato 1096342SobrienCFLAGS+= -ffreestanding 1143561SkatoCFLAGS+= -DPC98 1243561Skato 1343561Skato# architecture-specific loader code 1459535SnyanSRCS= main.c conf.c 1561064Snyan.PATH: ${.CURDIR}/../../i386/loader 1643561Skato 1759228Snyan# Enable PXE TFTP or NFS support, not both. 1868358Snyan.if defined(LOADER_TFTP_SUPPORT) 1968358SnyanCFLAGS+= -DLOADER_TFTP_SUPPORT 2068358Snyan.else 2159228SnyanCFLAGS+= -DLOADER_NFS_SUPPORT 2268358Snyan.endif 2359228Snyan 2443561Skato# Enable PnP and ISA-PnP code. 2543561SkatoHAVE_PNP= yes 2643561SkatoHAVE_ISABUS= yes 2743561Skato 2856994Skato.if !defined(NOFORTH) 2943561Skato# Enable BootForth 3043561SkatoBOOT_FORTH= yes 3153688SnyanCFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386 3243561Skato.if exists(${.OBJDIR}/../../ficl/libficl.a) 3343561SkatoLIBFICL= ${.OBJDIR}/../../ficl/libficl.a 3443561Skato.else 3543561SkatoLIBFICL= ${.CURDIR}/../../ficl/libficl.a 3643561Skato.endif 3756994Skato.endif 3843561Skato 3985060Snyan.if defined(LOADER_BZIP2_SUPPORT) 4085060SnyanCFLAGS+= -DLOADER_BZIP2_SUPPORT 4185060Snyan.endif 4285060Snyan.if !defined(LOADER_NO_GZIP_SUPPORT) 4385060SnyanCFLAGS+= -DLOADER_GZIP_SUPPORT 4485060Snyan.endif 4585060Snyan 4643561Skato# Always add MI sources 4743561Skato.PATH: ${.CURDIR}/../../common 4843561Skato.include <${.CURDIR}/../../common/Makefile.inc> 4943561SkatoCFLAGS+= -I${.CURDIR}/../../common 5043561SkatoCFLAGS+= -I${.CURDIR}/../../.. -I. -I${.CURDIR}/../../i386 5143561Skato 5243561SkatoCLEANFILES+= vers.c vers.o ${BASE}.list ${BASE}.bin ${BASE}.sym ${BASE}.help 5343561Skato 5443561SkatoCFLAGS+= -Wall 5544255SkatoLDFLAGS= -nostdlib -static -Ttext 0x0 5643561Skato 5743561Skato# pc98 standalone support library 5843561SkatoLIBPC98= ${.OBJDIR}/../libpc98/libpc98.a 5943561SkatoCFLAGS+= -I${.CURDIR}/.. 6043561Skato 6143561Skato# where to get libstand from 6265607Skato#XXX need a better way to do this 6365607SkatoLIBSTAND= ${.CURDIR}/../../../../lib/libstand/libstand.a 6465607Skato.if !exists(${LIBSTAND}) 6565607SkatoLIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a 6665607Skato.if !exists(${LIBSTAND}) 6743561SkatoLIBSTAND= -lstand 6865607Skato.endif 6965607Skato.endif 7059228SnyanCFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ 7143561Skato 7243561Skato# BTX components 7343561Skato.if exists(${.OBJDIR}/../btx) 7443561SkatoBTXDIR= ${.OBJDIR}/../btx 7543561Skato.else 7643561SkatoBTXDIR= ${.CURDIR}/../btx 7743561Skato.endif 7843561SkatoBTXLDR= ${BTXDIR}/btxldr/btxldr 7943561SkatoBTXKERN= ${BTXDIR}/btx/btx 8043561SkatoBTXCRT= ${BTXDIR}/lib/crt0.o 8143561SkatoCFLAGS+= -I${.CURDIR}/../btx/lib 8243561Skato 8343561Skato# BTX is expecting ELF components 8443561SkatoCFLAGS+= -elf 8543561Skato 8643561Skato# Debug me! 8743561Skato#CFLAGS+= -g 8843561Skato#LDFLAGS+= -g 8943561Skato 9048351Spetervers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version 9148351Speter sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version ${NEWVERSWHAT} 9243561Skato ${CC} -c vers.c 9343561Skato 9495450Snyan${BASE}: ${BASE}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT} 9558871Skato btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ 9658871Skato -b ${BTXKERN} ${BASE}.bin 9743561Skato# /usr/bin/kzip ${.TARGET} 9843561Skato# mv ${.TARGET}.kz ${.TARGET} 9943561Skato 10043561Skato${BASE}.bin: ${BASE}.sym 10143561Skato cp ${.ALLSRC} ${.TARGET} 10270082Skato strip -R .comment -R .note ${.TARGET} 10343561Skato 10445241Skato${BASE}.help: help.common help.i386 10543561Skato cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} 10643561Skato 10795450Snyan.PATH: ${.CURDIR}/../../forth 10895450SnyanFILES= ${BASE}.help loader.4th support.4th loader.conf 10995450SnyanFILESDIR_loader.conf= /boot/defaults 11095450Snyan 11153206Snyan.if !exists(${DESTDIR}/boot/loader.rc) 11295450SnyanFILES+= loader.rc 11353206Snyan.endif 11443561Skato 11558871Skato.include <${.CURDIR}/../Makefile.inc> 11658871Skato 11743561Skato# Cannot use ${OBJS} above this line 11843561Skato.include <bsd.prog.mk> 11943561Skato 12043561Skato${BASE}.sym: ${OBJS} ${LIBPC98} ${LIBSTAND} ${LIBFICL} vers.o 12143561Skato ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} vers.o \ 12259535Snyan ${LIBFICL} ${LIBPC98} ${LIBSTAND} 12343561Skato 12443561Skato# If it's not there, don't consider it a target 12543561Skato.if exists(${.CURDIR}/../../../i386/include) 12643561Skatobeforedepend ${OBJS}: machine 12743561Skato 12843561Skatomachine: 12943561Skato ln -sf ${.CURDIR}/../../../i386/include machine 13043561Skato 13143561Skato.endif 13243561Skato 13343561SkatoCLEANFILES+= machine 134