xref: /netbsd-src/sys/arch/landisk/stand/Makefile.bootprogs (revision fff57c5525bbe431aee7bdb3983954f0627a42cb)
1# $NetBSD: Makefile.bootprogs,v 1.1 2006/09/01 21:26:18 uwe Exp $
2
3S=		${.CURDIR}/../../../../..
4
5NOMAN=		# defined
6
7BINDIR=		/usr/mdec
8BINMODE=	0444
9
10PRIMARY_LOAD_ADDRESS?=0x8c201000
11SECONDARY_LOAD_ADDRESS?=0x8ff00000
12
13.include <bsd.own.mk>
14
15STRIPFLAG=	# override
16
17LIBCRT0=	# nothing
18LIBCRTBEGIN=	# nothing
19LIBCRTEND=	# nothing
20LIBC=		# nothing
21
22.PATH:	${.CURDIR}/..
23
24COPTS=		-Os -ffreestanding
25
26LDFLAGS+=	-N
27CFLAGS+=	-Wall -Wmissing-prototypes -Wstrict-prototypes
28CPPFLAGS+=	-nostdinc -D_STANDALONE
29CPPFLAGS+=	-DSH4
30CPPFLAGS+=	-I${.OBJDIR} -I${.CURDIR}/.. -I${.CURDIR}/../../boot -I${S}
31
32LANDISK_STAND_DIR?= $S/arch/landisk/stand
33
34CLEANFILES+=	machine sh3
35
36.if !make(obj) && !make(clean) && !make(cleandir)
37.BEGIN: machine sh3
38.NOPATH: machine sh3
39
40machine::
41	-rm -f $@
42	ln -s ${S}/arch/${MACHINE}/include $@
43
44sh3::
45	-rm -f $@
46	ln -s ${S}/arch/sh3/include $@
47.endif
48
49lib:
50.ifdef LIBOBJ
51	-rm -f $@
52	ln -s ${LIBOBJ}/lib .
53	[ -d ${LIBOBJ}/lib ] || mkdir ${LIBOBJ}/lib
54.else
55	mkdir lib
56.endif
57
58### find out what to use for libsa
59SA_AS= library
60.include "${S}/lib/libsa/Makefile.inc"
61LIBSA= ${SALIB}
62CPPFLAGS+=	-I$(SADIR)
63
64### find out what to use for libkern
65KERN_AS= library
66.include "${S}/lib/libkern/Makefile.inc"
67LIBKERN= ${KERNLIB}
68
69### find out what to use for libz
70Z_AS= library
71.include "${S}/lib/libz/Makefile.inc"
72LIBZ= ${ZLIB}
73
74realdepend realall: lib
75
76cleandir distclean: cleanlibdir
77
78cleanlibdir:
79	-rm -rf lib
80