forked from ALSchwalm/transient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
81 lines (64 loc) · 2.02 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
TRANSIENT_KERNEL=transient/static/transient-kernel
TRANSIENT_INITRAMFS=transient/static/transient-initramfs
TRANSIENT_BUILDROOT_CONFIG=kernel/buildroot-config
TRANSIENT_KCONFIG=kernel/kernel-config
COMPREHENSIVE_EXAMPLE=docs/configuration-file/comprehensive-example.md
MAX_LINE_LENGTH?=100
.PHONY: check
check: check-format check-types
.PHONY: check-format
check-format:
black -l 90 --check transient test scripts
.PHONY: check-types
check-types:
mypy --strict transient scripts
.PHONY: format
format:
black -l 90 transient test scripts
.PHONY: dev
dev: venv/.dev-finished
venv/.dev-finished:
python3 -m venv venv
. venv/bin/activate; \
python3 -m pip install -e '.[dev]'
touch venv/.dev-finished
@echo "Finished building dev environment. Run '. venv/bin/activate'"
.PHONY: prep-release
prep-release: | clean dev $(COMPREHENSIVE_EXAMPLE)
. venv/bin/activate; \
python setup.py sdist bdist_wheel; \
twine check dist/*
.PHONY: upload-test-release
upload-test-release: prep-release
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
.PHONY: upload-release
upload-release: prep-release
twine upload dist/*
.PHONY: test
test:
make -C test all
test-%:
make -C test $*
$(TRANSIENT_INITRAMFS) $(TRANSIENT_KERNEL): $(TRANSIENT_KCONFIG) $(TRANSIENT_BUILDROOT_CONFIG)
cp $(TRANSIENT_BUILDROOT_CONFIG) kernel/buildroot/.config
make -C kernel/buildroot
cp kernel/buildroot/output/images/bzImage $(TRANSIENT_KERNEL)
cp kernel/buildroot/output/images/rootfs.cpio.gz $(TRANSIENT_INITRAMFS)
.PHONY: kernel
kernel: $(TRANSIENT_KERNEL)
.PHONY: initramfs
initramfs: $(TRANSIENT_INITRAMFS)
.PHONY: $(COMPREHENSIVE_EXAMPLE)
$(COMPREHENSIVE_EXAMPLE):
scripts/embed_file_into_markdown_template.py \
--file-to-embed test/config-files/comprehensive-config \
--markdown-template docs/templates/comprehensive-example-template.md \
--output-file $@
.PHONY: docs
docs: $(COMPREHENSIVE_EXAMPLE)
mkdocs serve
.PHONY: clean
clean:
rm -rf sdist dist $(COMPREHENSIVE_EXAMPLE)
make -C test clean
make -C kernel/buildroot clean