-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
75 lines (57 loc) · 1.89 KB
/
Makefile.am
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Makefile.am - part of smallcxx
# Copyright (c) 2021 Christopher White <cxwembedded@gmail.com>
# SPDX-License-Identifier: BSD-3-Clause
include $(top_srcdir)/rules.mk
# === Basics ==============================================================
SUBDIRS = include src bin t doc
dist_noinst_SCRIPTS = \
asan.sh \
autogen.sh \
coverage.sh \
$(EOL)
EXTRA_DIST = README.md .astylerc
# === Docs ================================================================
# Docs. `doc` generates them; `doccheck` does so, suppressing all output
# except for error and warning messages.
phony += doc doccheck
doc doccheck:
+$(MAKE) -C doc $@
# === Tests ===============================================================
phony += test
test: check
# Build the tests but don't run them
phony += build-tests
build-tests: all
+$(MAKE) -C t build-tests
@echo "Config: CC=$(CC), CXX=$(CXX), coverage=$(CODE_COVERAGE_ENABLED), asan=$(ASAN_ENABLED)"
# === Working with the code ===============================================
phony += tags
tags:
-ctags -R
phony += prettyprint
prettyprint:
-astyle --project=".astylerc" `git ls-files '*.c*' '*.h*'`
phony += p
p:
+$(MAKE) prettyprint
+$(MAKE) tags
phony += shellcheck
shellcheck:
if which shellcheck ; then echo "Shellcheck" ; shellcheck *.sh && cd t && shellcheck -x *.sh ; fi
# Run all the checks
phony += prep
prep: prettyprint shellcheck
@: # Run `make all` a first time to try to regenerate the .deps files
+-$(MAKE) all
+$(MAKE) doccheck
+$(MAKE) html
+$(MAKE) all build-tests
+$(MAKE) check
+$(MAKE) distcheck
+$(MAKE) tags
# === Misc. ===============================================================
# Used by coverage.sh --- remove the existing code-coverage data.
phony += remove-code-coverage-data
remove-code-coverage-data:
-rm -rf "$(CODE_COVERAGE_OUTPUT_FILE)" "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "$(CODE_COVERAGE_OUTPUT_DIRECTORY)"
-find . -name "*.gcda" -delete