1 # $NetBSD: Makefile,v 1.29 2014/08/08 16:56:31 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 SRCS+= pci.c sd.c siop.c 26 27 CFLAGS= -Os -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 LIBCRTI= 50 LIBC= 51 LIBCRTBEGIN= 52 LIBCRTEND= 53 54 RELOC= 0x800000 55 56 CLEANFILES+= vers.c machine powerpc ${PROG}.elf 57 58 LIBS= ${L}/sa/libsa.a ${L}/kern/libkern.a ${L}/z/libz.a 59 60 vers.c: ${.CURDIR}/../boot/version 61 ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \ 62 ${.CURDIR}/../boot/version "prep" ${NEWVERSWHAT} 63 64 ${PROG}: ${OBJS} ${LIBS} 65 ${_MKTARGET_LINK} 66 ${LD} -o ${PROG}.elf -N -T ${.CURDIR}/../boot/ld.script \ 67 -Ttext ${RELOC} ${OBJS} ${LIBS} 68 ${STRIP} -o ${PROG} ${PROG}.elf 69 70 .include <bsd.prog.mk> 71 .include <bsd.klinks.mk> 72