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