Makefile revision 1.4
1#	$NetBSD: Makefile,v 1.4 2011/01/27 04:32:49 nisimura Exp $
2
3S=		${.CURDIR}/../../../..
4
5PROG=		altboot
6NOMAN=		# defined
7SRCS=		entry.S main.c brdsetup.c pci.c devopen.c dev_net.c nif.c \
8		fxp.c tlp.c rge.c skg.c dsk.c pciide.c siisata.c printf.c
9CLEANFILES+=	vers.c vers.o ${PROG} ${PROG}.bin
10CFLAGS+=	-Wall -Wno-main -ffreestanding -msoft-float -mmultiple
11CFLAGS+=	-Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
12CPPFLAGS+=	-D_STANDALONE -DSUPPORT_DHCP
13#CPPFLAGS+=	-DCONSNAME=\"com\" -DCONSPORT=0x3f8 -DCONSSPEED=115200
14#CPPFLAGS+=	-DCONSNAME=\"eumb\" -DCONSPORT=0x4600 -DCONSSPEED=57600
15CPPFLAGS+=	-nostdinc -I. -I${.OBJDIR} -I${S}
16DBG=		-Os
17
18.include <bsd.own.mk>
19
20# XXX SHOULD NOT NEED TO DEFINE THESE!
21LIBCRT0=
22LIBC=
23LIBCRTBEGIN=
24LIBCRTEND=
25
26STRIPFLAG=
27BINMODE=	444
28
29RELOC=		1000000
30ENTRY=		_start
31
32.if !make(obj) && !make(clean) && !make(cleandir)
33.BEGIN:
34	@[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine
35	@[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc
36.NOPATH: machine powerpc
37.endif
38CLEANFILES+= machine powerpc
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${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
57	echo ${OBJS}
58	${HOST_SH} ${S}/conf/newvers_stand.sh -K \
59	    ${${MKREPRO} == "yes" :?:-D} ${.CURDIR}/version sandpoint
60	${CC} -c vers.c
61	${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG} \
62	    ${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBKERN}
63	${OBJCOPY} -S -O binary ${.TARGET} ${.TARGET}.bin
64
65.include <bsd.prog.mk>
66
67cleandir distclean: .WAIT cleanlibdir
68
69cleanlibdir:
70	-rm -rf lib
71