-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
68 lines (56 loc) · 2.18 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
export ROOT_DIR := $(shell pwd)
export BLD_DIR := ${ROOT_DIR}/build
export BIN_DIR := ${ROOT_DIR}/bin
export SRC_ROOT := ${ROOT_DIR}/src
export ISO_ROOT_DIR := ${ROOT_DIR}/iso_root
export ISO_NAME := QBeOS.iso
SUBDIRS := src boot
.PHONY: build subdirs $(SUBDIRS)
build: setupEnvironment subdirs
cp $(BLD_DIR)/* $(ISO_ROOT_DIR)/
mkisofs -c bootcat -b bootloader.bin -no-emul-boot -boot-load-size 4 -o $(BIN_DIR)/$(ISO_NAME) $(ISO_ROOT_DIR)
.PHONY: subdirs $(SUBDIRS)
subdirs: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@
.PHONY: setupEnvironment
setupEnvironment:
if [ ! -d $(BLD_DIR) ]; then mkdir $(BLD_DIR); fi
if [ ! -d $(BIN_DIR) ]; then mkdir $(BIN_DIR); fi
if [ ! -d $(ISO_ROOT_DIR) ]; then mkdir $(ISO_ROOT_DIR); fi
run-qemu: $(BIN_DIR)/$(ISO_NAME)
qemu-system-i386 \
-enable-kvm \
-m 4096 \
-drive format=raw,media=cdrom,file=./bin/QBeOS.iso \
-smp 4 \
-device i8042 \
-vga std \
-no-shutdown -no-reboot \
-monitor stdio \
-L /usr/share/qemu/sgabios.bin
run: $(BIN_DIR)/$(ISO_NAME)
virtualboxvm --startvm QBeOS
run-bochs: $(BIN_DIR)/$(ISO_NAME)
bochs -f bochsrc.txt
debug: $(BIN_DIR)/$(ISO_NAME)
qemu-system-i386 \
-cpu host \
-enable-kvm \
-m 4096 \
-no-reboot \
-drive format=raw,media=cdrom,file=./bin/QBeOS.iso \
-serial stdio \
-smp 1 \
-vga std \
-d int -no-shutdown -no-reboot -S -s
.PHONY: clean
clean:
if [ -d $(BLD_DIR) ]; then rm -r $(BLD_DIR); fi
if [ -d $(BIN_DIR) ]; then rm -r $(BIN_DIR); fi
if [ -d $(ISO_ROOT_DIR) ]; then rm -r $(ISO_ROOT_DIR); fi
-$(MAKE) -C src clean
.PHONY: rebuild
rebuild:
$(MAKE) clean
$(MAKE) build