std/c/: Delete the old Perl tests in src/t/, 0:84
[sunny256-utils.git] / Makefile
blobef4adf51c4446cbc8668a07dbe254289470c4caa
1 # oyvholm/utils/Makefile
2 # File ID: 455af534-fd45-11dd-a4b7-000475e441b9
3 # Author: Øyvind A. Holm <sunny@sunbase.org>
5 PYFILES =
6 PYFILES += git-expand
7 PYFILES += jsonfmt.py
8 PYFILES += line_exec.py
9 T_GREEN=$$(tput setaf 2)
10 T_RESET=$$(tput sgr0)
12 .PHONY: all
13 all:
14 cd Lib && $(MAKE)
15 cd src && $(MAKE)
16 cd Git && $(MAKE)
18 .PHONY: c-demo
19 c-demo:
20 @cd Lib/std/c/src && $(MAKE) -s -f Makefile.std-test demo
22 .PHONY: clean
23 clean:
24 rm -f synced.sqlite.*.bck *.pyc
25 cd tests && $(MAKE) clean
26 cd Lib && $(MAKE) clean
27 cd src && $(MAKE) clean
28 cd Git && $(MAKE) clean
29 find . -name .testadd.tmp -type d -print0 | xargs -0r rm -rf
31 .PHONY: format
32 format:
33 black -l 79 $(PYFILES)
34 cd Lib && $(MAKE) $@
36 .PHONY: fullclean
37 fullclean:
38 $(MAKE) clean
39 cd src && $(MAKE) fullclean
40 cd Git && $(MAKE) fullclean
42 .PHONY: lgd
43 lgd:
44 git lg --date-order $$(git branch -a | cut -c3- | \
45 grep -Ee 'remotes/(Spread|bitbucket|repoorcz|sunbase)/' | \
46 grep -v 'HEAD -> ') $$(git branch | cut -c3-)
48 .PHONY: obsolete
49 obsolete:
50 git delrembr $$(cat Div/obsolete-refs.txt); true
52 .PHONY: push
53 push:
54 git push-to-gitlab
55 git pa
56 git push bitbucket
58 .PHONY: remotes
59 remotes:
60 git remote add \
61 sunbase sunny@git.sunbase.org:/home/sunny/Git/utils.git; true
62 git remote add bitbucket git@bitbucket.org:sunny256/utils.git; true
63 git remote add gitlab git@gitlab.com:oyvholm/utils.git; true
64 git remote add \
65 repoorcz ssh://sunny256@repo.or.cz/srv/git/sunny256-utils.git; true
67 .PHONY: test
68 test:
69 test ! -e synced.sql.lock
70 # FIXME: synced.sql is modified in Gitlab CI, disable it for now
71 if test "$(GITLAB_CI)" != "true"; then \
72 test -z "$$(filesynced --valid-sha 2>&1)"; \
74 test "$$(git log | grep -- -by: | sort -u | wc -l)" = "2"
75 cd tests && $(MAKE) test
76 cd Lib && $(MAKE) test
77 cd src && $(MAKE) test
78 cd Git && $(MAKE) test
80 .PHONY: test-clean
81 test-clean:
82 $(MAKE) fullclean
83 git status --porcelain --ignored | grep ^ && exit 1 || true
85 .PHONY: testport
86 testport:
87 cd tests && $(MAKE) testport
88 cd Lib && $(MAKE) testport
89 cd src && $(MAKE) testport
90 cd Git && $(MAKE) testport
92 .PHONY: tlok
93 tlok: c-demo
94 @cd Lib/std/c/src/compile.tmp && $(MAKE) -s tlok
96 .PHONY: tlokall
97 tlokall: c-demo
98 @cd Lib/std/c/src/compile.tmp && $(MAKE) -s tlokall
100 .PHONY: unmerged
101 unmerged:
102 git log --graph --date-order --format=fuller -p --decorate=short \
103 $$(git br -a --contains firstrev --no-merged | git nocom) \
104 ^master
106 .PHONY: update-synced
107 update-synced:
108 test ! -e .update-synced_token.tmp
109 test ! -e synced.sql.lock
110 filesynced --lock >.update-synced_token.tmp
111 git ls-files | while read f; do \
112 if test -f "$$f" -a ! -h "$$f" ; then \
113 echo "INSERT INTO synced (file) VALUES ('$$f');"; \
114 fi; \
115 done | sqlite3 synced.sqlite 2>/dev/null || true
116 echo "SELECT file FROM synced ORDER BY file;" | \
117 sqlite3 synced.sqlite | while read f; do \
118 if test ! -f "$$f"; then \
119 echo "DELETE FROM synced WHERE file = '$$f';"; \
120 echo "DELETE FROM todo WHERE file = '$$f';"; \
121 fi; \
122 done | sqlite3 synced.sqlite
123 filesynced --unlock $$(cat .update-synced_token.tmp)
124 rm -f .update-synced_token.tmp
126 .PHONY: valgrind
127 valgrind:
128 cd Git && $(MAKE) valgrind