summaryrefslogtreecommitdiff
path: root/bootblocks/Makefile
blob: 85393a7f9eb5f04dea0229793e15cea472b14e8d (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
BCC=bcc

CC=$(BCC)
CFLAGS=-ansi -Ms -H0x10000 -s
ASFLAGS=-0
# LST=-l $*.lst

default: makeboot makeboot.com monitor.out

all: default tgz 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 help.o bzimage.o dosfs.o nofs.o
MSRC=monitor.c i86_funcs.c relocate.c help.c bzimage.c dosfs.c nofs.c

install:

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

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

minix.s: minix.c
	$(BCC) -Mc -S minix.c

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

makeboot.com:	makeboot.c sysboot.v skip.v msdos.v tarboot.v
	$(BCC) -Md -o makeboot.com makeboot.c

clean realclean:
	rm -f monitor makeboot bootblocks.tar.gz
	rm -f minix.s *.com *.o *.bin *.out *.lst *.sym *.v

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

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

.SUFFIXES: .bin .v

.s.bin:
	$(BCC) -c $*.s -A-b -A$*.bin -A-s -A$*.sym -A-l -A$*.lst

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