1 # $NetBSD: Makefile,v 1.8 2001/12/12 12:24:25 lukem 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 AFLAGS= -x assembler-with-cpp -traditional-cpp 25 26 CPPFLAGS= -nostdinc -I${.OBJDIR} -I${.CURDIR}/../mkbootimage -I${S} 27 CPPFLAGS+= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes 28 CPPFLAGS+= -D_STANDALONE -DDBMONITOR -DRELOC=${RELOC} -DUSE_SCAN 29 30 .if (${BASE} == "boot") 31 CPPFLAGS+= -DCONS_VGA 32 #CPPFLAGS+= -DCONS_FB 33 .elif (${BASE} == "boot_com0") 34 CPPFLAGS+= -DCONS_SERIAL -DCOMSPEED=9600 -DCOMPORT=0x3f8 35 .endif 36 37 OBJDUMP?= objdump 38 STRIPFLAG= 39 BINMODE= 444 40 41 RELOC= 0x800000 42 HEAD_SIZE= `${OBJDUMP} -h ${.OBJDIR}/${PROG} | grep \.text | awk '{print $$6}'` 43 KERN_OFFSET= `ls -l ${.OBJDIR}/${PROG} | awk '{print $$5}'` 44 45 CLEANFILES+= vers.c machine powerpc 46 47 LIBS= ${L}/sa/libsa.a ${L}/kern/libkern.a ${L}/z/libz.a 48 49 .BEGIN: machine powerpc 50 .NOPATH: machine powerpc 51 realdepend realall: machine powerpc 52 53 machine:: 54 -rm -f $@ 55 ln -s ${S}/arch/${MACHINE}/include $@ 56 57 powerpc:: 58 -rm -f $@ 59 ln -s ${S}/arch/powerpc/include $@ 60 61 vers.c: ${.CURDIR}/../boot/version 62 sh ${S}/conf/newvers_stand.sh ${.CURDIR}/../boot/version "prep" ${NEWVERSWHAT} 63 64 ${PROG}: ${OBJS} machine powerpc 65 ${LD} -o ${PROG} -s -N -T ${.CURDIR}/../boot/ld.script \ 66 -Ttext ${RELOC} ${OBJS} ${LIBS} 67 ${COMPILE.c} -DKERN_OFFSET=${KERN_OFFSET} -DHEAD_SIZE=0x${HEAD_SIZE} \ 68 ${.CURDIR}/../boot/inkernel.c 69 ${LD} -o ${PROG} -s -N -T ${.CURDIR}/../boot/ld.script \ 70 -Ttext ${RELOC} ${OBJS} ${LIBS} 71 72 .include <bsd.prog.mk> 73