Makefile revision 1.4
1#	$NetBSD: Makefile,v 1.4 2012/07/20 14:53:27 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 -march=armv4
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
17DBG=		
18
19LIBCRT0=	# nothing
20LIBCRTBEGIN=	# nothing
21LIBCRTEND=	# nothing
22LIBC=		# nothing
23
24MAN=		# no manual page
25NOMAN=		# defined
26STRIPFLAG=
27BINMODE=	444
28
29RELOC=		0x30A00000
30ENTRY=		_start
31
32.if !make(obj) && !make(clean) && !make(cleandir)
33.BEGIN:
34	@[ -h machine ] || ln -s ${S}/arch/evbarm/include machine
35	@[ -h arm ] || ln -s ${S}/arch/arm/include arm
36.NOPATH: machine arm
37.endif
38CLEANFILES+= machine arm
39
40### find out what to use for libkern
41KERN_AS=	library
42.include "${S}/lib/libkern/Makefile.inc"
43LIBKERN=	${KERNLIB}
44
45### find out what to use for libz
46Z_AS=		library
47.include "${S}/lib/libz/Makefile.inc"
48LIBZ=		${ZLIB}
49
50### find out what to use for libsa
51SA_AS=		library
52SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
53.include "${S}/lib/libsa/Makefile.inc"
54LIBSA=		${SALIB}
55
56.PHONY: vers.c
57vers.c: version
58	${HOST_SH} ${S}/conf/newvers_stand.sh -K \
59	    ${${MKREPRO} == "yes" :?:-D} ${.CURDIR}/version "evbarm"
60
61${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
62	${_MKTARGET_LINK}
63	${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${.TARGET}.elf \
64	    ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
65	${OBJCOPY} -S -O binary ${.TARGET}.elf ${.TARGET}
66
67.include <bsd.prog.mk>
68