summaryrefslogtreecommitdiff
path: root/bootblocks/Makefile
blob: 9a4ccd910d56ba151ccf241b8678387045a6e450 (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

HOSTCC=cc
HOSTCCFLAGS=-O

CC=bcc
CFLAGS=-ansi -O -Ms
AS=as86
ASFLAGS=-0
# LST=-l $*.lst

nothing:
	@more README

all: makeboot monitor.out bin

CSRC=minix.c
SSRC=tarboot.s skip.s com_bcc.s tich.s sysboot.s bootlist.s mbr.s msdos.s

encap: $(SSRC:s=v) $(CSRC:c=v)
bin: $(SSRC:s=bin) $(CSRC:c=bin)

MOBJ=monitor.o i86_funcs.o relocate.o
MSRC=monitor.c i86_funcs.c relocate.c

install:

monitor.out: $(MOBJ)
	$(CC) $(CFLAGS) $(MOBJ) -o monitor.out

monitor: $(MSRC)
	@rm -f $(MOBJ)
	make 'CFLAGS=-ansi -O' monitor.out
	mv monitor.out monitor
	@rm -f $(MOBJ)

minix.s: minix.c
	bcc -Mf -O -S minix.c

makeboot:	tarboot.v sysboot.v makeboot.c
	$(HOSTCC) $(HOSTCCFLAGS) -o makeboot makeboot.c

dosboot:	dosboot.c sysboot.v skip.v msdos.v
	$(HOSTCC) $(HOSTCCFLAGS) -o dosboot dosboot.c

clean:
	rm -f monitor makeboot dosboot minix.s *.o *.bin *.out *.lst *.sym *.v

tgz: minix.bin monitor.out makeboot
	tar cfV bootblocks.tar ENIAC monitor.out \
	        README Makefile \
		$(MSRC) dosboot.c makeboot.c \
		$(CSRC) $(SSRC) \
		makeboot minix.bin
	makeboot bootblocks.tar
	gzip -f9 bootblocks.tar

distribution:
	tar czf /tmp/bootblocks.tar.gz README Makefile \
		$(MSRC) dosboot.c makeboot.c \
		$(CSRC) $(SSRC)

.SUFFIXES: .bin .v

.s.bin:
	$(AS) $(ASFLAGS) -b $*.bin -s $*.sym -l $*.lst $*.s

.s.v:
	as86_encap $*.s $*.v $*_ $(ASFLAGS) $(LST)