summaryrefslogtreecommitdiff
path: root/sys/arch/i386/stand/Makefile
blob: b6d233479417ce71348673f59a6310dcea9379ff (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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#	$NetBSD: Makefile,v 1.6 1996/02/01 22:31:28 mycroft Exp $
#	@(#)Makefile	7.9 (Berkeley) 5/8/91

DESTDIR=/usr
LD=/usr/bin/ld
STAND=	/sys/stand
INCPATH=-I/sys/sys -I/sys -I/sys/ufs  -I${STAND}
VPATH=	${STAND}
STANDDIR= ${DESTDIR}/mdec

CC=	cc -traditional
CPP=	cpp -traditional ${INCPATH} -DSTANDALONE -DAT386

RELOC=	98000
RELOC2=	98200

CFLAGS=	-DSTANDALONE -DAT386 -O ${INCPATH}

DRIVERS=cga.c fd.c kbd.c wd.c as.c
SRCS=	boot.c fdbootblk.c prf.c \
	srt0.c wdbootblk.c ${DRIVERS} ${SASRC}

ALL= wdboot bootwd fdboot bootfd asboot bootas

all: ${ALL}

# startups

srt0.o: srt0.c
	${CPP} -E -D_LOCORE -DRELOC=0x${RELOC} srt0.c | ${AS} -o srt0.o

wsrt0.o: srt0.c
	${CPP} -E -D_LOCORE -DSMALL -DRELOC=0x${RELOC} -DREL srt0.c | \
	    ${AS} -o wsrt0.o

relsrt0.o: srt0.c
	${CPP} -E -D_LOCORE -DRELOC=0x${RELOC} -DREL srt0.c | ${AS} -o relsrt0.o

# block 0 boots

wdbootblk.o: wdbootblk.c 
	${CPP} -E -D_LOCORE -DRELOC=0x${RELOC} wdbootblk.c | ${AS} -o $@

fdbootblk.o: fdbootblk.c 
	${CPP} -E -D_LOCORE -DRELOC=0x${RELOC} fdbootblk.c | ${AS} -o $@

asbootblk.o: asbootblk.c 
	cc -c -O -DRELOC=0x${RELOC} ${INCPATH} asbootblk.c

# getting booted from disc

wdboot: wdbootblk.o trimhd
	${LD} -N -T ${RELOC} wdbootblk.o
	rm -f $@; strip a.out; trimhd 32 <a.out >$@; rm -f a.out; ls -l $@

bootwd:	wsrt0.o boot.o bmap.o cga.o fs.o kbd.o prf.o wd.o printf.o breadwd.o trimhd
	${LD} -N -T ${RELOC2} wsrt0.o boot.o bmap.o cga.o kbd.o prf.o printf.o \
		breadwd.o fs.o wd.o -lc
	size a.out
	rm -f $@; strip a.out; trimhd 32 <a.out >$@; rm -f a.out; ls -l $@

fdboot: fdbootblk.o trimhd
	${LD} -N -T ${RELOC} fdbootblk.o
	rm -f $@; strip a.out; trimhd 32 <a.out >$@; rm -f a.out; ls -l $@

bootfd:	wsrt0.o boot.o bmap.o cga.o fs.o kbd.o prf.o fd.o printf.o breadfd.o trimhd
	${LD} -N -T ${RELOC2} wsrt0.o boot.o bmap.o cga.o kbd.o prf.o printf.o \
		breadfd.o fs.o fd.o -lc
	size a.out
	rm -f $@; strip a.out; trimhd 32 <a.out >$@; rm -f a.out; ls -l $@

asboot:	asbootblk.o trimhd
	${LD} -N -T 7c00 asbootblk.o
	rm -f $@; strip a.out; trimhd 32 <a.out >$@; rm -f a.out; ls -l $@

bootas:	wsrt0.o boot.o bmap.o cga.o fs.o kbd.o prf.o as.o printf.o breadas.o trimhd
	${LD} -N -T ${RELOC2} wsrt0.o boot.o bmap.o cga.o kbd.o prf.o printf.o \
		breadas.o fs.o as.o -lc
	size a.out
	rm -f $@; strip a.out; trimhd 32 <a.out >$@; rm -f a.out; ls -l $@


breadwd.o: breadwd.c breadxx.o
breadfd.o: breadfd.c breadxx.o
breadas.o: breadas.c breadxx.o

breadxx.o:
	touch breadxx.o

breadwd.c: breadxx.c
	rm -f breadwd.c
	sed -e 's/XX/wd/' -e 's/xx/wd/g'	< breadxx.c >> breadwd.c

breadfd.c: breadxx.c
	rm -f breadfd.c
	sed -e 's/XX/fd/' -e 's/xx/fd/g'	< breadxx.c >> breadfd.c

breadas.c: breadxx.c
	rm -f breadas.c
	sed -e 's/XX/as/' -e 's/xx/as/g'	< breadxx.c >> breadas.c

trimhd:	trimhd.c
	${CC} ${CFLAGS} -s -o trimhd trimhd.c

clean:
	rm -f *.o *.exe *.i sm_*.c trimhd
	rm -f a.out bfd bwd fdb wdb ${ALL}
	rm -f boot[a-wyz]? boot[a-wyz]?? boot[a-wyz]?.c boot[a-wyz]??.c \
		conf[a-wyz]?.c conf[a-wyz]??.c bread[a-wyz]?.c

cleandir: clean
	rm -f ${MAN} tags .depend

depend: ${SRCS}
	mkdep ${INCPATH} -DSTANDALONE ${SRCS} ${DUMMIES}

install: ${ALL}
	cp ${ALL} ${STANDDIR}