-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (55 loc) · 1.72 KB
/
Copy pathMakefile
File metadata and controls
61 lines (55 loc) · 1.72 KB
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
# Ancient Makefile implicit rule disabler
(%): %
%:: %,v
%:: RCS/%,v
%:: s.%
%:: SCCS/s.%
%.out: %
%.c: %.w %.ch
%.tex: %.w %.ch
%.mk:
# Variables
BRANCH := main
INTERACTIVE := $(shell test -t 0 && echo 1)
ifdef INTERACTIVE
RED := \033[0;31m
YELLOW := \033[0;33;1m
END := \033[0m
else
RED :=
END :=
endif
# Let there be no default target
.PHONY: help
help:
@echo "${RED}Help info: the following commands are supported:${END}"
@echo "init - will git checkout each submodule to the tracked"
@echo " commit (resulting in a git detached HEAD)"
@echo "checkout - will checkout the suppllied branch (via the"
@echo " syntax BRANCH=main) ignoring submodule errors"
@echo " if the branch does not exist"
@echo "status - will print the git status for all the repos"
@echo "4e - will exec 'git submodule foreach git \$$CMD'"
@echo "etags - constructs an emacs tags table"
@echo ""
@echo "To switch ElectionData repos, 'git rm the-old-ElectionData'"
@echo "and 'git add the-new-ElectionData'"
@echo ""
# checkout the latest on main on all the submodules
.PHONY: init
init:
git submodule update --init --merge --remote --recursive
.PHONY: checkout 4e
checkout:
git submodule foreach "git checkout ${BRANCH} || :"
4e:
git submodule foreach "git ${CMD} || :"
.PHONY: status
status:
@echo "${RED}VTP-dev-env${END}\n`git remote get-url origin`\n`git branch --show-current`\n`git status -s`"
@git submodule --quiet foreach 'echo "${RED}$${name}${END}" && git remote get-url origin && git branch --show-current && git status -s'
# emacs tags
ETAG_SRCS := $(shell find * -type f -name '*.py' -o -name '*.md' | grep -v defunct)
.PHONY: etags
etags: ${ETAG_SRCS}
etags ${ETAG_SRCS}