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