Makefile revision 1.9
1#	$NetBSD: Makefile,v 1.9 2011/03/06 13:55:12 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 nif.c
9SRCS+=		fxp.c tlp.c rge.c skg.c stg.c dsk.c pciide.c siisata.c
10SRCS+=		printf.c vers.c
11CLEANFILES+=	vers.c ${PROG} ${PROG}.bin ${PROG}.img
12CFLAGS+=	-Wall -Wno-main -ffreestanding -msoft-float -mmultiple
13CFLAGS+=	-Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
14CPPFLAGS+=	-D_STANDALONE -DSUPPORT_DHCP
15#CPPFLAGS+=	-DCONSNAME=\"com\" -DCONSPORT=0x3f8 -DCONSSPEED=115200
16#CPPFLAGS+=	-DCONSNAME=\"eumb\" -DCONSPORT=0x4600 -DCONSSPEED=57600
17CPPFLAGS+=	-nostdinc -I. -I${.OBJDIR} -I${S}
18DBG=		-Os
19
20.include <bsd.own.mk>
21
22# XXX SHOULD NOT NEED TO DEFINE THESE!
23LIBCRT0=
24LIBC=
25LIBCRTBEGIN=
26LIBCRTEND=
27
28STRIPFLAG=
29BINMODE=	444
30
31RELOC=		1000000
32ENTRY=		_start
33
34.if !make(obj) && !make(clean) && !make(cleandir)
35.BEGIN:
36	@[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine
37	@[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc
38.NOPATH: machine powerpc
39.endif
40CLEANFILES+= machine powerpc
41
42### find out what to use for libkern
43KERN_AS=	library
44.include "${S}/lib/libkern/Makefile.inc"
45LIBKERN=	${KERNLIB}
46
47### find out what to use for libz
48Z_AS=		library
49.include "${S}/lib/libz/Makefile.inc"
50LIBZ=		${ZLIB}
51
52### find out what to use for libsa
53SA_AS=		library
54SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
55.include "${S}/lib/libsa/Makefile.inc"
56LIBSA=		${SALIB}
57
58.PHONY: vers.c
59vers.c: version
60	${HOST_SH} ${S}/conf/newvers_stand.sh -K \
61	    ${${MKREPRO} == "yes" :?:-D} ${.CURDIR}/version "sandpoint"
62
63${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
64	${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG} \
65	    ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
66	${OBJCOPY} -S -O binary ${PROG} ${PROG}.bin
67	${TOOL_MKUBOOTIMAGE} -A powerpc -T kernel -C none -O linux \
68	    -a 0x${RELOC} -n ${PROG} ${PROG}.bin ${PROG}.img
69
70.include <bsd.prog.mk>
71