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