-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile,v
62 lines (48 loc) · 1.44 KB
/
Makefile,v
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
head 1.1;
access;
symbols;
locks; strict;
comment @# @;
1.1
date 2020.10.19.16.14.18; author williamp; state Exp;
branches;
next ;
desc
@A stub Makefile to bootstrap the project
@
1.1
log
@Initial revision
@
text
@# A stub Makefile used to bootstrap.
srcdir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
BUILDDIR := $(srcdir)build/$(shell uname -s)/$(shell uname -m)
.PHONY: all check clean dist distclean install loc release version
all: $(BUILDDIR) $(BUILDDIR)/Makefile
cd $(BUILDDIR) && make $(MAKEFLAGS) all
release: $(BUILDDIR)
-cd $(BUILDDIR) && make $(MAKEFLAGS) distclean
CFLAGS='-O2 -DNDEBUG' make $(MAKEFLAGS) all
cd $(BUILDDIR) && make $(MAKEFLAGS) version && make $(MAKEFLAGS) dist
configure:
autoreconf -ivf
$(BUILDDIR)/Makefile: configure
cd $(BUILDDIR) && $(srcdir)configure CFLAGS="$${CFLAGS---coverage -g -O0}"
$(BUILDDIR):
mkdir -p $(BUILDDIR)
loc:
@@cd $(BUILDDIR) && \
for file in action handler smtx-main vtparser smtx; do \
printf assert:; grep 'assert(' $(srcdir)$${file}.c | wc -l; \
gcov $${file}.c $$(test -f .libs/$${file}.gcda \
&& printf -- '-o .libs'); \
done | tr "':" ' '| awk ' \
/^assert/ { assert = $$2 } \
/^File/ {file=$$2; gsub(".*/", "", file)} \
/Lines executed/{c = $$5 - assert; \
printf "%32s:\t%s\t(%s)\n", file, c, $$3; t+=c} \
END{printf "%32s:\t%s\n", "Total", t}'
install check clean dist distclean version: $(BUILDDIR) $(BUILDDIR)/Makefile
cd $(BUILDDIR) && make $(MAKEFLAGS) $@@
@