Makefile revision 48351
148351Speter# $Id: Makefile,v 1.7 1999/04/25 03:56:44 kato Exp $ 243561Skato 343561SkatoBASE= loader 443561SkatoPROG= ${BASE} 546043SkatoMAN5= ../../forth/loader.conf.5 646043SkatoMAN8= ../../i386/loader/loader.8 ../../forth/loader.4th.8 744859Skato#NOMAN= 843561SkatoSTRIP= 948351SpeterNEWVERSWHAT= "bootstrap loader" pc98 1043561SkatoBINDIR?= /boot 1143561Skato 1243561SkatoCFLAGS+= -DPC98 1343561Skato 1443561Skato# architecture-specific loader code 1543561SkatoSRCS= main.c conf.c 1643561Skato.PATH: ${.CURDIR}/../../i386/loader 1743561Skato 1843561Skato# Enable PnP and ISA-PnP code. 1943561SkatoHAVE_PNP= yes 2043561SkatoHAVE_ISABUS= yes 2143561Skato 2243561Skato# Enable BootForth 2343561SkatoBOOT_FORTH= yes 2443561SkatoCFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl 2543561Skato.if exists(${.OBJDIR}/../../ficl/libficl.a) 2643561SkatoLIBFICL= ${.OBJDIR}/../../ficl/libficl.a 2743561Skato.else 2843561SkatoLIBFICL= ${.CURDIR}/../../ficl/libficl.a 2943561Skato.endif 3043561Skato 3143561Skato# Always add MI sources 3243561Skato.PATH: ${.CURDIR}/../../common 3343561Skato.include <${.CURDIR}/../../common/Makefile.inc> 3443561SkatoCFLAGS+= -I${.CURDIR}/../../common 3543561SkatoCFLAGS+= -I${.CURDIR}/../../.. -I. -I${.CURDIR}/../../i386 3643561Skato 3743561SkatoCLEANFILES+= vers.c vers.o ${BASE}.list ${BASE}.bin ${BASE}.sym ${BASE}.help 3843561Skato 3943561SkatoCFLAGS+= -Wall 4044255SkatoLDFLAGS= -nostdlib -static -Ttext 0x0 4143561Skato 4243561Skato# pc98 standalone support library 4343561SkatoLIBPC98= ${.OBJDIR}/../libpc98/libpc98.a 4443561SkatoCFLAGS+= -I${.CURDIR}/.. 4543561Skato 4643561Skato# where to get libstand from 4743561SkatoLIBSTAND= -lstand 4843561Skato#LIBSTAND= ${.CURDIR}/../../../lib/libstand/libstand.a 4943561Skato#CFLAGS+= -I${.CURDIR}/../../../lib/libstand/ 5043561Skato 5143561Skato# BTX components 5243561Skato.if exists(${.OBJDIR}/../btx) 5343561SkatoBTXDIR= ${.OBJDIR}/../btx 5443561Skato.else 5543561SkatoBTXDIR= ${.CURDIR}/../btx 5643561Skato.endif 5743561SkatoBTXLDR= ${BTXDIR}/btxldr/btxldr 5843561SkatoBTXKERN= ${BTXDIR}/btx/btx 5943561SkatoBTXCRT= ${BTXDIR}/lib/crt0.o 6043561SkatoCFLAGS+= -I${.CURDIR}/../btx/lib 6143561Skato 6243561Skato# BTX is expecting ELF components 6343561SkatoCFLAGS+= -elf 6443561Skato 6543561Skato# New linker set code 6643561SkatoCFLAGS+= -DNEW_LINKER_SET 6743561Skato 6843561Skato# Debug me! 6943561Skato#CFLAGS+= -g 7043561Skato#LDFLAGS+= -g 7143561Skato 7248351Spetervers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version 7348351Speter sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version ${NEWVERSWHAT} 7443561Skato ${CC} -c vers.c 7543561Skato 7643561Skato${BASE}: ${BASE}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT} ${BASE}.help 7743561Skato btxld -v -f aout -e 0x100000 -o ${.TARGET} -l ${BTXLDR} -b ${BTXKERN} \ 7843561Skato ${BASE}.bin 7943561Skato# /usr/bin/kzip ${.TARGET} 8043561Skato# mv ${.TARGET}.kz ${.TARGET} 8143561Skato 8243561Skato${BASE}.bin: ${BASE}.sym 8343561Skato cp ${.ALLSRC} ${.TARGET} 8443561Skato strip ${.TARGET} 8543561Skato 8645241Skato${BASE}.help: help.common help.i386 8743561Skato cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} 8843561Skato 8943561Skatobeforeinstall: 9043561Skato.if exists(${DESTDIR}/boot/loader) 9143561Skato mv ${DESTDIR}/boot/loader ${DESTDIR}/boot/loader.old 9243561Skato.endif 9343561Skato.if exists(${.OBJDIR}/loader.help) 9443561Skato ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 9543561Skato ${.OBJDIR}/${BASE}.help ${DESTDIR}/boot 9643561Skato.else 9743561Skato ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 9843561Skato ${.CURDIR}/${BASE}.help ${DESTDIR}/boot 9943561Skato.endif 10044630Skato ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 10144630Skato ${.CURDIR}/../../forth/loader.4th ${DESTDIR}/boot 10244630Skato ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 10344630Skato ${.CURDIR}/../../forth/support.4th ${DESTDIR}/boot 10444630Skato ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 10544630Skato ${.CURDIR}/../../forth/loader.conf ${DESTDIR}/boot/defaults 10643561Skato 10743561Skato# Cannot use ${OBJS} above this line 10843561Skato.include <bsd.prog.mk> 10943561Skato 11043561Skato${BASE}.sym: ${OBJS} ${LIBPC98} ${LIBSTAND} ${LIBFICL} vers.o 11143561Skato ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} vers.o \ 11243561Skato ${LIBFICL} ${LIBSTAND} ${LIBPC98} ${LIBSTAND} 11343561Skato 11443561Skato# If it's not there, don't consider it a target 11543561Skato.if exists(${.CURDIR}/../../../i386/include) 11643561Skatobeforedepend ${OBJS}: machine 11743561Skato 11843561Skatomachine: 11943561Skato ln -sf ${.CURDIR}/../../../i386/include machine 12043561Skato 12143561Skato.endif 12243561Skato 12343561SkatoCLEANFILES+= machine 12443561Skato 12543561Skato 126