7INSTALLFLAGS= -b 8 9# architecture-specific loader code 10SRCS= main.c conf.c 11 12CFLAGS+= -ffreestanding 13# Enable PXE TFTP or NFS support, not both. 14.if defined(LOADER_TFTP_SUPPORT) 15CFLAGS+= -DLOADER_TFTP_SUPPORT 16.else 17CFLAGS+= -DLOADER_NFS_SUPPORT 18.endif 19 20# Enable PnP and ISA-PnP code. 21HAVE_PNP= yes 22HAVE_ISABUS= yes 23 24.if !defined(NOFORTH) 25# Enable BootForth 26BOOT_FORTH= yes 27CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386 28.if exists(${.OBJDIR}/../../ficl/libficl.a) 29LIBFICL= ${.OBJDIR}/../../ficl/libficl.a 30.else 31LIBFICL= ${.CURDIR}/../../ficl/libficl.a 32.endif 33.endif 34 35.if defined(LOADER_BZIP2_SUPPORT) 36CFLAGS+= -DLOADER_BZIP2_SUPPORT 37.endif 38.if !defined(LOADER_NO_GZIP_SUPPORT) 39CFLAGS+= -DLOADER_GZIP_SUPPORT 40.endif 41 42# Always add MI sources 43.PATH: ${.CURDIR}/../../common 44.include "${.CURDIR}/../../common/Makefile.inc" 45CFLAGS+= -I${.CURDIR}/../../common 46CFLAGS+= -I${.CURDIR}/../../.. -I. 47 48CLEANFILES+= vers.c vers.o ${PROG}.list ${PROG}.bin ${PROG}.sym ${PROG}.help 49 50CFLAGS+= -Wall 51LDFLAGS= -nostdlib -static -Ttext 0x0 52 53# i386 standalone support library 54LIBI386= ${.OBJDIR}/../libi386/libi386.a 55CFLAGS+= -I${.CURDIR}/.. 56 57# where to get libstand from 58#XXX need a better way to do this 59LIBSTAND= ${.CURDIR}/../../../../lib/libstand/libstand.a 60.if !exists(${LIBSTAND}) 61LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a 62.if !exists(${LIBSTAND}) 63LIBSTAND= -lstand 64.endif 65.endif 66CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ 67 68# BTX components 69.if exists(${.OBJDIR}/../btx) 70BTXDIR= ${.OBJDIR}/../btx 71.else 72BTXDIR= ${.CURDIR}/../btx 73.endif 74BTXLDR= ${BTXDIR}/btxldr/btxldr 75BTXKERN= ${BTXDIR}/btx/btx 76BTXCRT= ${BTXDIR}/lib/crt0.o 77CFLAGS+= -I${.CURDIR}/../btx/lib 78 79# BTX is expecting ELF components 80CFLAGS+= -elf 81 82# Debug me! 83#CFLAGS+= -g 84#LDFLAGS+= -g 85 86vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version 87 sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} 88 ${CC} ${CFLAGS} -c vers.c 89 90${PROG}: ${PROG}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT} 91 btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ 92 -b ${BTXKERN} ${PROG}.bin 93# /usr/bin/kzip ${.TARGET} 94# mv ${.TARGET}.kz ${.TARGET} 95 96${PROG}.bin: ${PROG}.sym 97 cp ${.ALLSRC} ${.TARGET} 98 strip -R .comment -R .note ${.TARGET} 99 100${PROG}.help: help.common help.i386 101 cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} 102 103.PATH: ${.CURDIR}/../../forth 104FILES= ${PROG}.help loader.4th support.4th loader.conf 105FILES+= screen.4th frames.4th beastie.4th 106FILESDIR_loader.conf= /boot/defaults 107 108.if !exists(${DESTDIR}/boot/loader.rc) 109FILES+= ${.CURDIR}/loader.rc 110.endif 111 112# Cannot use ${OBJS} above this line 113.include <bsd.prog.mk> 114 115${PROG}.sym: ${OBJS} ${LIBI386} ${LIBSTAND} ${LIBFICL} vers.o 116 ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} vers.o \ 117 ${LIBFICL} ${LIBI386} ${LIBSTAND} 118 119# If it's not there, don't consider it a target 120.if exists(${.CURDIR}/../../../i386/include) 121beforedepend ${OBJS}: machine 122 123machine: 124 ln -sf ${.CURDIR}/../../../i386/include machine 125 126.endif 127 128CLEANFILES+= machine
| 6INSTALLFLAGS= -b 7 8# architecture-specific loader code 9SRCS= main.c conf.c 10 11CFLAGS+= -ffreestanding 12# Enable PXE TFTP or NFS support, not both. 13.if defined(LOADER_TFTP_SUPPORT) 14CFLAGS+= -DLOADER_TFTP_SUPPORT 15.else 16CFLAGS+= -DLOADER_NFS_SUPPORT 17.endif 18 19# Enable PnP and ISA-PnP code. 20HAVE_PNP= yes 21HAVE_ISABUS= yes 22 23.if !defined(NOFORTH) 24# Enable BootForth 25BOOT_FORTH= yes 26CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386 27.if exists(${.OBJDIR}/../../ficl/libficl.a) 28LIBFICL= ${.OBJDIR}/../../ficl/libficl.a 29.else 30LIBFICL= ${.CURDIR}/../../ficl/libficl.a 31.endif 32.endif 33 34.if defined(LOADER_BZIP2_SUPPORT) 35CFLAGS+= -DLOADER_BZIP2_SUPPORT 36.endif 37.if !defined(LOADER_NO_GZIP_SUPPORT) 38CFLAGS+= -DLOADER_GZIP_SUPPORT 39.endif 40 41# Always add MI sources 42.PATH: ${.CURDIR}/../../common 43.include "${.CURDIR}/../../common/Makefile.inc" 44CFLAGS+= -I${.CURDIR}/../../common 45CFLAGS+= -I${.CURDIR}/../../.. -I. 46 47CLEANFILES+= vers.c vers.o ${PROG}.list ${PROG}.bin ${PROG}.sym ${PROG}.help 48 49CFLAGS+= -Wall 50LDFLAGS= -nostdlib -static -Ttext 0x0 51 52# i386 standalone support library 53LIBI386= ${.OBJDIR}/../libi386/libi386.a 54CFLAGS+= -I${.CURDIR}/.. 55 56# where to get libstand from 57#XXX need a better way to do this 58LIBSTAND= ${.CURDIR}/../../../../lib/libstand/libstand.a 59.if !exists(${LIBSTAND}) 60LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a 61.if !exists(${LIBSTAND}) 62LIBSTAND= -lstand 63.endif 64.endif 65CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ 66 67# BTX components 68.if exists(${.OBJDIR}/../btx) 69BTXDIR= ${.OBJDIR}/../btx 70.else 71BTXDIR= ${.CURDIR}/../btx 72.endif 73BTXLDR= ${BTXDIR}/btxldr/btxldr 74BTXKERN= ${BTXDIR}/btx/btx 75BTXCRT= ${BTXDIR}/lib/crt0.o 76CFLAGS+= -I${.CURDIR}/../btx/lib 77 78# BTX is expecting ELF components 79CFLAGS+= -elf 80 81# Debug me! 82#CFLAGS+= -g 83#LDFLAGS+= -g 84 85vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version 86 sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} 87 ${CC} ${CFLAGS} -c vers.c 88 89${PROG}: ${PROG}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT} 90 btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ 91 -b ${BTXKERN} ${PROG}.bin 92# /usr/bin/kzip ${.TARGET} 93# mv ${.TARGET}.kz ${.TARGET} 94 95${PROG}.bin: ${PROG}.sym 96 cp ${.ALLSRC} ${.TARGET} 97 strip -R .comment -R .note ${.TARGET} 98 99${PROG}.help: help.common help.i386 100 cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} 101 102.PATH: ${.CURDIR}/../../forth 103FILES= ${PROG}.help loader.4th support.4th loader.conf 104FILES+= screen.4th frames.4th beastie.4th 105FILESDIR_loader.conf= /boot/defaults 106 107.if !exists(${DESTDIR}/boot/loader.rc) 108FILES+= ${.CURDIR}/loader.rc 109.endif 110 111# Cannot use ${OBJS} above this line 112.include <bsd.prog.mk> 113 114${PROG}.sym: ${OBJS} ${LIBI386} ${LIBSTAND} ${LIBFICL} vers.o 115 ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} vers.o \ 116 ${LIBFICL} ${LIBI386} ${LIBSTAND} 117 118# If it's not there, don't consider it a target 119.if exists(${.CURDIR}/../../../i386/include) 120beforedepend ${OBJS}: machine 121 122machine: 123 ln -sf ${.CURDIR}/../../../i386/include machine 124 125.endif 126 127CLEANFILES+= machine
|