2 # Makefile for BCC tests
10 CINCL = /usr/lib/bcc/include
13 COPT = -ansi -I$(CINCL) -c -O -DDEBUG=0
14 LOPT = -m >$*.map -M -d
24 $(CC) $(COPT) -o $@ $< -A-l -A$*.lis
27 $(LINK) $(LOPT) -o $@ $^
30 $(AS) $(AOPT) -l $*.lis -o $@ $<
32 all: check test4d.com test4.com test5.com bootdiagnostic.b.gz
35 # You need the bcc compiler for some steps!
36 @if [ -x /usr/bin/bcc -o -x /usr/local/bin/bcc ]; then echo Okay; \
37 else echo "*** WARNING ***"; \
38 echo "You don't seem to have the 'bcc' compiler from the 'dev86' package. "; \
39 echo "***************"; exit 1; \
42 floppy: bootdiagnostic.b.gz
44 @echo Insert a blank, formatted, floppy into drive 0
45 @echo "Press <Enter> to continue, <^C> to abort ..."
47 gzip -d <bootdiagnostic.b.gz | dd of=/dev/fd0 bs=1024
49 bootdiagnostic.b.gz: check2 sector.b test4.com test4d.com
50 rm -rf $(MFILE) bootdiagnostic.b
52 dd if=/dev/zero of=bootdiagnostic.b bs=1024 count=$(FDSIZE)
53 mkfs.msdos bootdiagnostic.b
54 dd if=sector.b bs=2 count=1 of=floppy.b
55 dd if=bootdiagnostic.b bs=2 skip=1 count=30 >>floppy.b
56 dd if=sector.b bs=2 skip=31 count=225 >>floppy.b
57 mount -t msdos -o loop=$(LOOP) bootdiagnostic.b $(MFILE)
58 dd if=floppy.b of=$(LOOP) bs=512
60 cp -ufv ../COPYING $(MFILE)
61 cp -ufv test4.com $(MFILE)/hipboot.sys
62 cp -ufv test4.com $(MFILE)/diag2sa.com
63 cp -ufv test4d.com $(MFILE)/diag2.com
64 if [ -f ../disk.b ]; then cp -ufv ../disk.b $(MFILE)/diag1.com; fi
67 gzip -9 <bootdiagnostic.b >bootdiagnostic.b.gz
68 rm -f bootdiagnostic.b
71 # You need root permissions for some steps! (Test with mkfs.msdos)
72 @if [ `which mkfs.msdos | grep -c mkfs` -eq 1 ]; then echo Okay; \
73 else echo "*** WARNING ***"; \
74 echo -n "You don't seem to have the commands 'mkfs.msdos'. "; \
75 echo "Perhaps you are not ROOT ?"; \
76 echo "***************"; exit 1; \
79 test4.com: test4.o bios_start.o cprintf.o
81 test5.com: test5.o bios_start.o cprintf.o
84 test4.o: test4.c ../src/bdata.h
85 test5.o: test5.c ../src/bdata.h
88 bcc -c -u -I$(CINCL) -DL_bios_start -D__AS386_16__ -D__STANDALONE__ -o bios_start.o bios.c -v
90 test4d.o: test4.c ../src/bdata.h
91 bcc -Md $(COPT) -o $@ $<
94 bcc -Md $(LOPT) -o $@ $^
97 $(CPP) -traditional -o $@ $<
103 dd if=$< of=$@ bs=32 skip=1
106 dd if=sector.b bs=2 count=1 of=floppy.b
107 dd if=$(FD) bs=2 skip=1 count=30 >>floppy.b
108 dd if=sector.b bs=2 skip=31 count=225 >>floppy.b
111 rm -f *.map *.lis core
114 rm -f *.o *.s *.img *.b *.com *.gz