generated from mpskex/chisel-docker-build
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
53 lines (38 loc) · 1.64 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
.PHONY: docs
export ARCH=`uname -m`
# Currently the image does not support arm64,
# We have to hard code the arch into amd64 as a workaround
# export ARCH=amd64
export VER=0.2
image:
make image-${ARCH}
image-arm64:
docker build docker -t fangruil/chisel-dev:arm64 -t fangruil/chisel-dev:arm64-${VER} --platform linux/arm64
image-x86_64:
make image-amd64
image-amd64:
docker build docker -t fangruil/chisel-dev:amd64 -t fangruil/chisel-dev:amd64-${VER} --platform linux/amd64
container:
echo ${ARCH};
if [ ${ARCH} = "arm64" ]; then docker run -u $(id -u):$(id -g) --rm -it -v ${PWD}:/workspace/ fangruil/chisel-dev:arm64 bash; else docker run -u $(id -u):$(id -g) --rm -it -v ${PWD}:/workspace/ fangruil/chisel-dev:amd64 bash; fi
test:
if [ ${ARCH} = "arm64" ]; then docker run -u $(id -u):$(id -g) --rm -it -v ${PWD}:/workspace/ fangruil/chisel-dev:arm64 sbt test; else docker run -u $(id -u):$(id -g) --rm -it -v ${PWD}:/workspace/ fangruil/chisel-dev:amd64 sbt test; fi
build:
if [ ${ARCH} = "arm64" ]; then docker run -u $(id -u):$(id -g) --rm -it -v ${PWD}:/workspace/ fangruil/chisel-dev:arm64 sbt run; else docker run -u $(id -u):$(id -g) --rm -it -v ${PWD}:/workspace/ fangruil/chisel-dev:amd64 sbt run; fi
push:
make push-image-${ARCH}
push-x86_64:
make push-image-amd64
push-image-amd64:
docker push fangruil/chisel-dev:amd64
docker push fangruil/chisel-dev:amd64-${VER}
push-image-arm64:
docker push fangruil/chisel-dev:arm64
docker push fangruil/chisel-dev:arm64-${VER}
docs:
pip3 install -r docs/requirements.txt
mkdocs serve
clean:
rm -rf project/target project/project/target target *.v *.anno.json
clean-cache:
rm -rf .cache