-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
38 lines (29 loc) · 671 Bytes
/
makefile
File metadata and controls
38 lines (29 loc) · 671 Bytes
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
IMAGE ?= akeros.img
SYSTEM = \
bootloader.sys\
kernel.sys
PROGRAMS = \
calc.prg
build: $(IMAGE) $(SYSTEM) $(PRORGAMS)
install: $(IMAGE)
$(eval DIR := $(shell mktemp -d))
mount -o loop $< $(DIR)
sleep 0.5
cp kernel.sys $(DIR)/
cp README.md $(DIR)/
cp $(PROGRAMS) $(DIR)/
umount $(DIR)
rm -r $(DIR)
.PHONY: test
test:
qemu-system-i386 -drive format=raw,file=$(IMAGE),index=0,if=floppy
.PHONY: clean
clean:
rm $(IMAGE) $(SYSTEM) $(PROGRAMS)
$(IMAGE): $(SYSTEM) $(PROGRAMS)
dd if=/dev/zero bs=512 count=2880 > $(IMAGE)
dd if=bootloader.sys of=$(IMAGE) conv=notrunc
%.sys:
nasm -O0 -f bin -o $@ $(@:sys=asm)
%.prg:
nasm -O0 -f bin -o $@ $(@:prg=asm)