blob: c346d5fd1332f727476aac3be7486f6ec953923e (
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
97
|
# $NetBSD: Makefile,v 1.31 2023/02/09 15:20:40 tsutsui Exp $
NOMAN= # defined
S= ${.CURDIR}/../../../..
### find out what to use for libkern
KERN_AS= library
.include "${S}/lib/libkern/Makefile.inc"
#LIBKERN= ${KERNLIB}
### find out what to use for libz
Z_AS= library
.include "${S}/lib/libz/Makefile.inc"
#LIBZ= ${ZLIB}
### find out what to use for libsa
SA_AS= library
SAMISCMAKEFLAGS= SA_USE_LOADFILE=yes # SA_USE_CREAD=yes
.include "${S}/lib/libsa/Makefile.inc"
#LIBSA= ${SALIB}
RELOC= 4380000
# XXX make defs arch-indep.
INCLUDES+= -I${.OBJDIR} -I${S}/arch -I${S} -I${S}/lib/libsa
DEFS+= -D_STANDALONE -DMC68040 -DSUPPORT_BOOTP -DSUPPORT_DHCP
#DEFS+= -DDEBUG -DSD_DEBUG -DSCSI_DEBUG -DEN_DEBUG -DNETIF_DEBUG
SAMISCCPPFLAGS= -DSUPPORT_DHCP -DSUPPORT_BOOTP -DSA_EXEC_ANYOWNER
#SAMISCCPPFLAGS+= -DBOOTP_DEBUG -DETHER_DEBUG -DNET_DEBUG-DNETIF_DEBUG
#SAMISCCPPFLAGS+= -DNFS_DEBUG -DARP_DEBUG
WARNS=1
CFLAGS+= -ffreestanding -nostdinc ${INCLUDES} ${DEFS}
CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
AFLAGS+= ${INCLUDES}
# XXX SHOULD NOT NEED TO DEFINE THESE!
LIBCRT0=
LIBCRTI=
LIBC=
LIBCRTBEGIN=
LIBCRTEND=
PROG= boot
SRCS= boot.c machdep.c conf.c devopen.c rtc.c sd.c scsi.c en.c build.c
# @@@ dev_net.c should really be in libsa, but it doesn't
# declare ip_convertaddr correctly, so I put it here _temporarily_.
.PATH: ${S}/lib/libsa
SRCS+= dev_net.c
CLEANFILES+= srt0.o boot.elf boot.raw limits.h
CLEANFILES+= build.c build # generated dynamically
BINDIR= /usr/mdec
#LIBS= ${SALIB} ${KERNLIB} ${ZLIB}
LIBS= ${SALIB} ${KERNLIB}
# do not strip ${PROG} on install
STRIPFLAG= # defined
AWKPROG='\
function x(v) { printf "\\0\\%o\\%o\\%o", (v / 65536) % 256, (v / 256) % 256, v % 256 } \
{ \
printf "\047\\0\\207\\01\\07"; \
x($$1); \
x($$2); \
x($$3); \
printf "\\0\\0\\0\\0\\04\\070\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\047" \
}'
${PROG}: srt0.o ${OBJS} ${LIBS}
${_MKTARGET_LINK}
${LD} -N -Ttext ${RELOC} -e start srt0.o ${OBJS} ${LIBS} -o $@.elf
${SIZE} $@.elf
${OBJCOPY} -O binary $@.elf $@.raw
(${SIZE} $@.elf | tail +2 | ${TOOL_AWK} ${AWKPROG} | \
xargs printf ; cat $@.raw) > $@
# startup
srt0.o: ${.CURDIR}/srt0.s
${CC} -m68040 -x assembler-with-cpp ${INCLUDES} ${DEFS} -c ${.CURDIR}/srt0.s
.PHONY: build.c
build.c:
${HOST_SH} ${.CURDIR}/newvers.sh
.include "${S}/conf/newvers_stand.mk"
#installboot: ${.CURDIR}/installboot.sh
# @rm -f installboot
# cp -p ${.CURDIR}/installboot.sh installboot
# utilities
.include <bsd.prog.mk>
.include <bsd.klinks.mk>
|