-
Notifications
You must be signed in to change notification settings - Fork 148
/
Makefile
106 lines (84 loc) · 3.29 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
96
97
98
99
100
101
102
103
104
105
106
# Makefile
# Build rootfs
.PHONY: rootfs
rootfs:
@./make_rootfs.sh
.PHONY: rootfs_auto
rootfs_auto: start_file_server
@./make_rootfs_auto.sh
.PHONY: clean_rootfs
clean_rootfs:
@rm -rf out/mynode_rootfs_*
@rm -rf out/rootfs_*
# Start file server to allow downloads to devices
.PHONY: start_file_server
start_file_server:
@/bin/bash scripts/start_http_server.sh
.PHONY: stop_file_server
stop_file_server:
@/bin/bash scripts/stop_http_server.sh
# Download base MyNode images
out/base_images/raspi3_base.img.gz:
@mkdir -p out/base_images/
@wget https://mynodebtc.com/device/mynode_images/raspi3_base.img.gz -O out/base_images/raspi3_base.img.gz
out/base_images/raspi4_base.img.gz:
@mkdir -p out/base_images/
@wget https://mynodebtc.com/device/mynode_images/raspi4_base.img.gz -O out/base_images/raspi4_base.img.gz
out/base_images/rock64_base.img.gz:
@mkdir -p out/base_images/
@wget https://mynodebtc.com/device/mynode_images/rock64_base.img.gz -O out/base_images/rock64_base.img.gz
out/base_images/rockpro64_base.img.gz:
@mkdir -p out/base_images/
@wget https://mynodebtc.com/device/mynode_images/rockpro64_base.img.gz -O out/base_images/rockpro64_base.img.gz
out/base_images/rockpi4_base.img.gz:
@mkdir -p out/base_images/
@wget https://mynodebtc.com/device/mynode_images/rockpi4_base.img.gz -O out/base_images/rockpi4_base.img.gz
out/base_images/debian_base.ova:
@mkdir -p out/base_images/
@wget https://mynodebtc.com/device/mynode_images/vm_base.ova -O out/base_images/debian_base.ova
# Setup of New Device
.PHONY: setup_new_rock64
setup_new_rock64: start_file_server out/base_images/rock64_base.img.gz rootfs
@cp -f setup/setup_device.sh out/setup_device.sh
@/bin/bash scripts/setup_new_rock64.sh
.PHONY: setup_new_rockpro64
setup_new_rockpro64: start_file_server out/base_images/rockpro64_base.img.gz rootfs
@cp -f setup/setup_device.sh out/setup_device.sh
@/bin/bash scripts/setup_new_rockpro64.sh
.PHONY: setup_new_rockpi4
setup_new_rockpi4: start_file_server out/base_images/rockpi4_base.img.gz rootfs
@cp -f setup/setup_device.sh out/setup_device.sh
@/bin/bash scripts/setup_new_rockpi4.sh
.PHONY: setup_new_raspi3
setup_new_raspi3: start_file_server out/base_images/raspi3_base.img.gz rootfs
@cp -f setup/setup_device.sh out/setup_device.sh
@/bin/bash scripts/setup_new_raspi3.sh
.PHONY: setup_new_raspi4
setup_new_raspi4: start_file_server out/base_images/raspi4_base.img.gz rootfs
@cp -f setup/setup_device.sh out/setup_device.sh
@/bin/bash scripts/setup_new_raspi4.sh
.PHONY: setup_new_raspi5
setup_new_raspi5: start_file_server rootfs
@cp -f setup/setup_device.sh out/setup_device.sh
@/bin/bash scripts/setup_new_raspi5.sh
.PHONY: setup_new_debian
setup_new_debian: start_file_server out/base_images/debian_base.ova rootfs
@cp -f setup/setup_device.sh out/setup_device.sh
@/bin/bash scripts/setup_new_debian.sh
# Clone repo to get release tools
release.sh:
@rm -rf out/mynode_release_tool
@git clone git@github.com:mynodebtc/mynode_release_tool.git out/mynode_release_tool
@cp out/mynode_release_tool/release.sh ./release.sh
# Release package to server
.PHONY: release
release: clean_rootfs rootfs release.sh
@sh release.sh
.PHONY: beta
beta: clean_rootfs rootfs release.sh
@sh release.sh beta
# Clean build files
.PHONY: clean
clean: stop_file_server
@rm -rf out/
@rm -rf release.sh