-
Notifications
You must be signed in to change notification settings - Fork 35
/
Makefile
67 lines (61 loc) · 2.37 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
CURRENT_USER=$(shell id -u)
CURRENT_GROUP=$(shell id -g)
.PHONY: test
test:
cd "$(CURDIR)/pISO" && cargo test
.PHONY: test-ci
test-ci:
docker run --rm \
-e CARGO_HOME='$(CARGO_HOME)'\
--user $(CURRENT_USER):$(CURRENT_GROUP) \
-v "$(PWD)":$(PWD) -w $(PWD)/pISO rust:1 cargo test
.PHONY: sdimage
sdimage: update-config
ifeq ("$(shell ./scripts/should-rebuild)","rebuild")
sudo docker run -v $(CURDIR):/pISO -w /pISO/buildroot \
--user $(CURRENT_USER):$(CURRENT_GROUP) \
--rm adamschwalm/piso:latest /bin/bash -c "make clean && make"
else
sudo docker run -v $(CURDIR):/pISO -w /pISO/buildroot \
--user $(CURRENT_USER):$(CURRENT_GROUP) \
--rm adamschwalm/piso:latest /bin/bash -c "make piso-reconfigure && make"
endif
git submodule > buildroot/output/.cache-version
.PHONY: sdimage-ci
sdimage-ci: update-config
chmod +x buildroot/board/piso/post-build.sh
chmod +x buildroot/board/piso/post-image.sh
ifeq ("$(shell ./scripts/should-rebuild)","rebuild")
docker run -v $(CURDIR):/pISO -w /pISO/buildroot \
--user $(CURRENT_USER):$(CURRENT_GROUP) \
--rm adamschwalm/piso:latest /bin/bash -c "make clean && make"
else
docker run -v $(CURDIR):/pISO -w /pISO/buildroot \
--user $(CURRENT_USER):$(CURRENT_GROUP) \
--rm adamschwalm/piso:latest /bin/bash -c "make piso-reconfigure && make"
endif
git submodule > buildroot/output/.cache-version
zip -j sdcard.img.zip buildroot/output/images/sdcard.img
zip -j update.zip buildroot/output/images/zImage \
buildroot/output/images/rootfs.squashfs \
buildroot/output/images/initramfs.cpio.lzo
.PHONY: update-config
update-config:
cd "$(CURDIR)/buildroot" && cp "configs/piso_defconfig" ".config"
BENCHMARK_FLAGS=--direct=1 --ioengine=libaio \
--bs=64k --numjobs=1 --size=1G --runtime=600 --group_reporting
.PHONY: benchmark
.ONESHELL:
benchmark:
ifndef TARGET
$(error benchmark TARGET is undefined)
endif
@cd $(TARGET)
@echo "--------------SEQWRITE------------------------------"
@sudo fio --name=seqwrite --rw=write $(BENCHMARK_FLAGS)
@echo "--------------RANDWRITE------------------------------"
@sudo fio --name=randwrite --rw=randwrite $(BENCHMARK_FLAGS)
@echo "--------------SEQREAD------------------------------"
@sudo fio --name=seqread --rw=read $(BENCHMARK_FLAGS)
@echo "--------------RANDREAD------------------------------"
@sudo fio --name=randread --rw=randread $(BENCHMARK_FLAGS)