forked from LearningOS/rust-based-os-comp2023
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
196 lines (167 loc) · 6.11 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
DOCKER_NAME ?= rust-os-camp-2022
DIR := workplace
.PHONY: docker build_docker
test: test3 test4 test5 test6 test7 test8
lab1: test3
lab2: test4
lab3: test5
lab4: test6 test7
lab5: test8
setup:
rm -rf ${DIR}
mkdir ${DIR}
cp -r easy-fs ${DIR}
cp -r easy-fs-fuse ${DIR}
cp -r ci-user ${DIR}
cp -r bootloader ${DIR}
cp -r reports ${DIR}
cp rust-toolchain.toml ${DIR}
# export PATH=${PATH}:${HOME}/qemu-7.0.0:${HOME}/qemu-7.0.0/riscv64-softmmu
test1: setup
cp -r os1 ${DIR}/os
cd ${DIR}/ci-user && make test CHAPTER=1
test2: setup
cp -r os2 ${DIR}/os
cd ${DIR}/ci-user && make test CHAPTER=2
test3: setup
cp -r os3 ${DIR}/os
cd ${DIR}/ci-user && make test CHAPTER=3
test4: setup
cp -r os4 ${DIR}/os
cd ${DIR}/ci-user && make test CHAPTER=4
test5: setup
cp -r os5 ${DIR}/os
cd ${DIR}/ci-user && make test CHAPTER=5
test6: setup
cp -r os6 ${DIR}/os
cd ${DIR}/ci-user && make test CHAPTER=6
test7: setup
cp -r os7 ${DIR}/os
cd ${DIR}/ci-user && make test CHAPTER=7
test8: setup
cp -r os8 ${DIR}/os
cd ${DIR}/ci-user && make test CHAPTER=8
clean:
rm -rf ${DIR}
docker:
docker run --rm -it -v ${PWD}:/mnt -w /mnt ${DOCKER_NAME} bash
build_docker:
docker build -t ${DOCKER_NAME} .
setupclassroom_test1:
mkdir -p .github/classroom/
mkdir -p .github/workflows/
touch .github/.keep
cp scripts/autograding-test1.json .github/classroom/autograding.json
cp scripts/classroom.yml .github/workflows/classroom.yml
git add .github/classroom/autograding.json
git add .github/workflows/classroom.yml
git add .github/.keep
git commit -m"update classroom.yml .keep autograding.json for classroom CI test"
git push
setupclassroom_test2:
mkdir -p .github/classroom/
mkdir -p .github/workflows/
touch .github/.keep
cp scripts/autograding-test2.json .github/classroom/autograding.json
cp scripts/classroom.yml .github/workflows/classroom.yml
git add .github/classroom/autograding.json
git add .github/workflows/classroom.yml
git add .github/.keep
git commit -m"update classroom.yml .keep autograding.json for classroom CI test"
git push
setupclassroom_test3:
mkdir -p .github/classroom/
mkdir -p .github/workflows/
touch .github/.keep
cp scripts/autograding-test3.json .github/classroom/autograding.json
cp scripts/classroom.yml .github/workflows/classroom.yml
git add .github/classroom/autograding.json
git add .github/workflows/classroom.yml
git add .github/.keep
git commit -m"update classroom.yml .keep autograding.json for classroom CI test"
git push
setupclassroom_test4:
mkdir -p .github/classroom/
mkdir -p .github/workflows/
touch .github/.keep
cp scripts/autograding-test4.json .github/classroom/autograding.json
cp scripts/classroom.yml .github/workflows/classroom.yml
git add .github/classroom/autograding.json
git add .github/workflows/classroom.yml
git add .github/.keep
git commit -m"update classroom.yml .keep autograding.json for classroom CI test"
git push
setupclassroom_test5:
mkdir -p .github/classroom/
mkdir -p .github/workflows/
touch .github/.keep
cp scripts/autograding-test5.json .github/classroom/autograding.json
cp scripts/classroom.yml .github/workflows/classroom.yml
git add .github/classroom/autograding.json
git add .github/workflows/classroom.yml
git add .github/.keep
git commit -m"update classroom.yml .keep autograding.json for classroom CI test"
git push
setupclassroom_test6:
mkdir -p .github/classroom/
mkdir -p .github/workflows/
touch .github/.keep
cp scripts/autograding-test6.json .github/classroom/autograding.json
cp scripts/classroom.yml .github/workflows/classroom.yml
git add .github/classroom/autograding.json
git add .github/workflows/classroom.yml
git add .github/.keep
git commit -m"update classroom.yml .keep autograding.json for classroom CI test"
git push
setupclassroom_test7:
mkdir -p .github/classroom/
mkdir -p .github/workflows/
touch .github/.keep
cp scripts/autograding-test7.json .github/classroom/autograding.json
cp scripts/classroom.yml .github/workflows/classroom.yml
git add .github/classroom/autograding.json
git add .github/workflows/classroom.yml
git add .github/.keep
git commit -m"update classroom.yml .keep autograding.json for classroom CI test"
git push
setupclassroom_test8:
mkdir -p .github/classroom/
mkdir -p .github/workflows/
touch .github/.keep
cp scripts/autograding-test8.json .github/classroom/autograding.json
cp scripts/classroom.yml .github/workflows/classroom.yml
git add .github/classroom/autograding.json
git add .github/workflows/classroom.yml
git add .github/.keep
git commit -m"update classroom.yml .keep autograding.json for classroom CI test"
git push
# for local ubuntu with zsh shell SHELL, need root for sudo
ubuntu_local_setenv:
sudo apt install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev \
gawk build-essential bison flex texinfo gperf libtool patchutils bc \
zlib1g-dev libexpat-dev pkg-config libglib2.0-dev libpixman-1-dev git tmux python3 ninja-build zsh -y
cd ${HOME} && wget https://download.qemu.org/qemu-7.0.0.tar.xz
cd ${HOME} && tar xvJf qemu-7.0.0.tar.xz
cd ${HOME}/qemu-7.0.0 && ./configure --target-list=riscv64-softmmu,riscv64-linux-user
cd ${HOME}/qemu-7.0.0 && make -j$(nproc)
cd ${HOME}/qemu-7.0.0 && sudo make install
qemu-system-riscv64 --version
qemu-riscv64 --version
curl https://sh.rustup.rs -sSf | sh -s -- -y
source ${HOME}/.cargo/env
rustc --version
# for github codespaces ubuntu with zsh SHELL, need root for sudo
codespaces_setenv:
sudo apt install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev \
gawk build-essential bison flex texinfo gperf libtool patchutils bc \
zlib1g-dev libexpat-dev pkg-config libglib2.0-dev libpixman-1-dev git tmux python3 ninja-build zsh -y
cd .. && wget https://download.qemu.org/qemu-7.0.0.tar.xz
cd .. && tar xvJf qemu-7.0.0.tar.xz
cd ../qemu-7.0.0 && ./configure --target-list=riscv64-softmmu,riscv64-linux-user
cd ../qemu-7.0.0 && make -j$(nproc)
cd ../qemu-7.0.0 && sudo make install
qemu-system-riscv64 --version
qemu-riscv64 --version
curl https://sh.rustup.rs -sSf | sh -s -- -y
/bin/zsh && source /home/codespace/.cargo/env
rustc --version