File:  [DragonFly] / src / sys / boot / i386 / loader / Attic / Makefile
Revision 1.5: download - view: text, annotated - select for diffs
Wed Jan 28 19:24:14 2004 UTC (10 years, 9 months ago) by dillon
Branches: MAIN
CVS tags: HEAD, DragonFly_1_0_REL, DragonFly_1_0_RC1, DragonFly_1_0A_REL
Undo some of the previously made changes to deal with cross build issues
from 4.x and older versions of DFly.

sys.mk should *NOT* include bsd.init.mk.  That is way, way too early and
blows up .inc files, e.g. such as those used by sys/boot.

Rename .sub back to .inc in sys/boot (more on the way) so it will cross build
from 4.x.

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