1 # $NetBSD: Makefile,v 1.13 2013/06/30 21:54:26 matt Exp $ 2 3 NOMAN= # defined 4 5 .include <bsd.own.mk> 6 7 S= ${.CURDIR}/../../../.. 8 9 WARNS= 2 10 PROG= ofwboot 11 SRCS= srt0.S Locore.c alloc.c boot.c ofdev.c net.c netif_of.c vers.c 12 CFLAGS+= -ffreestanding -Wno-main 13 #CPPFLAGS+= -DDEBUG -DNETIF_DEBUG 14 CPPFLAGS+= -DSUPPORT_DHCP -I${.CURDIR} 15 CPPFLAGS+= -D_STANDALONE 16 DBG= -Os 17 18 SRCS+= byteorder.c 19 .PATH: ${S}/lib/libsa 20 21 # XXX SHOULD NOT NEED TO DEFINE THESE! 22 LIBCRT0= 23 LIBC= 24 LIBCRTBEGIN= 25 LIBCRTEND= 26 27 STRIPFLAG= 28 BINMODE= 444 29 30 NEWVERSWHAT= "OpenFirmware Boot" 31 32 RELOC= f0000000 33 34 ENTRY= _start 35 36 CLEANFILES+= vers.c 37 38 CPPFLAGS+= -nostdinc -I. -I${.CURDIR}/../../.. -I${S} 39 CPPFLAGS+= -DRELOC=0x${RELOC} 40 CFLAGS+= -fno-unwind-tables 41 CPUFLAGS= -mcpu=strongarm 42 43 .if !make(obj) && !make(clean) && !make(cleandir) 44 .BEGIN: 45 @[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine 46 @[ -h arm ] || ln -s ${S}/arch/arm/include arm 47 .endif 48 49 .NOPATH: machine arm 50 CLEANFILES+= machine arm 51 52 CLEANFILES+= ${PROG}.aout 53 54 ### find out what to use for libkern 55 KERN_AS= library 56 .include "${S}/lib/libkern/Makefile.inc" 57 LIBKERN= ${KERNLIB} 58 59 ### find out what to use for libz 60 Z_AS= library 61 .include "${S}/lib/libz/Makefile.inc" 62 LIBZ= ${ZLIB} 63 64 ### find out what to use for libsa 65 SA_AS= library 66 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes 67 .include "${S}/lib/libsa/Makefile.inc" 68 LIBSA= ${SALIB} 69 70 .PHONY: vers.c 71 vers.c: version 72 ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \ 73 ${.CURDIR}/version "shark" ${NEWVERSWHAT} 74 75 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 76 ${_MKTARGET_LINK} 77 ${LD} -s -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${.TARGET}.aout \ 78 ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 79 ${OBJCOPY} -O binary ${.TARGET}.aout ${.TARGET} 80 81 .include <bsd.prog.mk> 82