Makefile revision 61454
1# $FreeBSD: head/sys/boot/pc98/loader/Makefile 61064 2000-05-29 11:58:01Z nyan $ 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. 17CFLAGS+= -DLOADER_NFS_SUPPORT 18#CFLAGS+= -DLOADER_TFTP_SUPPORT 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# Always add MI sources 36.PATH: ${.CURDIR}/../../common 37.include <${.CURDIR}/../../common/Makefile.inc> 38CFLAGS+= -I${.CURDIR}/../../common 39CFLAGS+= -I${.CURDIR}/../../.. -I. -I${.CURDIR}/../../i386 40 41CLEANFILES+= vers.c vers.o ${BASE}.list ${BASE}.bin ${BASE}.sym ${BASE}.help 42 43CFLAGS+= -Wall 44LDFLAGS= -nostdlib -static -Ttext 0x0 45 46# pc98 standalone support library 47LIBPC98= ${.OBJDIR}/../libpc98/libpc98.a 48CFLAGS+= -I${.CURDIR}/.. 49 50# where to get libstand from 51LIBSTAND= -lstand 52#LIBSTAND= ${.CURDIR}/../../../../lib/libstand/libstand.a 53CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ 54 55# BTX components 56.if exists(${.OBJDIR}/../btx) 57BTXDIR= ${.OBJDIR}/../btx 58.else 59BTXDIR= ${.CURDIR}/../btx 60.endif 61BTXLDR= ${BTXDIR}/btxldr/btxldr 62BTXKERN= ${BTXDIR}/btx/btx 63BTXCRT= ${BTXDIR}/lib/crt0.o 64CFLAGS+= -I${.CURDIR}/../btx/lib 65 66# BTX is expecting ELF components 67CFLAGS+= -elf 68 69# New linker set code 70CFLAGS+= -DNEW_LINKER_SET 71 72# Debug me! 73#CFLAGS+= -g 74#LDFLAGS+= -g 75 76vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version 77 sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version ${NEWVERSWHAT} 78 ${CC} -c vers.c 79 80${BASE}: ${BASE}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT} ${BASE}.help 81 btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ 82 -b ${BTXKERN} ${BASE}.bin 83# /usr/bin/kzip ${.TARGET} 84# mv ${.TARGET}.kz ${.TARGET} 85 86${BASE}.bin: ${BASE}.sym 87 cp ${.ALLSRC} ${.TARGET} 88 strip ${.TARGET} 89 90${BASE}.help: help.common help.i386 91 cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} 92 93beforeinstall: 94.if exists(${DESTDIR}/boot/loader) 95 mv ${DESTDIR}/boot/loader ${DESTDIR}/boot/loader.old 96.endif 97.if exists(${.OBJDIR}/loader.help) 98 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 99 ${.OBJDIR}/${BASE}.help ${DESTDIR}/boot 100.else 101 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 102 ${.CURDIR}/${BASE}.help ${DESTDIR}/boot 103.endif 104.if !exists(${DESTDIR}/boot/loader.rc) 105 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 106 ${.CURDIR}/../../forth/loader.rc ${DESTDIR}/boot 107.endif 108 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 109 ${.CURDIR}/../../forth/loader.4th ${DESTDIR}/boot 110 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 111 ${.CURDIR}/../../forth/support.4th ${DESTDIR}/boot 112 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 113 ${.CURDIR}/../../forth/loader.conf ${DESTDIR}/boot/defaults 114 115.include <${.CURDIR}/../Makefile.inc> 116 117# Cannot use ${OBJS} above this line 118.include <bsd.prog.mk> 119 120${BASE}.sym: ${OBJS} ${LIBPC98} ${LIBSTAND} ${LIBFICL} vers.o 121 ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} vers.o \ 122 ${LIBFICL} ${LIBPC98} ${LIBSTAND} 123 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 134