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