Makefile revision 1.15
1#	$NetBSD: Makefile,v 1.15 2013/12/15 18:08:37 joerg 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
30LIBCRTBEGIN=	# nothing
31LIBCRTEND=	# nothing
32LIBC=		# nothing
33
34MAN=		# no manual page
35NOMAN=		# defined
36STRIPFLAG=
37BINMODE=	444
38
39RELOC=		0x30A00000
40ENTRY=		_start
41
42### find out what to use for libkern
43KERN_AS=	library
44.include "${S}/lib/libkern/Makefile.inc"
45LIBKERN=	${KERNLIB}
46
47### find out what to use for libz
48Z_AS=		library
49.include "${S}/lib/libz/Makefile.inc"
50LIBZ=		${ZLIB}
51
52### find out what to use for libsa
53SA_AS=		library
54SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
55.include "${S}/lib/libsa/Makefile.inc"
56LIBSA=		${SALIB}
57
58.PHONY: vers.c
59vers.c: version
60	${HOST_SH} ${S}/conf/newvers_stand.sh -K \
61	    ${${MKREPRO} == "yes" :?:-D} ${.CURDIR}/version "evbarm"
62
63${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
64	${_MKTARGET_LINK}
65	${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${.TARGET}.elf \
66	    ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
67	${OBJCOPY} -S -O binary ${.TARGET}.elf ${.TARGET}
68
69.include <bsd.prog.mk>
70