Makefile revision 70711
1# $FreeBSD: head/sys/boot/pc98/loader/Makefile 70082 2000-12-16 03:15:48Z kato $ 2 3BASE= loader 4PROG= ${BASE} 5#NOMAN= 6STRIP= 7NEWVERSWHAT= "bootstrap loader" pc98 8BINDIR?= /boot 9 10CFLAGS+= -DPC98 11 12# architecture-specific loader code 13SRCS= main.c conf.c 14.PATH: ${.CURDIR}/../../i386/loader 15 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# Always add MI sources 39.PATH: ${.CURDIR}/../../common 40.include <${.CURDIR}/../../common/Makefile.inc> 41CFLAGS+= -I${.CURDIR}/../../common 42CFLAGS+= -I${.CURDIR}/../../.. -I. -I${.CURDIR}/../../i386 43 44CLEANFILES+= vers.c vers.o ${BASE}.list ${BASE}.bin ${BASE}.sym ${BASE}.help 45 46CFLAGS+= -Wall 47LDFLAGS= -nostdlib -static -Ttext 0x0 48 49# pc98 standalone support library 50LIBPC98= ${.OBJDIR}/../libpc98/libpc98.a 51CFLAGS+= -I${.CURDIR}/.. 52 53# where to get libstand from 54#XXX need a better way to do this 55LIBSTAND= ${.CURDIR}/../../../../lib/libstand/libstand.a 56.if !exists(${LIBSTAND}) 57LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a 58.if !exists(${LIBSTAND}) 59LIBSTAND= -lstand 60.endif 61.endif 62CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ 63 64# BTX components 65.if exists(${.OBJDIR}/../btx) 66BTXDIR= ${.OBJDIR}/../btx 67.else 68BTXDIR= ${.CURDIR}/../btx 69.endif 70BTXLDR= ${BTXDIR}/btxldr/btxldr 71BTXKERN= ${BTXDIR}/btx/btx 72BTXCRT= ${BTXDIR}/lib/crt0.o 73CFLAGS+= -I${.CURDIR}/../btx/lib 74 75# BTX is expecting ELF components 76CFLAGS+= -elf 77 78# New linker set code 79CFLAGS+= -DNEW_LINKER_SET 80 81# Debug me! 82#CFLAGS+= -g 83#LDFLAGS+= -g 84 85vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version 86 sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version ${NEWVERSWHAT} 87 ${CC} -c vers.c 88 89${BASE}: ${BASE}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT} ${BASE}.help 90 btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ 91 -b ${BTXKERN} ${BASE}.bin 92# /usr/bin/kzip ${.TARGET} 93# mv ${.TARGET}.kz ${.TARGET} 94 95${BASE}.bin: ${BASE}.sym 96 cp ${.ALLSRC} ${.TARGET} 97 strip -R .comment -R .note ${.TARGET} 98 99${BASE}.help: help.common help.i386 100 cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} 101 102beforeinstall: 103.if exists(${DESTDIR}/boot/loader) 104 mv ${DESTDIR}/boot/loader ${DESTDIR}/boot/loader.old 105.endif 106.if exists(${.OBJDIR}/loader.help) 107 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 108 ${.OBJDIR}/${BASE}.help ${DESTDIR}/boot 109.else 110 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 111 ${.CURDIR}/${BASE}.help ${DESTDIR}/boot 112.endif 113.if !exists(${DESTDIR}/boot/loader.rc) 114 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 115 ${.CURDIR}/../../forth/loader.rc ${DESTDIR}/boot 116.endif 117 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 118 ${.CURDIR}/../../forth/loader.4th ${DESTDIR}/boot 119 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 120 ${.CURDIR}/../../forth/support.4th ${DESTDIR}/boot 121 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 122 ${.CURDIR}/../../forth/loader.conf ${DESTDIR}/boot/defaults 123 124.include <${.CURDIR}/../Makefile.inc> 125 126# Cannot use ${OBJS} above this line 127.include <bsd.prog.mk> 128 129${BASE}.sym: ${OBJS} ${LIBPC98} ${LIBSTAND} ${LIBFICL} vers.o 130 ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} vers.o \ 131 ${LIBFICL} ${LIBPC98} ${LIBSTAND} 132 133# If it's not there, don't consider it a target 134.if exists(${.CURDIR}/../../../i386/include) 135beforedepend ${OBJS}: machine 136 137machine: 138 ln -sf ${.CURDIR}/../../../i386/include machine 139 140.endif 141 142CLEANFILES+= machine 143