-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathmk2
63 lines (49 loc) · 1.21 KB
/
mk2
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
# MIT License
# Copyright (c) 2020 Jason Hu, Zhu Yu
# support bochs and vbox
FATFS_DIR = tools/fatfs
# System environment variable.
ifeq ($(OS),Windows_NT)
FATFS_BIN := fatfs
else
FATFS_BIN := $(FATFS_DIR)/fatfs
endif
# images and rom
IMAGE_DIR = develop/image
HDA_VHD = $(IMAGE_DIR)/c.vhd
HDB_VHD = $(IMAGE_DIR)/d.vhd
HDA_VMDK = $(IMAGE_DIR)/c-flat.vmdk
HDB_VMDK = $(IMAGE_DIR)/d-flat.vmdk
ROM_DIR = develop/rom
# virtual machine
BOCHS = bochs
BOCHSDBG = bochsdbg
VBOX_MANAGE = VBoxManage
# scripts dir
SCRIPTS_DIR = scripts
# bochs development dir
BOCHS_DIR = $(SCRIPTS_DIR)/bochs/
BXRC_WIN = $(BOCHS_DIR)bochsrc.win # bochsrc for windows
BXRC_LINUX = $(BOCHS_DIR)bochsrc.linux # bochsrc for linux
VBOX_NAME = "xbook2" # virtual box 虚拟机名称
# 参数
.PHONY: all bochs bochsdbg vbox vmware
bochs:
ifeq ($(OS),Windows_NT)
$(BOCHS) -q -f $(BXRC_WIN)
else
$(BOCHS) -q -f $(BXRC_LINUX)
endif
bochsdbg:
ifeq ($(OS),Windows_NT)
$(BOCHSDBG) -q -f $(BXRC_WIN)
else
$(BOCHSDBG) -q -f $(BXRC_LINUX)
endif
# virtual box
vbox: vbox_disk
$(VBOX_MANAGE) startvm $(VBOX_NAME) --type gui
vbox_disk:
$(FATFS_BIN) $(HDB_VHD) $(ROM_DIR) 0
vmware:
$(FATFS_BIN) $(HDB_VMDK) $(ROM_DIR) 0