blob: d7ec4faa7d05e3b90b56ba46f3d694dcab2536f1 (
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
119
120
121
122
123
124
125
126
127
128
129
130
131
|
HOSTCC=cc
HOSTCCFLAGS=-O
BCC=bcc
AS86=as86
DEFS=
CC=$(BCC)
CFLAGS=-ansi -Ms -Oi -O -s $(DEFS)
# CFLAGS=-ansi -Ms
ASFLAGS=-0 -w
MINIXDEFS=-DDOTS
# LST=-l $*.lst
default: makeboot makeboot.com monitor.out minix_elks.bin lsys.com
all: bootbin bootsys default tgz
bootsys: bootfile.sys boottar.sys bootminix.sys monitor.sys
CSRC=minix.c
SSRC=sysboot.s tarboot.s skip.s mbr.s msdos.s noboot.s \
boot_fpy.s killhd.s bb_linux.s bb_init1.s bb_init2.s
encap: $(SSRC:s=v) $(CSRC:c=v) minixhd.v msdos16.v
bootbin: $(SSRC:s=bin) $(CSRC:c=bin) minixhd.bin msdos16.bin minix_elks.bin
MOBJ=monitor.o commands.o i86_funcs.o relocate.o help.o bzimage.o \
buffer.o unix.o fs.o fs_tar.o fs_min.o fs_dos.o
MSRC=monitor.c commands.c i86_funcs.c relocate.c help.c bzimage.c \
buffer.c unix.c fs.c fs_tar.c fs_min.c fs_dos.c
MINC=i86_funcs.h readfs.h monitor.h
BOOTBLOCKS=sysboot.v noboot.v skip.v msdos.v msdos16.v \
tarboot.v minix.v minixhd.v mbr.v killhd.v
EXTRAS=minix.h zimage.s minix_elks.c lsys.c
install:
monitor.com: $(MOBJ)
$(CC) $(CFLAGS) $(MONDEFS) -H0x10000 -d $(MOBJ) -o monitor.com -M > monitor.sym
monitor.out: $(MOBJ)
$(CC) $(CFLAGS) $(MONDEFS) -H0x10000 $(MOBJ) -o monitor.out -M > monitor.sym
$(MOBJ): $(MINC)
fs_min.o: minix.h
bootfile.sys: $(MSRC) $(MINC)
@rm -f $(MOBJ)
make 'CFLAGS=$(CFLAGS) -DDOSFLOPPY -i -d' monitor.out
mv monitor.out bootfile.sys
@rm -f $(MOBJ)
boottar.sys: $(MSRC) $(MINC) tarboot.bin
@rm -f $(MOBJ)
make 'CFLAGS=$(CFLAGS) -DTARFLOPPY -i' monitor.out
mv monitor.out boottar.sys
@rm -f $(MOBJ)
bootminix.sys: $(MSRC) $(MINC) minix.bin
@rm -f $(MOBJ)
make 'CFLAGS=$(CFLAGS) -DMINFLOPPY -i' monitor.out
mv monitor.out bootminix.sys
@rm -f $(MOBJ)
monitor.sys: $(MSRC) $(MINC)
@rm -f $(MOBJ)
make 'CFLAGS=$(CFLAGS) -DNOMONITOR -i' monitor.out
mv monitor.out monitor.sys
@rm -f $(MOBJ)
monitor: $(MSRC) $(MINC)
@rm -f $(MOBJ)
make 'CFLAGS=-ansi -H0x8000' monitor.out
mv monitor.out monitor
@rm -f $(MOBJ)
bzimage.o: bzimage.c zimage.v
minix.s: minix.c Makefile
$(CC) -Mf -O -DTRY_FLOPPY $(MINIXDEFS) -S minix.c
minix_elks.s: minix_elks.c Makefile minix.v
$(CC) -Mf -O $(MINIXDEFS) -S minix_elks.c
minixhd.s: minix.c Makefile
$(CC) -Mf -O -DHARDDISK $(MINIXDEFS) -S minix.c -o minixhd.s
msdos16.s: msdos.s
sed 's/^fatbits=12/fatbits=16/' < msdos.s > msdos16.s
makeboot: makeboot.c $(BOOTBLOCKS)
$(HOSTCC) $(HOSTCCFLAGS) -o makeboot makeboot.c
makeboot.com: makeboot.c $(BOOTBLOCKS)
$(CC) -Md -O -o makeboot.com makeboot.c
lsys.com: lsys.c msdos.v msdos16.v
$(CC) -Md -O -o lsys.com lsys.c
clean realclean:
rm -f bootfile.sys boottar.sys bootminix.sys monitor.sys
rm -f monitor makeboot bootblocks.tar.gz
rm -f minix.s minixhd.s minix_elks.s msdos16.s
rm -f *.com *.o *.bin *.out *.lst *.sym *.v *.tmp
tgz: minix.bin monitor.out makeboot.com makeboot
tar cfV bootblocks.tar ENIAC monitor.out \
README Makefile \
$(MSRC) \
$(MINC) \
makeboot.c $(CSRC) \
$(SSRC) \
makeboot.com minix.bin \
$(EXTRAS)
makeboot tar bootblocks.tar
gzip -f9 bootblocks.tar
distribution:
tar czf /tmp/bootblocks.tar.gz \
README Makefile $(MSRC) $(MINC) makeboot.c $(CSRC) $(SSRC) $(EXTRAS)
.SUFFIXES: .bin .v
.s.bin:
$(AS86) -w- -0 -b $*.bin -s $*.sym $*.s $(LST)
.s.v:
as86_encap $*.s $*.v $*_ $(ASFLAGS) $(LST)
|