forked from AlexanderWillner/runMacOSinVirtualBox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
95 lines (73 loc) · 2.42 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
SCRIPT=./runMacOSVirtualbox.sh
SHELL=bash
help:
@echo "Some available commands:"
@echo " * all : run everything needed (check, installer, vm, patch, run, stop, eject)"
@echo " * download : download a macOS installer"
@echo " * check : check environment"
@echo " * installer: create macOS installer image"
@echo " * patch : add APFS drivers to VM EFI to boot"
@echo " * vm : create VM and disk"
@echo " * run : run VM"
@echo " * stop : stop VM"
@echo " * wait : wait for VM to stop"
@echo " * eject : eject installer medium"
@echo " * add : add installer medium"
@echo " * clean : delete generated images and downloaded files"
@echo " * stash : delete generated VM and disk"
@echo " * stashvm : delete generated VM and NOT the disk"
@echo " * test : test shell scripts"
@echo " * style : style shell scripts"
@echo " * harden : harden shell scripts"
@echo " * release : make new release"
@echo " * feedback : create a GitHub issue"
all:
@bash $(SCRIPT) all
download:
@bash $(SCRIPT) download
check:
@bash $(SCRIPT) check
installer:
@bash $(SCRIPT) installer
patch:
@bash $(SCRIPT) patch
vm:
@bash $(SCRIPT) vm
run:
@bash $(SCRIPT) run
stop:
@bash $(SCRIPT) stop
wait:
@bash $(SCRIPT) wait
eject:
@bash $(SCRIPT) eject
add:
@bash $(SCRIPT) add
clean:
@bash $(SCRIPT) clean
stash:
@bash $(SCRIPT) stash
stashvm:
@bash $(SCRIPT) stashvm
feedback:
@open https://github.com/alexanderwillner/runMacOSinVirtualBox/issues
test: dependencies
@echo "Running first round of shell checks..."
@shellcheck -x *.sh
@echo "Running second round of shell checks..."
@shellharden --check runMacOSVirtualbox.sh
harden: dependencies
@shellharden --replace runMacOSVirtualbox.sh
style: dependencies
@shfmt -i 2 -w -s *.sh
dependencies:
@type shellcheck >/dev/null 2>&1 || (echo "Run 'brew install shellcheck' first." >&2 ; exit 1)
@type shellharden >/dev/null 2>&1 || (echo "Run 'brew install shellharden' first." >&2 ; exit 1)
@type shfmt >/dev/null 2>&1 || (echo "Run 'brew install shfmt' first." >&2 ; exit 1)
release:
@cp runMacOSVirtualbox.sh app/runMacOSVirtualbox.app/Contents/Resources/
@cd app; rm -f runMacOSVirtualbox.app.zip || true
@cd app; zip -r runMacOSVirtualbox.app.zip runMacOSVirtualbox.app/
@open app
@open https://github.com/AlexanderWillner/runMacOSinVirtualBox/releases
.PHONY: all clean feedback test harden style check release