Home | History | Annotate | Line # | Download | only in boot
Makefile revision 1.17
      1 #	$NetBSD: Makefile,v 1.17 2005/12/28 09:10:26 skrll 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 fd.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 video.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 -DDBMONITOR -DRELOC=${RELOC} -DUSE_SCAN
     30 CPPFLAGS+= -D__daddr_t=int32_t
     31 
     32 .if (${BASE} == "boot")
     33 CPPFLAGS+= -DCONS_VGA
     34 #CPPFLAGS+= -DCONS_FB
     35 .elif (${BASE} == "boot_com0")
     36 CPPFLAGS+= -DCONS_SERIAL -DCOMSPEED=9600 -DCOMPORT=0x3f8
     37 .endif
     38 
     39 STRIPFLAG=
     40 BINMODE= 444
     41 
     42 # XXX SHOULD NOT NEED TO DEFINE THESE!
     43 LIBCRT0=
     44 LIBC=
     45 LIBCRTBEGIN=
     46 LIBCRTEND=
     47 
     48 RELOC= 0x800000
     49 
     50 CLEANFILES+= vers.c machine powerpc
     51 
     52 LIBS= ${L}/sa/libsa.a ${L}/kern/libkern.a ${L}/z/libz.a
     53 
     54 .if !make(obj) && !make(clean) && !make(cleandir)
     55 .BEGIN: machine powerpc
     56 .NOPATH: machine powerpc
     57 
     58 machine::
     59 	-rm -f $@
     60 	ln -s ${S}/arch/${MACHINE}/include $@
     61 
     62 powerpc::
     63 	-rm -f $@
     64 	ln -s ${S}/arch/powerpc/include $@
     65 .endif
     66 
     67 vers.c: ${.CURDIR}/../boot/version
     68 	${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/../boot/version "prep" ${NEWVERSWHAT}
     69 
     70 ${PROG}: ${OBJS} ${LIBS}
     71 	${LD} -o ${PROG} -s -N -T ${.CURDIR}/../boot/ld.script \
     72 		-Ttext ${RELOC} ${OBJS} ${LIBS}
     73 
     74 .include <bsd.prog.mk>
     75