File: Makefile

package info (click to toggle)
mbr 1.0.0-6
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 64 kB
  • ctags: 49
  • sloc: asm: 150; makefile: 55; sh: 10
file content (49 lines) | stat: -rw-r--r-- 1,047 bytes parent folder | download
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
CC=gcc
CFLAGS=-g
AS=as
AS86=as86
DD=dd
RM=rm
# HD=/dev/hda
# FD=/dev/fd0

# Rule for preprocessing asm files
%.s: %.S
	$(CC) $(INCLUDE) -E $< -o $@ || \
		( rm -f $@ ; exit 1 )

#%.o: %.s
#	$(AS86) -0 -a -o $@ $< || ( rm -f $@ ; exit 1 )

#%: %.o
#	$(LD86) -0 -s -o $@ $< || ( rm -f $@ ; exit 1 )

# To get from preprocessed asm files to .b files
%.b: %.s
	$(AS86) -0 -a -b $@ -l $*.out $< || ( rm -f $@ ; exit 1 )

# To extract the image
mbr: mbr.b
	sh debian/test-as86 > /dev/null
	$(DD) if=mbr.b of=mbr bs=1 skip=`sh debian/test-as86` count=444

# The dependancies for this rule must be as written. It creates a hex
# assembler file containing the mbr.
mbrobj.s: bin2asm mbr
	$^ $@

# ptable:
# 	$(DD) if=$(HD) bs=512 count=1
# 
# floppy: mbr ptable
# 	$(DD) if=mbr of=$(FD) bs=512 count=1
# 	$(DD) if=ptable of=$(FD) bs=2 skip=223 seek=223 count=32
# 
# install: mbr
# 	$(DD) if=mbr of=$(HD) bs=446 count=1
# 	$(DD) if=mbr of=$(HD) bs=1 count=2 skip=510 seek=510

clean:
	$(RM) -rf *.{o,b,s,out} mbr core mbrobj* bin2asm

.PHONY: clean floppy