-
Notifications
You must be signed in to change notification settings - Fork 78
/
Makefile
53 lines (41 loc) · 1.77 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
#### crowsnest - A webcam Service for multiple Cams and Stream Services.
####
#### Written by Stephan Wendel aka KwadFan <[email protected]>
#### Copyright 2021 - 2023
#### Co-authored by Patrick Gehrsitz aka mryel00 <[email protected]>
#### Copyright 2023 - till today
#### https://github.com/mainsail-crew/crowsnest
####
#### This File is distributed under GPLv3
####
#### Self-Documenting Makefile
#### This is based on https://gellardo.github.io/blog/posts/2021-06-10-self-documenting-makefile/
.DEFAULT_GOAL := help
.PHONY: help
install: ## Install crowsnest (needs leading sudo)
@bash -c 'tools/install.sh'
uninstall: ## Uninstall crowsnest
@bash -c 'tools/uninstall.sh'
build: ## Compile backends / streamer
bash -c 'bin/build.sh --build'
buildclean: ## Clean backends / streamer (for rebuilding)
bash -c 'bin/build.sh --clean'
clean: ## Clean .config
@if [ -f tools/.config ]; then rm -f tools/.config; fi
@printf "Removed installer config file ...\n"
config: ## Configure crowsnest installer
@bash -c 'tools/configure.sh'
help: ## Shows this help
@printf "crowsnest - A webcam Service for multiple Cams and Stream Services.\n"
@printf "Usage:\n\n"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
update: ## Update crowsnest (fetches and pulls repository changes)
@git fetch && git pull
@bash -c 'bin/build.sh --reclone'
${MAKE} build
report: ## Generate report.txt
@if [ -f ~/report.txt ]; then rm -f ~/report.txt; fi
@bash -c 'tools/dev-helper.sh -a >> ~/report.txt'
@sed -ri 's/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g' ~/report.txt
fixworkingdirectory: ## Fix service file WorkingDirectory path
@sudo sed -i "s~\(WorkingDirectory=\).*~\1$$PWD~" /etc/systemd/system/crowsnest.service