1 # $NetBSD: Makefile,v 1.24 2011/01/21 15:59:08 joerg 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 26 CFLAGS= -Os -mmultiple -ffreestanding 27 CFLAGS+= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes 28 AFLAGS= -x assembler-with-cpp 29 30 CPPFLAGS= -nostdinc -I${.OBJDIR} -I${MKBOOTIMAGE} -I${S} 31 CPPFLAGS+= -D_STANDALONE -DRELOC=${RELOC} -DUSE_SCAN 32 CPPFLAGS+= -D__daddr_t=int32_t 33 #CPPFLAGS+= -DDBMONITOR 34 35 .if (${BASE} == "boot") 36 CPPFLAGS+= -DCONS_VGA -DVGA_RESET 37 .elif (${BASE} == "boot_com0") 38 CPPFLAGS+= -DCONS_SERIAL -DCOMSPEED=9600 -DCOMPORT=0x3f8 39 .elif (${BASE} == "boot_com0_vreset") 40 CPPFLAGS+= -DCONS_SERIAL -DCOMSPEED=9600 -DCOMPORT=0x3f8 -DVGA_RESET 41 .endif 42 43 STRIPFLAG= 44 BINMODE= 444 45 46 # XXX SHOULD NOT NEED TO DEFINE THESE! 47 LIBCRT0= 48 LIBC= 49 LIBCRTBEGIN= 50 LIBCRTEND= 51 52 RELOC= 0x800000 53 54 CLEANFILES+= vers.c machine powerpc ${PROG}.elf 55 56 LIBS= ${L}/sa/libsa.a ${L}/kern/libkern.a ${L}/z/libz.a 57 58 .if !make(obj) && !make(clean) && !make(cleandir) 59 .BEGIN: machine powerpc 60 .NOPATH: machine powerpc 61 62 machine:: 63 -rm -f $@ 64 ln -s ${S}/arch/${MACHINE}/include $@ 65 66 powerpc:: 67 -rm -f $@ 68 ln -s ${S}/arch/powerpc/include $@ 69 .endif 70 71 vers.c: ${.CURDIR}/../boot/version 72 ${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/../boot/version "prep" ${NEWVERSWHAT} 73 74 ${PROG}: ${OBJS} ${LIBS} 75 ${LD} -o ${PROG}.elf -N -T ${.CURDIR}/../boot/ld.script \ 76 -Ttext ${RELOC} ${OBJS} ${LIBS} 77 ${STRIP} -o ${PROG} ${PROG}.elf 78 79 .include <bsd.prog.mk> 80