-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (38 loc) · 1.36 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
LINUX_SHELLS=dash bash zsh
STRICT_SHELLS=yash ksh
MACOS_SHELLS=bash zsh
SHELLSCRIPTS=makeanywhere
TEST_SHELLSCRIPTS=tests/bash-3.1 $(shell ls tests/*.sh)
ALL_SHELLSCRIPTS=$(TEST_SHELLSCRIPTS) $(SHELLSCRIPTS)
GITHUB_ACTIONS_FILES=.github/workflows/on-pr-to-main.yml
all: install
setup-cicd-integration-tests:
apt-get update -y
apt-get install -y $(LINUX_SHELLS) $(STRICT_SHELLS)
build-readme:
./utils/generate_readme.py ./README.template.md > ./README.md
release:
# Check version is valid
[ "$(TITLE)" != "" ] || (echo Please set the title with \`make TITLE=...\`; false)
echo "$(VERSION)" | grep '^[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?$$' || (echo Must pass version string as \`make VERSION=XX.YY[.ZZ]\`; false)
sed -i 's/^Version .*$$/Version $(VERSION)/' README.md
git commit -am "Bump version to $(VERSION)" -m "$(TITLE)"
gh release create --target main "v$(VERSION)" --title "$(VERSION) $(TITLE)" $(SHELLSCRIPTS)
install-symlink-to-user:
ln -s "$PWD/makeanywhere" "$HOME/bin/"
./tests/test-install.sh ~/bin
install-to-user:
cp ${SHELLSCRIPTS} ~/bin/
./tests/test-install.sh ~/bin
install:
cp ${SHELLSCRIPTS} /usr/bin/
./tests/test-install.sh /usr/bin
uninstall:
echo Remove the files: ${SHELLSCRIPTS} from your PATH
check:
shellcheck ${ALL_SHELLSCRIPTS}
check-github-actions:
yamllint $(GITHUB_ACTIONS_FILES)
line-count:
cloc ${SHELLSCRIPTS}
cloc ${TEST_SHELLSCRIPTS}