1 # $NetBSD: Makefile,v 1.10 2013/08/15 21:41:08 matt Exp $ 2 3 S= ${.CURDIR}/../../../.. 4 5 PROG= bootmini2440 6 SRCS= entry.S main.c devopen.c netif.c dev_net.c dm9000.c dev_sdmmc.c 7 SRCS+= s3csdi.c vers.c 8 9 .include <bsd.own.mk> 10 11 CLEANFILES+= vers.c ${PROG}.elf 12 CFLAGS+= -Wall -Wno-main -ffreestanding -fno-unwind-tables 13 CPPFLAGS+= -D_STANDALONE -DSUPPORT_DHCP -DLIBSA_PRINTF_WIDTH_SUPPORT 14 CPPFLAGS+= -DDM9000MAC="0x08,0x08,0x11,0x18,0x12,0x27" 15 CPPFLAGS+= -DDEFAULT_BOOTFILE="ld0a:netbsd;net:" 16 CPPFLAGS+= -nostdinc -I. -I${.OBJDIR} -I${S} -I${S}/arch 17 CPPFLAGS+= -march=armv4 -mabi=apcs-gnu -mfloat-abi=soft 18 CPPFLAGS+= -mno-thumb -mno-thumb-interwork 19 CPUFLAGS= 20 DBG= 21 22 LIBCRT0= # nothing 23 LIBCRTBEGIN= # nothing 24 LIBCRTEND= # nothing 25 LIBC= # nothing 26 27 MAN= # no manual page 28 NOMAN= # defined 29 STRIPFLAG= 30 BINMODE= 444 31 32 RELOC= 0x30A00000 33 ENTRY= _start 34 35 .if !make(obj) && !make(clean) && !make(cleandir) 36 .BEGIN: 37 @[ -h machine ] || ln -s ${S}/arch/evbarm/include machine 38 @[ -h arm ] || ln -s ${S}/arch/arm/include arm 39 .NOPATH: machine arm 40 .endif 41 CLEANFILES+= machine arm 42 43 ### find out what to use for libkern 44 KERN_AS= library 45 .include "${S}/lib/libkern/Makefile.inc" 46 LIBKERN= ${KERNLIB} 47 48 ### find out what to use for libz 49 Z_AS= library 50 .include "${S}/lib/libz/Makefile.inc" 51 LIBZ= ${ZLIB} 52 53 ### find out what to use for libsa 54 SA_AS= library 55 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes 56 .include "${S}/lib/libsa/Makefile.inc" 57 LIBSA= ${SALIB} 58 59 .PHONY: vers.c 60 vers.c: version 61 ${HOST_SH} ${S}/conf/newvers_stand.sh -K \ 62 ${${MKREPRO} == "yes" :?:-D} ${.CURDIR}/version "evbarm" 63 64 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 65 ${_MKTARGET_LINK} 66 ${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${.TARGET}.elf \ 67 ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 68 ${OBJCOPY} -S -O binary ${.TARGET}.elf ${.TARGET} 69 70 .include <bsd.prog.mk> 71