summaryrefslogtreecommitdiff
path: root/sys/arch/luna68k/stand/boot/Makefile
blob: 29b10355d6fd742f9d0e431f7271f407a3f3c681 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#	$NetBSD: Makefile,v 1.18 2021/06/15 17:17:57 tsutsui Exp $
#	@(#)Makefile	8.2 (Berkeley) 8/15/93

NOMAN= # defined
NOPIE= # defined

.include <bsd.own.mk>

S= ${.CURDIR}/../../../..
LIBSADIR=	${S}/lib/libsa

CPPFLAGS+=	-nostdinc -D_STANDALONE
CPPFLAGS+=	-I${.CURDIR} -I${.OBJDIR} -I${S} -I${S}/arch

CPPFLAGS+=	-DSUPPORT_DISK
#CPPFLAGS+=	-DSUPPORT_TAPE
CPPFLAGS+=	-DSUPPORT_ETHERNET
CPPFLAGS+=	-DSUPPORT_DHCP -DSUPPORT_BOOTP
#CPPFLAGS+=	-DBOOTP_DEBUG -DNETIF_DEBUG -DETHER_DEBUG -DNFS_DEBUG
#CPPFLAGS+=	-DRPC_DEBUG -DRARP_DEBUG -DNET_DEBUG -DDEBUG -DPARANOID
CPPFLAGS+=	-DLIBSA_ENABLE_LS_OP
CPPFLAGS+=	-DLIBSA_PRINTF_WIDTH_SUPPORT
CPPFLAGS+=	-DLIBSA_CREAD_NOCRC

CFLAGS=		-Os -fno-unwind-tables -msoft-float
CFLAGS+=	-ffreestanding
CFLAGS+=	-Wall -Werror
CFLAGS+=	-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
CFLAGS+=	-Wno-pointer-sign

TEXTADDR=	700000
LDSCRIPT=	${.CURDIR}/boot.ldscript
LINKFORMAT=	-static -N -Ttext ${TEXTADDR} -T ${LDSCRIPT}

ELF2AOUT_OPTS=	-O	# LUNA's firmware requires OMAGIC a.out

SRCS=	locore.S
SRCS+=	init_main.c autoconf.c
SRCS+=	trap.c
SRCS+=	devopen.c
SRCS+=	conf.c
SRCS+=	machdep.c
SRCS+=	getline.c parse.c
SRCS+=	boot.c
SRCS+=	cons.c prf.c awaitkey.c
SRCS+=	romcons.c
SRCS+=	sio.c
SRCS+=	bmc.c bmd.c screen.c font.c kbd.c
SRCS+=	scsi.c sc.c sd.c
#SRCS+=	st.c tape.c
SRCS+=	disklabel.c
#SRCS+=	fsdump.c
SRCS+=	ufs_disksubr.c
SRCS+=	ls.c

# netboot support
SRCS+=	if_le.c lance.c getsecs.c
.PATH: ${LIBSADIR}
SRCS+=	dev_net.c

PROG=   boot

NEWVERSWHAT=	"${PROG}"

### find out what to use for libkern
KERN_AS=	library
.include "${S}/lib/libkern/Makefile.inc"

### find out what to use for libz
Z_AS=		library
.include "${S}/lib/libz/Makefile.inc"

### find out what to use for libsa
SA_AS=		library
SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes SA_ENABLE_LS_OP=yes
.include "${S}/lib/libsa/Makefile.inc"

LIBS=	${SALIB} ${ZLIB} ${KERNLIB}

.include "${S}/conf/newvers_stand.mk"

${PROG}: ${LDSCRIPT} ${OBJS} ${LIBS}
	${_MKTARGET_LINK}
	${LD} ${LINKFORMAT} -x -o ${PROG}.elf ${OBJS} ${LIBS}
	${M68K_ELF2AOUT} ${ELF2AOUT_OPTS} ${PROG}.elf ${PROG}.aout
	mv ${PROG}.aout ${PROG}

CLEANFILES+=	${PROG}.aout ${PROG}.elf

cleandir distclean: .WAIT cleanlibdir

cleanlibdir:
	-rm -rf lib

.include <bsd.klinks.mk>
.include <bsd.prog.mk>