Makefile revision 1.13
1#	$NetBSD: Makefile,v 1.13 2017/04/08 19:53:21 christos Exp $
2#	@(#)Makefile	8.2 (Berkeley) 8/15/93
3
4NOMAN= # defined
5
6.include <bsd.own.mk>
7
8S= ${.CURDIR}/../../../..
9LIBSADIR=	${S}/lib/libsa
10
11CPPFLAGS+=	-nostdinc -D_STANDALONE
12CPPFLAGS+=	-I${.CURDIR} -I${.OBJDIR} -I${S} -I${S}/arch
13
14CPPFLAGS+=	-DSUPPORT_DISK
15#CPPFLAGS+=	-DSUPPORT_TAPE
16CPPFLAGS+=	-DSUPPORT_ETHERNET
17CPPFLAGS+=	-DSUPPORT_DHCP -DSUPPORT_BOOTP
18#CPPFLAGS+=	-DBOOTP_DEBUG -DNETIF_DEBUG -DETHER_DEBUG -DNFS_DEBUG
19#CPPFLAGS+=	-DRPC_DEBUG -DRARP_DEBUG -DNET_DEBUG -DDEBUG -DPARANOID
20CPPFLAGS+=	-DLIBSA_ENABLE_LS_OP
21CPPFLAGS+=	-DLIBSA_PRINTF_WIDTH_SUPPORT
22CPPFLAGS+=	-DLIBSA_CREAD_NOCRC
23
24CFLAGS=		-Os -msoft-float
25CFLAGS+=	-ffreestanding
26CFLAGS+=	-Wall -Werror
27CFLAGS+=	-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
28CFLAGS+=	-Wno-pointer-sign
29
30TEXTADDR=	700000
31LDSCRIPT=	${.CURDIR}/boot.ldscript
32LINKFORMAT=	-static -N -Ttext ${TEXTADDR} -T ${LDSCRIPT}
33
34SRCS=	locore.S
35SRCS+=	init_main.c autoconf.c
36SRCS+=	trap.c
37SRCS+=	devopen.c
38SRCS+=	conf.c
39SRCS+=	machdep.c
40SRCS+=	getline.c parse.c
41SRCS+=	boot.c
42SRCS+=	cons.c prf.c awaitkey.c
43SRCS+=	romcons.c
44SRCS+=	sio.c
45SRCS+=	bmc.c bmd.c screen.c font.c kbd.c
46SRCS+=	scsi.c sc.c sd.c
47#SRCS+=	st.c tape.c
48SRCS+=	disklabel.c
49#SRCS+=	fsdump.c
50SRCS+=	ufs_disksubr.c
51SRCS+=	ls.c
52
53# netboot support
54SRCS+=	if_le.c lance.c getsecs.c
55.PATH: ${LIBSADIR}
56SRCS+=	dev_net.c
57
58PROG=   boot
59
60NEWVERSWHAT=	"${PROG}"
61
62### find out what to use for libkern
63KERN_AS=	library
64.include "${S}/lib/libkern/Makefile.inc"
65
66### find out what to use for libz
67Z_AS=		library
68.include "${S}/lib/libz/Makefile.inc"
69
70### find out what to use for libsa
71SA_AS=		library
72SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes SA_ENABLE_LS_OP=yes
73.include "${S}/lib/libsa/Makefile.inc"
74
75LIBS=	${SALIB} ${ZLIB} ${KERNLIB}
76
77.include "${S}/conf/newvers_stand.mk"
78
79${PROG}: ${LDSCRIPT} ${OBJS} ${LIBS}
80	${LD} ${LINKFORMAT} -x -o ${PROG}.elf ${OBJS} ${LIBS}
81	${ELF2AOUT} ${PROG}.elf ${PROG}.aout
82	mv ${PROG}.aout ${PROG}
83
84CLEANFILES+=	${PROG}.aout ${PROG}.elf
85
86cleandir distclean: .WAIT cleanlibdir
87
88cleanlibdir:
89	-rm -rf lib
90
91.include <bsd.klinks.mk>
92.include <bsd.prog.mk>
93