Makefile revision 1.12
1#	$NetBSD: Makefile,v 1.12 2013/11/04 21:18:05 christos 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 -mabi=apcs-gnu -mfloat-abi=soft
19.if ${HAVE_GCC} < 48
20CPPFLAGS+=	-mno-thumb -mno-thumb-interwork
21.endif
22CPUFLAGS=
23DBG=		-Os
24
25LIBCRT0=	# nothing
26LIBCRTBEGIN=	# nothing
27LIBCRTEND=	# nothing
28LIBC=		# nothing
29
30MAN=		# no manual page
31NOMAN=		# defined
32STRIPFLAG=
33BINMODE=	444
34
35RELOC=		0x30A00000
36ENTRY=		_start
37
38### find out what to use for libkern
39KERN_AS=	library
40.include "${S}/lib/libkern/Makefile.inc"
41LIBKERN=	${KERNLIB}
42
43### find out what to use for libz
44Z_AS=		library
45.include "${S}/lib/libz/Makefile.inc"
46LIBZ=		${ZLIB}
47
48### find out what to use for libsa
49SA_AS=		library
50SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
51.include "${S}/lib/libsa/Makefile.inc"
52LIBSA=		${SALIB}
53
54.PHONY: vers.c
55vers.c: version
56	${HOST_SH} ${S}/conf/newvers_stand.sh -K \
57	    ${${MKREPRO} == "yes" :?:-D} ${.CURDIR}/version "evbarm"
58
59${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
60	${_MKTARGET_LINK}
61	${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${.TARGET}.elf \
62	    ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
63	${OBJCOPY} -S -O binary ${.TARGET}.elf ${.TARGET}
64
65.include <bsd.prog.mk>
66