Home | History | Annotate | Line # | Download | only in boot
Makefile revision 1.7
      1 #	$NetBSD: Makefile,v 1.7 1999/06/24 01:10:31 sakamoto Exp $
      2 
      3 S= ${.CURDIR}/../../../..
      4 
      5 BASE= boot
      6 BOOTPROG= ${BASE}.pef
      7 NEWVERSWHAT= "BOOT"
      8 
      9 ASRCS+= srt0.s
     10 CSRCS+= boot.c clock.c com.c conf.c cons.c cpu.c devopen.c
     11 CSRCS+= fd.c filesystem.c inkernel.c io.c tgets.c prf.c monitor.c
     12 CSRCS+= kbd.c ns16550.c vreset.c vga.c video.c
     13 
     14 CLEANFILES+= vers.c vers.o netbsd.gz ${BASE} ${BOOTPROG} elf2pef
     15 
     16 CPPFLAGS= -I${.CURDIR} -I${.CURDIR}/../../.. -I${S} -I${S}/lib/libsa
     17 CPPFLAGS+= -D_STANDALONE -DDBMONITOR -DRELOC=${RELOC} -DENTRY=${ENTRY}
     18 #CPPFLAGS+= -DUSE_SCAN
     19 #CPPFLAGS+= -DCONS_BE
     20 #CPPFLAGS+= -DCONS_VGA
     21 CPPFLAGS+= -DCONS_SERIAL -DCOMSPEED=9600 -DCOMPORT=0x3F8
     22 
     23 AOBJS=	${ASRCS:.s=.o}
     24 COBJS=	${CSRCS:.c=.o}
     25 OBJS=	${AOBJS} ${COBJS}
     26 AFLAGS= -x assembler-with-cpp -traditional-cpp
     27 MKMAN=	no
     28 STRIPFLAG=
     29 BINMODE= 444
     30 
     31 ENTRY= 0x3100
     32 RELOC= 0x700000
     33 
     34 CLEANFILES+= ${.OBJDIR}/machine ${.OBJDIR}/powerpc
     35 
     36 .BEGIN:
     37 	@[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine
     38 	@[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc
     39 
     40 KERNEL?= ${S}/arch/bebox/compile/GENERIC/netbsd
     41 
     42 ### find out what to use for libkern
     43 KERN_AS=	library
     44 .include "${S}/lib/libkern/Makefile.inc"
     45 LIBKERN=	${KERNLIB}
     46 
     47 ### find out what to use for libz
     48 Z_AS=		library
     49 .include "${S}/lib/libz/Makefile.inc"
     50 LIBZ=		${ZLIB}
     51 
     52 ### find out what to use for libsa
     53 SA_AS=		library
     54 SAMISCMAKEFLAGS= SA_USE_CREAD=yes
     55 .include "${S}/lib/libsa/Makefile.inc"
     56 LIBSA=		${SALIB}
     57 
     58 all: ${BOOTPROG}
     59 
     60 ${BOOTPROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} elf2pef
     61 	sh ${.CURDIR}/../newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
     62 	${COMPILE.c} vers.c
     63 	${LD} -o ${BASE} -s -N -T ld.script -Ttext ${RELOC} ${OBJS} \
     64 		${LIBSA} ${LIBZ} ${LIBKERN} vers.o
     65 .if exists (${KERNEL})
     66 	cat ${KERNEL} | gzip -9 > ${.CURDIR}/netbsd.gz
     67 	${.CURDIR}/elf2pef ${BASE} $@ ${.CURDIR}/netbsd.gz
     68 .else
     69 	${.CURDIR}/elf2pef ${BASE} $@
     70 .endif
     71 
     72 
     73 elf2pef: elf2pef.c pef.h
     74 	${HOST_LINK.c} -I/usr/include -I${.CURDIR} \
     75 		-DENTRY=${ENTRY} -o ${.TARGET} ${.IMPSRC}
     76 
     77 .include <bsd.prog.mk>
     78