Makefile revision 44243
144243Smsmith# $Id: Makefile,v 1.28 1999/01/18 19:05:27 msmith Exp $ 238465Smsmith 339441SmsmithBASE= loader 439441SmsmithPROG= ${BASE} 538465SmsmithNOMAN= 639857SjkhSTRIP= 738465SmsmithNEWVERSWHAT= "bootstrap loader" 839851SpeterBINDIR?= /boot 938465Smsmith 1039441Smsmith# architecture-specific loader code 1139441SmsmithSRCS= main.c conf.c 1239441Smsmith 1339178Smsmith# Enable PnP and ISA-PnP code. 1440555SmsmithHAVE_PNP= yes 1540555SmsmithHAVE_ISABUS= yes 1639178Smsmith 1740877Smsmith# Enable BootForth 1841107SjkhBOOT_FORTH= yes 1941107SjkhCFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl 2041107Sjkh.if exists(${.OBJDIR}/../../ficl/libficl.a) 2141107SjkhLIBFICL= ${.OBJDIR}/../../ficl/libficl.a 2241107Sjkh.else 2341107SjkhLIBFICL= ${.CURDIR}/../../ficl/libficl.a 2441107Sjkh.endif 2540877Smsmith 2638465Smsmith# Always add MI sources 2738465Smsmith.PATH: ${.CURDIR}/../../common 2838465Smsmith.include <${.CURDIR}/../../common/Makefile.inc> 2940338SpeterCFLAGS+= -I${.CURDIR}/../../common 3040338SpeterCFLAGS+= -I${.CURDIR}/../../.. -I. 3138465Smsmith 3241821SmsmithCLEANFILES+= vers.c vers.o ${BASE}.list ${BASE}.bin ${BASE}.sym ${BASE}.help 3338465Smsmith 3438465SmsmithCFLAGS+= -Wall 3544243SmsmithLDFLAGS= -nostdlib -static -Ttext 0x0 3638465Smsmith 3738465Smsmith# i386 standalone support library 3838465SmsmithLIBI386= ${.OBJDIR}/../libi386/libi386.a 3938465SmsmithCFLAGS+= -I${.CURDIR}/.. 4038465Smsmith 4139474Smsmith# where to get libstand from 4239474SmsmithLIBSTAND= -lstand 4339474Smsmith#LIBSTAND= ${.CURDIR}/../../../lib/libstand/libstand.a 4439664Smsmith#CFLAGS+= -I${.CURDIR}/../../../lib/libstand/ 4539474Smsmith 4639441Smsmith# BTX components 4739646Speter.if exists(${.OBJDIR}/../btx) 4839646SpeterBTXDIR= ${.OBJDIR}/../btx 4939646Speter.else 5039441SmsmithBTXDIR= ${.CURDIR}/../btx 5139646Speter.endif 5239441SmsmithBTXLDR= ${BTXDIR}/btxldr/btxldr 5339441SmsmithBTXKERN= ${BTXDIR}/btx/btx 5439441SmsmithBTXCRT= ${BTXDIR}/lib/crt0.o 5539646SpeterCFLAGS+= -I${.CURDIR}/../btx/lib 5639441Smsmith 5739441Smsmith# BTX is expecting ELF components 5839441SmsmithCFLAGS+= -elf 5939441Smsmith 6040555Smsmith# New linker set code 6140555SmsmithCFLAGS+= -DNEW_LINKER_SET 6240555Smsmith 6339664Smsmith# Debug me! 6440884Smsmith#CFLAGS+= -g 6540884Smsmith#LDFLAGS+= -g 6639664Smsmith 6738465Smsmithvers.o: 6838465Smsmith sh ${.CURDIR}/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} 6938465Smsmith ${CC} -c vers.c 7038465Smsmith 7142274Smsmith${BASE}: ${BASE}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT} ${BASE}.help 7239450Smsmith btxld -v -f aout -e 0x100000 -o ${.TARGET} -l ${BTXLDR} -b ${BTXKERN} \ 7339450Smsmith ${BASE}.bin 7442493Smsmith# /usr/bin/kzip ${.TARGET} 7542493Smsmith# mv ${.TARGET}.kz ${.TARGET} 7638465Smsmith 7740555Smsmith${BASE}.bin: ${BASE}.sym 7840555Smsmith cp ${.ALLSRC} ${.TARGET} 7940555Smsmith strip ${.TARGET} 8040555Smsmith 8141821Smsmith${BASE}.help: help.common help.i386 8242807Smsmith cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} 8341821Smsmith 8442268Smsmithbeforeinstall: 8542510Smsmith.if exists(${DESTDIR}/boot/loader) 8642510Smsmith mv ${DESTDIR}/boot/loader ${DESTDIR}/boot/loader.old 8742510Smsmith.endif 8842268Smsmith.if exists(${.OBJDIR}/loader.help) 8942268Smsmith ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 9042268Smsmith ${.OBJDIR}/${BASE}.help ${DESTDIR}/boot 9142268Smsmith.else 9242268Smsmith ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 9342268Smsmith ${.CURDIR}/${BASE}.help ${DESTDIR}/boot 9442268Smsmith.endif 9541821Smsmith 9640555Smsmith# Cannot use ${OBJS} above this line 9740555Smsmith.include <bsd.prog.mk> 9840555Smsmith 9940877Smsmith${BASE}.sym: ${OBJS} ${LIBI386} ${LIBSTAND} ${LIBFICL} vers.o 10040555Smsmith ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} vers.o \ 10140877Smsmith ${LIBFICL} ${LIBSTAND} ${LIBI386} ${LIBSTAND} 10239441Smsmith 10340555Smsmith# If it's not there, don't consider it a target 10440555Smsmith.if exists(${.CURDIR}/../../../i386/include) 10540555Smsmithbeforedepend ${OBJS}: machine 10639441Smsmith 10740338Spetermachine: 10840338Speter ln -sf ${.CURDIR}/../../../i386/include machine 10940338Speter 11040555Smsmith.endif 11140555Smsmith 11240338SpeterCLEANFILES+= machine 11340338Speter 11439441Smsmith 115