xref: /netbsd-src/sys/arch/luna68k/stand/boot/Makefile (revision 6d322f2f4598f0d8a138f10ea648ec4fabe41f8b)
1#	$NetBSD: Makefile,v 1.9 2013/01/22 15:48:40 tsutsui Exp $
2#	@(#)Makefile	8.2 (Berkeley) 8/15/93
3
4NOMAN= # defined
5
6.include <bsd.own.mk>
7.include <bsd.sys.mk>
8
9S= ${.CURDIR}/../../../..
10LIBSADIR=	${S}/lib/libsa
11
12CPPFLAGS+=	-nostdinc -D_STANDALONE
13CPPFLAGS+=	-I${.CURDIR} -I${.OBJDIR} -I${S} -I${S}/arch
14
15CPPFLAGS+=	-DSUPPORT_DISK
16#CPPFLAGS+=	-DSUPPORT_TAPE
17CPPFLAGS+=	-DSUPPORT_ETHERNET
18CPPFLAGS+=	-DSUPPORT_DHCP -DSUPPORT_BOOTP
19#CPPFLAGS+=	-DBOOTP_DEBUG -DNETIF_DEBUG -DETHER_DEBUG -DNFS_DEBUG
20#CPPFLAGS+=	-DRPC_DEBUG -DRARP_DEBUG -DNET_DEBUG -DDEBUG -DPARANOID
21CPPFLAGS+=	-DLIBSA_ENABLE_LS_OP
22CPPFLAGS+=	-DLIBSA_PRINTF_WIDTH_SUPPORT
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 ioconf.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
62SRCS+=          vers.c
63CLEANFILES+=    vers.c
64
65### find out what to use for libkern
66KERN_AS=	library
67.include "${S}/lib/libkern/Makefile.inc"
68
69### find out what to use for libz
70Z_AS=		library
71.include "${S}/lib/libz/Makefile.inc"
72
73### find out what to use for libsa
74SA_AS=		library
75SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes SA_ENABLE_LS_OP=yes
76.include "${S}/lib/libsa/Makefile.inc"
77
78LIBS=	${SALIB} ${ZLIB} ${KERNLIB}
79
80.PHONY: vers.c
81vers.c: ${.CURDIR}/version
82	${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
83	    ${.CURDIR}/version ${MACHINE} ${NEWVERSWHAT}
84
85${PROG}: ${LDSCRIPT} ${OBJS} ${LIBS}
86	${LD} ${LINKFORMAT} -x -o ${PROG}.elf ${OBJS} ${LIBS}
87	${ELF2AOUT} ${PROG}.elf ${PROG}.aout
88	mv ${PROG}.aout ${PROG}
89
90CLEANFILES+=	${PROG}.aout ${PROG}.elf
91
92cleandir distclean: .WAIT cleanlibdir
93
94cleanlibdir:
95	-rm -rf lib
96
97.include <bsd.klinks.mk>
98.include <bsd.prog.mk>
99