Makefile revision 1.10
1#	$NetBSD: Makefile,v 1.10 2013/08/15 21:41:08 matt 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
11CLEANFILES+=	vers.c ${PROG}.elf
12CFLAGS+=	-Wall -Wno-main -ffreestanding -fno-unwind-tables
13CPPFLAGS+=	-D_STANDALONE -DSUPPORT_DHCP -DLIBSA_PRINTF_WIDTH_SUPPORT
14CPPFLAGS+=	-DDM9000MAC="0x08,0x08,0x11,0x18,0x12,0x27" 
15CPPFLAGS+=	-DDEFAULT_BOOTFILE="ld0a:netbsd;net:"
16CPPFLAGS+=	-nostdinc -I. -I${.OBJDIR} -I${S} -I${S}/arch
17CPPFLAGS+=	-march=armv4 -mabi=apcs-gnu -mfloat-abi=soft
18CPPFLAGS+=	-mno-thumb -mno-thumb-interwork
19CPUFLAGS=
20DBG=		
21
22LIBCRT0=	# nothing
23LIBCRTBEGIN=	# nothing
24LIBCRTEND=	# nothing
25LIBC=		# nothing
26
27MAN=		# no manual page
28NOMAN=		# defined
29STRIPFLAG=
30BINMODE=	444
31
32RELOC=		0x30A00000
33ENTRY=		_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
41CLEANFILES+= machine arm
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