dbk: Delete the `.check` file after the write test
[sunny256-utils.git] / Makefile
blobf32acd8777404617c94350b653f550ee40e89aa1
1 # sunny256/utils.git/Makefile
2 # File ID: 455af534-fd45-11dd-a4b7-000475e441b9
3 # Author: Øyvind A. Holm <sunny@sunbase.org>
5 .PHONY: default
6 default:
7 cd Lib && $(MAKE)
8 cd src && $(MAKE)
9 cd Git && $(MAKE)
11 .PHONY: clean
12 clean:
13 rm -f synced.sqlite.*.bck *.pyc
14 cd tests && $(MAKE) clean
15 cd Lib && $(MAKE) clean
16 cd src && $(MAKE) clean
17 cd Git && $(MAKE) clean
18 find . -name .testadd.tmp -type d -print0 | xargs -0r rm -rf
20 .PHONY: fullclean
21 fullclean:
22 $(MAKE) clean
23 cd src && $(MAKE) fullclean
24 cd Git && $(MAKE) fullclean
26 .PHONY: lgd
27 lgd:
28 git lg --date-order $$(git branch -a | cut -c3- | \
29 grep -Ee 'remotes/(Spread|bitbucket|repoorcz|sunbase)/' | \
30 grep -v 'HEAD -> ') $$(git branch | cut -c3-)
32 .PHONY: obsolete
33 obsolete:
34 git delrembr $$(cat Div/obsolete-refs.txt); true
36 .PHONY: remotes
37 remotes:
38 git remote add \
39 sunbase sunny@git.sunbase.org:/home/sunny/Git/utils.git; true
40 git remote add \
41 bellmann sunny@bellmann:/home/sunny/repos/Git/utils.git; true
42 git remote add bitbucket git@bitbucket.org:sunny256/utils.git; true
43 git remote add gitlab git@gitlab.com:sunny256/utils.git; true
44 git remote add \
45 repoorcz ssh://sunny256@repo.or.cz/srv/git/sunny256-utils.git; true
47 .PHONY: test
48 test:
49 test ! -e synced.sql.lock
50 # FIXME: synced.sql is modified in Gitlab CI, disable it for now
51 if test "$(GITLAB_CI)" != "true"; then \
52 test -z "$$(filesynced --valid-sha 2>&1)"; \
54 test "$$(git log | grep -- -by: | sort -u | wc -l)" = "2"
55 cd tests && $(MAKE) test
56 cd Lib && $(MAKE) test
57 cd src && $(MAKE) test
58 cd Git && $(MAKE) test
60 .PHONY: test-clean
61 test-clean:
62 $(MAKE) fullclean
63 git status --porcelain --ignored | grep ^ && exit 1 || true
65 .PHONY: testport
66 testport:
67 cd tests && $(MAKE) testport
68 cd Lib && $(MAKE) testport
69 cd src && $(MAKE) testport
70 cd Git && $(MAKE) testport
72 .PHONY: unmerged
73 unmerged:
74 git log --graph --date-order --format=fuller -p --decorate=short \
75 $$(git br -a --contains firstrev --no-merged | git nocom) \
76 ^master
78 .PHONY: update-synced
79 update-synced:
80 test ! -e .update-synced_token.tmp
81 test ! -e synced.sql.lock
82 filesynced --lock >.update-synced_token.tmp
83 git ls-files | while read f; do \
84 if test -f "$$f" -a ! -h "$$f" ; then \
85 echo "INSERT INTO synced (file) VALUES ('$$f');"; \
86 fi; \
87 done | sqlite3 synced.sqlite 2>/dev/null || true
88 echo "SELECT file FROM synced ORDER BY file;" | \
89 sqlite3 synced.sqlite | while read f; do \
90 if test ! -f "$$f"; then \
91 echo "DELETE FROM synced WHERE file = '$$f';"; \
92 echo "DELETE FROM todo WHERE file = '$$f';"; \
93 fi; \
94 done | sqlite3 synced.sqlite
95 filesynced --unlock $$(cat .update-synced_token.tmp)
96 rm -f .update-synced_token.tmp
98 .PHONY: valgrind
99 valgrind:
100 cd Git && $(MAKE) valgrind