forked from toltec-dev/toltec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
92 lines (72 loc) · 2.46 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
# Copyright (c) 2020 The Toltec Contributors
# SPDX-License-Identifier: MIT
HOST?=10.11.99.1
RECIPES=$(shell ls package/)
RECIPES_PUSH=$(foreach app, $(RECIPES), $(app)-push)
RECIPES_CLEAN=$(foreach app, $(RECIPES), $(app)-clean)
define USAGE
Building packages:
repo Build the repository and reuse archives from the remote
repository for existing package versions.
repo-local Build the repository without using existing archives from
the remote repository.
repo-new Build only the new packages in the repository based
on what exists in the remote repository.
RECIPE Build packages from the given recipe.
RECIPE-push Push built packages from the given recipe to the
.cache/opkg directory on the reMarkable.
Checking for errors:
repo-check Compare the local repository to the remote one.
format Check that the source code formatting follows
the style guide.
format-fix Automatically reformat the source code to follow
the style guide.
lint Perform static analysis on the source code to find
erroneous constructs.
Housekeeping:
RECIPE-clean Remove build artifacts from a given recipe.
clean Remove all build artifacts.
endef
export USAGE
help:
@echo "$$USAGE"
repo:
./scripts/repo-build package build/package build/repo "$$remote_repo"
repo-local:
./scripts/repo-build -l package build/package build/repo "$$remote_repo"
repo-new:
./scripts/repo-build -n package build/package build/repo "$$remote_repo"
repo-check:
./scripts/repo-check build/repo
$(RECIPES): %:
./scripts/package-build package/"${@}" build/package/"${@}"
$(RECIPES_PUSH): %:
ssh root@"${HOST}" mkdir -p .cache/opkg
scp build/package/"$(@:%-push=%)"/*/*.ipk root@"${HOST}":.cache/opkg
format:
@echo "==> Checking the formatting of shell scripts"
shfmt -d .
format-fix:
@echo "==> Fixing the formatting of shell scripts"
shfmt -l -w .
lint:
@echo "==> Linting shell scripts"
shellcheck $$(shfmt -f .)
@echo "==> Verifying that the bootstrap checksum is correct"
./scripts/bootstrap/checksum-check
$(RECIPES_CLEAN): %:
rm -rf build/package/"$(@:%-clean=%)"
clean:
rm -rf build
.PHONY: \
help \
repo \
repo-local \
repo-check \
$(RECIPES) \
$(RECIPES_PUSH) \
format \
format-fix \
lint \
$(RECIPES_CLEAN) \
clean