Home | History | Annotate | Line # | Download | only in boot
Makefile revision 1.21
      1 #	$NetBSD: Makefile,v 1.21 2006/09/19 17:51:24 matt Exp $
      2 
      3 NOMAN= # defined
      4 
      5 .include <bsd.own.mk>
      6 
      7 COMMON= ${.CURDIR}/../common
      8 COMMONOBJ!=	cd ${COMMON} && ${PRINTOBJDIR}
      9 
     10 .PATH: ${.CURDIR}/../boot ${COMMONOBJ}
     11 
     12 S= ${.CURDIR}/../../../..
     13 L= ${COMMONOBJ}/lib
     14 
     15 BASE?=		boot
     16 PROG=		${BASE}
     17 NEWVERSWHAT=	"BOOT"
     18 
     19 SRCS= srt0.s
     20 SRCS+= boot.c clock.c com.c conf.c cons.c devopen.c
     21 SRCS+= filesystem.c inkernel.c io.c tgets.c prf.c monitor.c
     22 SRCS+= kbd.c ns16550.c vers.c vreset.c vga.c 
     23 
     24 CFLAGS= -Os -mmultiple -ffreestanding
     25 AFLAGS= -x assembler-with-cpp -traditional-cpp
     26 
     27 CPPFLAGS= -nostdinc -I${.OBJDIR} -I${.CURDIR}/../mkbootimage -I${S}
     28 CPPFLAGS+= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes
     29 CPPFLAGS+= -D_STANDALONE -DRELOC=${RELOC} -DUSE_SCAN
     30 CPPFLAGS+= -D__daddr_t=int32_t
     31 #CPPFLAGS+= -DDBMONITOR
     32 
     33 .if (${BASE} == "boot")
     34 CPPFLAGS+= -DCONS_VGA -DVGA_RESET
     35 .elif (${BASE} == "boot_com0")
     36 CPPFLAGS+= -DCONS_SERIAL -DCOMSPEED=9600 -DCOMPORT=0x3f8
     37 .elif (${BASE} == "boot_com0_vreset")
     38 CPPFLAGS+= -DCONS_SERIAL -DCOMSPEED=9600 -DCOMPORT=0x3f8 -DVGA_RESET
     39 .endif
     40 
     41 STRIPFLAG=
     42 BINMODE= 444
     43 
     44 # XXX SHOULD NOT NEED TO DEFINE THESE!
     45 LIBCRT0=
     46 LIBC=
     47 LIBCRTBEGIN=
     48 LIBCRTEND=
     49 
     50 RELOC= 0x800000
     51 
     52 CLEANFILES+= vers.c machine powerpc ${PROG}.elf
     53 
     54 LIBS= ${L}/sa/libsa.a ${L}/kern/libkern.a ${L}/z/libz.a
     55 
     56 .if !make(obj) && !make(clean) && !make(cleandir)
     57 .BEGIN: machine powerpc
     58 .NOPATH: machine powerpc
     59 
     60 machine::
     61 	-rm -f $@
     62 	ln -s ${S}/arch/${MACHINE}/include $@
     63 
     64 powerpc::
     65 	-rm -f $@
     66 	ln -s ${S}/arch/powerpc/include $@
     67 .endif
     68 
     69 vers.c: ${.CURDIR}/../boot/version
     70 	${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/../boot/version "prep" ${NEWVERSWHAT}
     71 
     72 ${PROG}: ${OBJS} ${LIBS}
     73 	${LD} -o ${PROG}.elf -N -T ${.CURDIR}/../boot/ld.script \
     74 		-Ttext ${RELOC} ${OBJS} ${LIBS}
     75 	${STRIP} -o ${PROG} ${PROG}.elf
     76 
     77 .include <bsd.prog.mk>
     78