-
Notifications
You must be signed in to change notification settings - Fork 60
/
Makefile
71 lines (55 loc) · 1.51 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
NASM = nasm
QEMU = qemu-system-i386
QEMU_DRIVE = a
# QEMU_SPEAKER = -soundhw pcspk
NAME = floppybird
FILENAME = $(NAME).img
COM_FILENAME = flpybird.com
IMAGE = build/$(FILENAME)
ISO_IMAGE = build/iso/$(FILENAME)
ISO = build/$(NAME).iso
ISO_DIR = build/iso
COM_TARGET = build/$(COM_FILENAME)
BOOT = src/boot.asm
COM = src/com.asm
KERNEL = src/sys/rnd.asm \
src/sys/snd.asm \
src/sys/tmr.asm \
src/sys/txt.asm \
src/sys/vga.asm
GAME = src/main.asm \
src/game/background.asm \
src/game/bird.asm \
src/game/bushes.asm \
src/game/clouds.asm \
src/game/data.asm \
src/game/flats.asm \
src/game/ground.asm \
src/game/pipes.asm \
src/game/score.asm
all: $(IMAGE)
$(IMAGE): $(BOOT) $(KERNEL) $(GAME)
$(NASM) -isrc/ -f bin -o $(IMAGE) $(BOOT)
$(COM_TARGET): $(COM) $(KERNEL) $(GAME)
$(NASM) -isrc/ -DCOM -f bin -o $(COM_TARGET) $(COM)
com: $(COM_TARGET)
usb:
sudo dd if=$(IMAGE) of=/dev/sdb
floppy:
dd bs=512 count=2880 if=/dev/zero of=$(ISO_IMAGE)
dd status=noxfer conv=notrunc if=$(IMAGE) of=$(ISO_IMAGE)
iso:
$(MAKE) floppy
mkisofs -quiet -V 'FLOPPYBIRD' -input-charset iso8859-1 -o $(ISO) -b $(FILENAME) $(ISO_DIR)
qemu:
$(QEMU) $(QEMU_SPEAKER) -boot $(QEMU_DRIVE) -fd$(QEMU_DRIVE) $(IMAGE)
bochs:
bochs -q -n 'boot:floppy' 'floppy$(QEMU_DRIVE): 1_44=$(IMAGE), status=inserted'
dosbox:
dosbox -conf dosbox.conf $(COM_TARGET)
clean:
rm $(IMAGE)
rm $(ISO_IMAGE)
rm $(ISO)
rm $(COM_TARGET)
.PHONY: usb floppy iso qemu bochs dosbox clean