blob: 0dd6ee9ecf3ed7d0090e85571552b9c5692490d6 (
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
98
|
# $NetBSD: Makefile,v 1.7.2.1 1995/10/17 00:19:13 phil Exp $
# @(#)Makefile 8.1 (Berkeley) 6/10/93
#DESTDIR=
STANDDIR=${DESTDIR}/stand
# load at 0x400000 - 18 * 1024 - 0x10000
# that way the boot code will be at the correct
# address if the floppy image is started from memory
# NOTE: alloc() function takes memory after _end
RELOC= 3EB800
CONS= -DSCNCONSOLE
DEFS= -DSTANDALONE ${CONS}
CFLAGS= -O ${INCPATH} ${DEFS} -fwritable-strings
SRCS= cons.c devopen.c scn.c scsi_low.c scsi_hi.c \
conf.c prf.c tgets.c machdep.c sd.c rd.c filesystem.c
S= ${.CURDIR}/../../..
SAREL=
KERNREL=
.PATH: ${S}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
.PATH: ${S}/stand ${S}/lib/libsa
INCPATH=-I${.CURDIR} -I${.CURDIR}/../.. -I${S} -I${S}/lib/libsa
### find out what to use for libs
.include "../../../lib/libkern/Makefile.inc"
LIBKERN= ${KERNLIB}
NO_NET=
.include "../../../lib/libsa/Makefile.inc"
LIBSA= ${SALIB}
#LIBS= ${LIBSA} ${.OBJDIR}/libdrive.a \
# ${LIBKERN} ${LIBSA} ${LIBKERN}
LIBS= ${LIBSA} ${.OBJDIR}/libdrive.a \
${LIBKERN} ${LIBSA}
BOOTS= boot zboot.o
ALL= ${BOOTS}
all: ${ALL}
${BOOTS}: ${LIBS}
OBJS= ${SRCS:N*.h:R:S/$/.o/g}
${.OBJDIR}/libdrive.a: ${OBJS}
ar crv $@ $?
ranlib $@
# depend on DEFS
devopen.o machdep.o srt0.o: Makefile
cons.o: Makefile
# startups
srt0.o: ${.CURDIR}/srt0.s
cpp ${INCPATH} ${DEFS} ${.CURDIR}/srt0.s | as -o srt0.o
# new boot
boot: boot.o srt0.o ${LIBS}
ld -z -T ${RELOC} -e begin srt0.o boot.o ${LIBS} -o $@
@size boot
zboot.o: inflate.o
ld -r srt0.o inflate.o $(LIBS) -o zboot.o
# new boot user mode test
TESTBOOT= boot.o test.o $(SC) ${LIBS}
# objects from regular libc;
SC= cerror.o syscall.o malloc.o sbrk.o getpagesize.o
testboot: $(TESTBOOT)
ld -o testboot /usr/lib/crt0.o $(TESTBOOT) ${LIBS} -o $@
$(SC): /usr/lib/libc.a
ar x /usr/lib/libc.a $(SC)
# utilities
install: ${ALL}
cp ${ALL} ${DESTDIR}/usr/mdec
.include <bsd.dep.mk>
.include <bsd.obj.mk>
.include <bsd.subdir.mk>
FRC:
# clean ...
clean::
rm -f ${ALL} ${.OBJDIR}/libdrive.a ${OBJS} boot.o srt0.o inflate.o
cleandir: clean
|