Makefile revision 1.6
1#	$NetBSD: Makefile,v 1.6 2011/01/23 13:17:02 joerg Exp $
2
3PROG=		zboot
4
5S=		${.CURDIR}/../../../..
6
7SRCS=		crt0.c
8SRCS+=		boot.c bootinfo.c bootmenu.c conf.c devopen.c diskprobe.c
9SRCS+=		loadfile_zboot.c
10SRCS+=		getsecs.c termios.c unixcons.c unixdev.c unixsys.S
11
12NOMAN=		# defined
13
14.include <bsd.own.mk>
15
16CFLAGS+=	-Wall -Wno-main
17CFLAGS+=	-Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
18CFLAGS+=	-fno-stack-protector -fno-builtin -ffreestanding
19CPPFLAGS+=	-nostdinc -I. -I${.CURDIR} -I${.OBJDIR} -I${S}
20CPPFLAGS+=	-D_STANDALONE -DHEAP_VARIABLE
21AFLAGS+=	-D_LOCORE
22LDFLAGS+=	-nostdlib -Bstatic
23
24CLEANFILES+=	vers.c vers.o
25
26LIBCRT0=	crt0.o
27LIBC=		# nothing
28LIBCRTBEGIN=	# nothing
29LIBCRTEND=	# nothing
30
31NEWVERSWHAT?=   "Boot"
32VERSIONFILE?=	${.CURDIR}/version
33
34### find out what to use for libkern
35KERN_AS=		library
36.include "${S}/lib/libkern/Makefile.inc"
37LIBKERN=	${KERNLIB}
38
39### find out what to use for libz
40Z_AS=		library
41.include "${S}/lib/libz/Makefile.inc"
42LIBZ=		${ZLIB}
43
44### find out what to use for libsa
45SA_AS=		library
46SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
47.include "${S}/lib/libsa/Makefile.inc"
48LIBSA=		${SALIB}
49
50${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
51	${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
52	    ${VERSIONFILE} ${MACHINE} ${NEWVERSWHAT}
53	${CC} -c vers.c
54	${LD} ${LDFLAGS} -o ${PROG} ${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBKERN}
55
56.include <bsd.klinks.mk>
57.include <bsd.prog.mk>
58
59cleandir distclean: .WAIT cleanlibdir
60
61cleanlibdir:
62	-rm -rf lib
63
64release: check_RELEASEDIR
65	${HOST_INSTALL_FILE} -m ${BINMODE} ${PROG} \
66	    ${RELEASEDIR}/${MACHINE}/installation
67