-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
115 lines (86 loc) · 2.95 KB
/
Makefile
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
PREFIX=/usr/local
LIBDIR=$(PREFIX)/lib
BINDIR=$(PREFIX)/bin
INCDIR=$(PREFIX)/include/tascar
DESTDIR=
MODULES = libtascar apps plugins gui
DOCMODULES = doc manual
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
CMD_INSTALL=install
LIB_EXT=so
CMD_LD=ldconfig -n $(DESTDIR)$(LIBDIR)
endif
ifeq ($(UNAME_S),Darwin)
CMD_INSTALL=ginstall
LIB_EXT=dylib
CMD_LD=
endif
all: $(MODULES)
apps plugins gui: libtascar
alldoc: all $(DOCMODULES)
.PHONY : $(MODULES) $(DOCMODULES) coverage
$(MODULES:external_libs=) $(DOCMODULES):
$(MAKE) -C $@
clean:
for m in $(MODULES) $(DOCMODULES); do $(MAKE) -C $$m clean; done
$(MAKE) -C test clean
$(MAKE) -C manual clean
$(MAKE) -C examples clean
$(MAKE) -C external_libs clean
$(MAKE) -C packaging/deb clean
rm -Rf build devkit/Makefile.local devkit/build
# test can not run in multi-threaded mode!
test: apps plugins
$(MAKE) -j 1 -C test
$(MAKE) -C examples
$(MAKE) -C devkit -f Makefile.fromrepo
testjack: apps plugins
$(MAKE) -j 1 -C test jack
libmysofa:
$(MAKE) -C external_libs libmysofa
libtascar: libmysofa
googletest:
$(MAKE) -C external_libs googlemock
unit-tests: $(patsubst %,%-subdir-unit-tests,$(MODULES))
$(patsubst %,%-subdir-unit-tests,$(MODULES)): libtascar googletest
$(MAKE) -C $(@:-subdir-unit-tests=) unit-tests
coverage: googletest unit-tests test testjack
lcov --capture --directory ./ --output-file coverage.info
genhtml coverage.info --prefix $$PWD --show-details --demangle-cpp --output-directory $@
x-www-browser ./coverage/index.html
install: all
$(CMD_INSTALL) -D libtascar/build/libtascar*.$(LIB_EXT) -t $(DESTDIR)$(LIBDIR)
$(CMD_INSTALL) -D libtascar/include/*.h -t $(DESTDIR)$(INCDIR)/tascar
$(CMD_INSTALL) -D libtascar/build/*.h -t $(DESTDIR)$(INCDIR)/tascar
$(CMD_INSTALL) -D plugins/build/*.$(LIB_EXT) -t $(DESTDIR)$(LIBDIR)
$(CMD_INSTALL) -D apps/build/tascar_* -t $(DESTDIR)$(BINDIR)
$(CMD_INSTALL) -D gui/build/tascar -t $(DESTDIR)$(BINDIR)
$(CMD_INSTALL) -D gui/build/tascar_spkcalib -t $(DESTDIR)$(BINDIR)
$(CMD_LD)
.PHONY : all clean test docexamples releasetag checkmodified checkversiontagged
docexamples:
$(MAKE) -C manual/examples
pack: $(MODULES) $(DOCMODULES) docexamples unit-tests test
$(MAKE) -C packaging/deb
packwin:
$(MAKE) -C packaging/win
releasepack: checkversiontagged checkmodified $(MODULES) $(DOCMODULES) docexamples unit-tests test
$(MAKE) -C packaging/deb
fastpack: $(MODULES) $(DOCMODULES)
$(MAKE) -C packaging/deb
include config.mk
checkmodified:
test -z "`git status --porcelain -uno`"
checkversiontagged:
test "`git log -1 --abbrev=7 --pretty='format:%h'`" = "`git log -1 --abbrev=7 --pretty='format:%h' release_$(VERSION)`"
releasetag: checkmodified
git tag -a release_$(VERSION)
allwithcov: googletest
$(MAKE) LDCOVFLAGS="-fprofile-arcs" GCCCOVFLAGS="-fprofile-arcs -ftest-coverage" COVLIBS="-lgcov" $(MODULES)
cleancov:
find . -name "*.gcda" -exec rm -f \{\} \;
rm -Rf coverage
rm -f coverage.info
homebrew:
$(MAKE) -C packaging/homebrew install