forked from croemheld/bootloader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (37 loc) · 1.31 KB
/
Makefile
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
AS := as
CC := gcc
LD := ld
ISODIR := iso
BOOTDIR := boot
BOOTPATH := $(ISODIR)/$(BOOTDIR)
BOOT := boot
BOOTBIN := $(BOOT).bin
SETUP := setup
SETUPBIN := $(SETUP).bin
LOADERISO := $(BOOT).iso
BOOTIMG := $(BOOTDIR)/$(BOOTBIN)
BOCHSRC := bochsrc
.PHONY: all
all: $(LOADERISO)
.PHONY: clean
clean:
rm -f *.o
rm -f *.bin
rm -f *.ini
rm -f *.iso
rm -rf iso/
.PHONY: isotree
isotree:
isoinfo -f -i os.iso
$(LOADERISO): $(BOOTBIN) $(SETUPBIN)
mkdir -p $(BOOTPATH)
cp $(BOOTBIN) $(BOOTPATH)
cp $(SETUPBIN) $(BOOTPATH)
cp test.txt $(BOOTPATH)
genisoimage -R -b $(BOOTIMG) -no-emul-boot -V CR0S -v -o $(LOADERISO) $(ISODIR)
$(BOOTBIN): $(BOOT).o
$(LD) -T boot.ld $(BOOT).o -o $@
$(SETUPBIN): $(SETUP).o
$(LD) -T setup.ld $(SETUP).o -o $@
%.o: %.asm
$(AS) $< -o $@