Makefile revision 1.12
1#	$NetBSD: Makefile,v 1.12 2011/10/30 20:42:09 phx Exp $
2
3S=		${.CURDIR}/../../../..
4
5PROG=		altboot
6FILES+=		${PROG}.bin ${PROG}.img
7NOMAN=		# defined
8SRCS=		entry.S main.c brdsetup.c pci.c devopen.c dev_net.c memfs.c
9SRCS+=		nif.c fxp.c tlp.c rge.c skg.c stg.c
10SRCS+=		dsk.c pciide.c siisata.c
11SRCS+=		exception.c vers.c
12CLEANFILES+=	vers.c ${PROG} ${PROG}.bin ${PROG}.img
13CFLAGS+=	-Wall -Wno-main -ffreestanding -msoft-float -mmultiple
14CFLAGS+=	-Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
15CPPFLAGS+=	-D_STANDALONE -DSUPPORT_DHCP -DLIBSA_PRINTF_WIDTH_SUPPORT
16#CPPFLAGS+=	-DCONSNAME=\"com\" -DCONSPORT=0x3f8 -DCONSSPEED=115200
17#CPPFLAGS+=	-DCONSNAME=\"eumb\" -DCONSPORT=0x4600 -DCONSSPEED=57600
18CPPFLAGS+=	-nostdinc -I. -I${.OBJDIR} -I${S}
19DBG=		-Os
20
21.include <bsd.own.mk>
22
23# XXX SHOULD NOT NEED TO DEFINE THESE!
24LIBCRT0=
25LIBC=
26LIBCRTBEGIN=
27LIBCRTEND=
28
29STRIPFLAG=
30BINMODE=	444
31
32RELOC=		1000000
33ENTRY=		_start
34
35.if !make(obj) && !make(clean) && !make(cleandir)
36.BEGIN:
37	@[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine
38	@[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc
39.NOPATH: machine powerpc
40.endif
41CLEANFILES+= machine powerpc
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 "sandpoint"
63
64${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
65	${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG} \
66	    ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
67	${OBJCOPY} -S -O binary ${PROG} ${PROG}.bin
68	${TOOL_MKUBOOTIMAGE} -A powerpc -T kernel -C none -O linux \
69	    -a 0x${RELOC} -n ${PROG} ${PROG}.bin ${PROG}.img
70
71.include <bsd.prog.mk>
72