1# $NetBSD: Makefile,v 1.16 2014/01/12 15:26:28 tsutsui Exp $ 2 3S= ${.CURDIR}/../../../.. 4 5PROG= bootmini2440 6SRCS= entry.S main.c devopen.c netif.c dev_net.c dm9000.c dev_sdmmc.c 7SRCS+= s3csdi.c vers.c 8 9.include <bsd.own.mk> 10.include <bsd.klinks.mk> 11 12CLEANFILES+= vers.c ${PROG}.elf 13CFLAGS+= -Wall -Wno-main -ffreestanding -fno-unwind-tables 14CPPFLAGS+= -D_STANDALONE -DSUPPORT_DHCP -DLIBSA_PRINTF_WIDTH_SUPPORT 15CPPFLAGS+= -DDM9000MAC="0x08,0x08,0x11,0x18,0x12,0x27" 16CPPFLAGS+= -DDEFAULT_BOOTFILE="ld0a:netbsd;net:" 17CPPFLAGS+= -nostdinc -I. -I${.OBJDIR} -I${S} -I${S}/arch 18CPPFLAGS+= -march=armv4 ${ARM_APCS_FLAGS} 19.if ${HAVE_LLVM:Uno} != "no" || ${HAVE_GCC:U0} >= 48 20CPPFLAGS+= -marm 21.else 22CPPFLAGS+= -mno-thumb -mno-thumb-interwork 23.endif 24CPUFLAGS= 25DBG= -Os 26 27CWARNFLAGS.clang+= -Wno-asm-operand-widths 28 29LIBCRT0= # nothing 30LIBCRTI= # nothing 31LIBCRTBEGIN= # nothing 32LIBCRTEND= # nothing 33LIBC= # nothing 34 35MAN= # no manual page 36NOMAN= # defined 37STRIPFLAG= 38BINMODE= 444 39 40RELOC= 0x30A00000 41ENTRY= _start 42 43### find out what to use for libkern 44KERN_AS= library 45.include "${S}/lib/libkern/Makefile.inc" 46LIBKERN= ${KERNLIB} 47 48### find out what to use for libz 49Z_AS= library 50.include "${S}/lib/libz/Makefile.inc" 51LIBZ= ${ZLIB} 52 53### find out what to use for libsa 54SA_AS= library 55SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes 56.include "${S}/lib/libsa/Makefile.inc" 57LIBSA= ${SALIB} 58 59.PHONY: vers.c 60vers.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