Home | History | Annotate | Line # | Download | only in boot
Makefile revision 1.27
      1 #	$NetBSD: Makefile,v 1.27 2013/08/21 06:49:44 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 MKBOOTIMAGE= ${.CURDIR}/../../../powerpc/stand/mkbootimage
     16 
     17 BASE?=		boot
     18 PROG=		${BASE}
     19 NEWVERSWHAT=	"BOOT"
     20 
     21 SRCS= srt0.s
     22 SRCS+= boot.c clock.c com.c conf.c cons.c devopen.c
     23 SRCS+= filesystem.c inkernel.c io.c tgets.c prf.c monitor.c
     24 SRCS+= kbd.c ns16550.c vers.c vreset.c vga.c 
     25 SRCS+= pci.c sd.c siop.c
     26 
     27 CFLAGS= -Os -mmultiple -ffreestanding
     28 CFLAGS+= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes
     29 AFLAGS= -x assembler-with-cpp
     30 
     31 CPPFLAGS= -nostdinc -I${.OBJDIR} -I${MKBOOTIMAGE} -I${S}
     32 CPPFLAGS+= -D_STANDALONE -DRELOC=${RELOC} -DUSE_SCAN
     33 CPPFLAGS+= -D__daddr_t=int32_t
     34 #CPPFLAGS+= -DDBMONITOR
     35 
     36 .if (${BASE} == "boot")
     37 CPPFLAGS+= -DCONS_VGA -DVGA_RESET
     38 .elif (${BASE} == "boot_com0")
     39 CPPFLAGS+= -DCONS_SERIAL -DCOMSPEED=9600 -DCOMPORT=0x3f8
     40 .elif (${BASE} == "boot_com0_vreset")
     41 CPPFLAGS+= -DCONS_SERIAL -DCOMSPEED=9600 -DCOMPORT=0x3f8 -DVGA_RESET
     42 .endif
     43 
     44 STRIPFLAG=
     45 BINMODE= 444
     46 
     47 # XXX SHOULD NOT NEED TO DEFINE THESE!
     48 LIBCRT0=
     49 LIBC=
     50 LIBCRTBEGIN=
     51 LIBCRTEND=
     52 
     53 RELOC= 0x800000
     54 
     55 CLEANFILES+= vers.c machine powerpc ${PROG}.elf
     56 
     57 LIBS= ${L}/sa/libsa.a ${L}/kern/libkern.a ${L}/z/libz.a
     58 
     59 vers.c: ${.CURDIR}/../boot/version
     60 	${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
     61 	    ${.CURDIR}/../boot/version "prep" ${NEWVERSWHAT}
     62 
     63 ${PROG}: ${OBJS} ${LIBS}
     64 	${_MKTARGET_LINK}
     65 	${LD} -o ${PROG}.elf -N -T ${.CURDIR}/../boot/ld.script \
     66 		-Ttext ${RELOC} ${OBJS} ${LIBS}
     67 	${STRIP} -o ${PROG} ${PROG}.elf
     68 
     69 .include <bsd.prog.mk>
     70 .include <bsd.klinks.mk>
     71