7019 FIX NagVis: Updated to 1.9.11
[check_mk.git] / Makefile
blob6af407b4bf9861307405eb505340498e39b24eab
1 # +------------------------------------------------------------------+
2 # | ____ _ _ __ __ _ __ |
3 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
4 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
5 # | | |___| | | | __/ (__| < | | | | . \ |
6 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
7 # | |
8 # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de |
9 # +------------------------------------------------------------------+
11 # This file is part of Check_MK.
12 # The official homepage is at http://mathias-kettner.de/check_mk.
14 # check_mk is free software; you can redistribute it and/or modify it
15 # under the terms of the GNU General Public License as published by
16 # the Free Software Foundation in version 2. check_mk is distributed
17 # in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
18 # out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
19 # PARTICULAR PURPOSE. See the GNU General Public License for more de-
20 # tails. You should have received a copy of the GNU General Public
21 # License along with GNU Make; see the file COPYING. If not, write
22 # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
23 # Boston, MA 02110-1301 USA.
26 include defines.make
28 NAME := check_mk
29 PREFIX := /usr
30 BINDIR := $(PREFIX)/bin
31 CONFDIR := /etc/$(NAME)
32 LIBDIR := $(PREFIX)/lib/$(NAME)
33 DISTNAME := $(NAME)-$(VERSION)
34 DIST_ARCHIVE := check-mk-$(EDITION)-$(OMD_VERSION).tar.gz
35 TAROPTS := --owner=root --group=root --exclude=.svn --exclude=*~ \
36 --exclude=.gitignore --exclude=*.swp --exclude=.f12
37 # We could add clang's -Wshorten-64-to-32 and g++'c/clang's -Wsign-conversion here.
38 CXX_FLAGS := -g -O3 -Wall -Wextra
39 CLANG_VERSION := 6.0
40 CLANG_FORMAT := clang-format-$(CLANG_VERSION)
41 CLANG_TIDY := clang-tidy-$(CLANG_VERSION)
42 export RUN_CLANG_TIDY := run-clang-tidy-$(CLANG_VERSION).py
43 SCAN_BUILD := scan-build-$(CLANG_VERSION)
44 export CPPCHECK := cppcheck
45 export DOXYGEN := doxygen
46 export IWYU_TOOL := iwyu_tool
47 PIPENV := PIPENV_NO_INHERIT=true PIPENV_VENV_IN_PROJECT=true pipenv
49 # The Bear versions have a slightly tragic history: Due to the clang bug
50 # https://llvm.org/bugs/show_bug.cgi?id=24710 we need absolute paths in our
51 # compilation database. Furthermore, gcc and clang have slightly different
52 # behavior regarding include paths when the -I flag contains a relative path and
53 # symlinks are involved, so this is yet another reason to use absolute paths.
55 # Consequently, we upstreamed a fix for this to the Bear project, see
56 # https://github.com/rizsotto/Bear/commit/fb1645de9. This fix lived happily in
57 # the Bear releases 2.1.4, 2.1.5, and 2.2.0, but after that, some "improvements"
58 # broke the fix again. :-/ Until a new fix has been upstreamed, make sure that
59 # that you use the right Bear.
61 # To install a working version locally, just do:
62 # git clone https://github.com/rizsotto/Bear.git && cd Bear && git checkout 2.2.0 && cmake -DCMAKE_INSTALL_PREFIX=$HOME/local/Bear-2.2.0 && make install
63 # and put $HOME/local/Bear-2.2.0/bin into your PATH or set the make variable
64 # below accordingly.
65 export BEAR := bear
67 M4_DEPS := $(wildcard m4/*) configure.ac
68 CONFIGURE_DEPS := $(M4_DEPS) aclocal.m4
69 DIST_DEPS := ar-lib compile config.guess config.sub install-sh missing depcomp configure omd/packages/openhardwaremonitor/OpenHardwareMonitorCLI.exe omd/packages/openhardwaremonitor/OpenHardwareMonitorLib.dll
72 LIVESTATUS_SOURCES := Makefile.am api/c++/{Makefile,*.{h,cc}} api/perl/* \
73 api/python/{README,*.py} {nagios,nagios4}/{README,*.h} \
74 src/{Makefile.am,*.{cc,h}} standalone/config_files.m4
76 # Files that are checked for trailing spaces
77 HEAL_SPACES_IN := checkman/* cmk_base/* checks/* notifications/* inventory/* \
78 $$(find -name Makefile) livestatus/src/*.{cc,h} \
79 web/htdocs/*.{py,css} web/htdocs/js/*.js web/plugins/*/*.py \
80 doc/helpers/* scripts/setup.sh scripts/autodetect.py \
81 $$(find pnp-templates -type f -name "*.php") \
82 bin/mkeventd bin/*.cc active_checks/* \
83 agents/check_mk_*agent* agents/*.c \
84 $$(find agents/cfg_examples -type f) \
85 agents/special/agent_* \
86 agents/special/lib/cmk_special_agents.py \
87 $$(find agents/plugins -type f) \
88 $(wildcard enterprise/cmk_base/cee/*.py \
89 enterprise/modules/*.py \
90 enterprise/web/htdocs/*.py \
91 enterprise/web/plugins/*/*/*.py) \
92 $(wildcard managed/web/htdocs/*.py \
93 managed/web/plugins/*/*/*.py)
95 FILES_TO_FORMAT := $(wildcard $(addprefix agents/,*.cc *.c *.h)) \
96 $(wildcard $(addprefix agents/windows/,*.cc *.h)) \
97 $(wildcard $(addprefix agents/windows/sections/,*.cc *.h)) \
98 $(wildcard $(addprefix agents/windows/test/,*.cc *.h)) \
99 $(wildcard $(addprefix agents/windows/test/sections,*.cc *.h)) \
100 $(wildcard $(addprefix livestatus/api/c++/,*.cc *.h)) \
101 $(wildcard $(addprefix livestatus/src/,*.cc *.h)) \
102 $(wildcard $(addprefix bin/,*.cc *.c *.h)) \
103 $(wildcard $(addprefix enterprise/core/src/,*.cc *.h)) \
104 $(wildcard $(addprefix enterprise/core/src/checkhelper/,*.cc *.h))
106 WERKS := $(wildcard .werks/[0-9]*)
108 JAVASCRIPT_SOURCES := $(filter-out %_min.js,$(wildcard $(addsuffix /web/htdocs/js/*.js,. enterprise managed)))
109 JAVASCRIPT_MINI := $(patsubst %.js,%_min.js,$(JAVASCRIPT_SOURCES))
111 PNG_FILES := $(wildcard $(addsuffix /*.png,web/htdocs/images web/htdocs/images/icons enterprise/web/htdocs/images enterprise/web/htdocs/images/icons managed/web/htdocs/images managed/web/htdocs/images/icons))
114 .PHONY: all analyze build check check-binaries check-permissions check-spaces \
115 check-version clean compile-neb-cmc cppcheck dist documentation format \
116 GTAGS headers healspaces help install iwyu mrproper \
117 optimize-images packages setup setversion tidy version \
118 am--refresh skel
120 help:
121 @echo "setup --> Prepare system for development and building"
122 @echo "make dist --> Create source tgz for later building of rpm/deb and livestatus tgz"
123 @echo "make rpm --> Create rpm package"
124 @echo "make deb --> Create deb package"
125 @echo "make cma --> Create cma package"
126 @echo "make version --> Switch to new version"
128 rpm:
129 $(MAKE) -C omd rpm
131 deb:
132 $(MAKE) -C omd deb
134 cma:
135 $(MAKE) -C omd cma
137 check: check-spaces check-permissions check-binaries check-version
139 check-spaces:
140 @echo -n "Checking for trailing spaces..."
141 @if grep -q '[[:space:]]$$' $(HEAL_SPACES_IN) ; then \
142 echo FAILED ; \
143 figlet "Space error"; \
144 echo "Aborting due to trailing spaces. Please use 'make healspaces' to repair."; \
145 echo "Affected files: "; \
146 grep -l '[[:space:]]$$' $(HEAL_SPACES_IN); \
147 exit 1; \
149 @echo OK
151 check-permissions:
152 @echo -n "Checking permissions... with find -not -perm -444..." && [ -z "$$(find -not -perm -444)" ] && echo OK
154 check-binaries:
155 @if [ -z "$(SKIP_SANITY_CHECKS)" ]; then \
156 echo -n "Checking precompiled binaries..." && file agents/waitmax | grep 32-bit >/dev/null && echo OK ; \
159 check-version:
160 @sed -n 1p ChangeLog | fgrep -qx '$(VERSION):' || { \
161 echo "Version $(VERSION) not listed at top of ChangeLog!" ; \
162 false ; }
164 # Is executed by our build environment from a "git archive" snapshot and during
165 # RPM building to create the source tar.gz for the RPM build process.
166 # Would use --exclude-vcs-ignores but that's available from tar 1.29 which
167 # is currently not used by most distros
168 # Would also use --exclude-vcs, but this is also not available
169 # And --transform is also missing ...
170 dist: mk-livestatus-$(VERSION).tar.gz $(DISTNAME).tar.gz config.h.in $(DIST_DEPS)
171 ifeq ($(ENTERPRISE),yes)
172 $(MAKE) -C enterprise agents/plugins/cmk-update-agent
173 $(MAKE) -C enterprise agents/plugins/cmk-update-agent-32
174 $(MAKE) -C enterprise agents/windows/plugins/cmk-update-agent.exe
175 endif
176 @set -e -o pipefail ; EXCLUDES= ; \
177 if [ -d .git ]; then \
178 git rev-parse --short HEAD > COMMIT ; \
179 for X in $$(git ls-files --directory --others -i --exclude-standard) ; do \
180 if [[ $$X != aclocal.m4 && $$X != config.h.in && ! "$(DIST_DEPS)" =~ (^|[[:space:]])$$X($$|[[:space:]]) && $$X != $(DISTNAME).tar.gz ]]; then \
181 EXCLUDES+=" --exclude $${X%*/}" ; \
182 fi ; \
183 done ; \
184 else \
185 for F in $(DIST_ARCHIVE) enterprise/agents/plugins/{build,build-32,src} agents/windows/{build64,build} enterprise/agents/winbuild; do \
186 EXCLUDES+=" --exclude $$F" ; \
187 done ; \
188 fi ; \
189 if [ -d check-mk-$(EDITION)-$(OMD_VERSION) ]; then \
190 rm -rf check-mk-$(EDITION)-$(OMD_VERSION) ; \
191 fi ; \
192 mkdir check-mk-$(EDITION)-$(OMD_VERSION) ; \
193 tar -c --wildcards \
194 $(TAROPTS) \
195 --exclude check-mk-$(EDITION)-$(OMD_VERSION) \
196 --exclude .git \
197 --exclude .gitignore \
198 --exclude .gitmodules \
199 --exclude .gitattributes \
200 $$EXCLUDES \
201 * .werks .clang* | tar x -C check-mk-$(EDITION)-$(OMD_VERSION)
202 if [ -f COMMIT ]; then \
203 rm COMMIT ; \
205 tar -cz --wildcards -f $(DIST_ARCHIVE) \
206 $(TAROPTS) \
207 check-mk-$(EDITION)-$(OMD_VERSION)
208 rm -rf check-mk-$(EDITION)-$(OMD_VERSION)
210 # This tar file is only used by "omd/packages/check_mk/Makefile"
211 $(DISTNAME).tar.gz: mk-livestatus-$(VERSION).tar.gz .werks/werks $(JAVASCRIPT_MINI) ChangeLog
212 @echo "Making $(DISTNAME)"
213 rm -rf $(DISTNAME)
214 mkdir -p $(DISTNAME)
215 $(MAKE) -C agents build
216 tar cf $(DISTNAME)/bin.tar $(TAROPTS) -C bin $$(cd bin ; ls)
217 tar rf $(DISTNAME)/bin.tar $(TAROPTS) -C agents/windows/msibuild msi-update
218 gzip $(DISTNAME)/bin.tar
219 python -m compileall cmk ; \
220 tar czf $(DISTNAME)/lib.tar.gz $(TAROPTS) \
221 --exclude "cee" \
222 --exclude "cee.py*" \
223 --exclude "cme" \
224 --exclude "cme.py*" \
225 cmk/* ; \
226 rm cmk/*.pyc
227 python -m compileall cmk_base ; \
228 tar czf $(DISTNAME)/base.tar.gz \
229 $(TAROPTS) \
230 --exclude "cee" \
231 --exclude "cee.py*" \
232 --exclude "cme" \
233 --exclude "cme.py*" \
234 cmk_base/* ; \
235 rm cmk_base/*.pyc
236 python -m compileall agents/special/lib ; \
237 tar czf $(DISTNAME)/special_agent_api.tar.gz $(TAROPTS) -C agents/special/lib cmk_special_agent_api.py \
238 --exclude ".f12"
239 rm agents/special/lib/*.pyc
240 tar czf $(DISTNAME)/werks.tar.gz $(TAROPTS) -C .werks werks
241 tar czf $(DISTNAME)/checks.tar.gz $(TAROPTS) -C checks $$(cd checks ; ls)
242 tar czf $(DISTNAME)/active_checks.tar.gz $(TAROPTS) -C active_checks $$(cd active_checks ; ls)
243 tar czf $(DISTNAME)/notifications.tar.gz $(TAROPTS) -C notifications $$(cd notifications ; ls)
244 tar czf $(DISTNAME)/inventory.tar.gz $(TAROPTS) -C inventory $$(cd inventory ; ls)
245 tar czf $(DISTNAME)/checkman.tar.gz $(TAROPTS) -C checkman $$(cd checkman ; ls)
246 tar czf $(DISTNAME)/web.tar.gz $(TAROPTS) -C web htdocs plugins
248 tar xzf mk-livestatus-$(VERSION).tar.gz
249 tar czf $(DISTNAME)/livestatus.tar.gz $(TAROPTS) -C mk-livestatus-$(VERSION) $$(cd mk-livestatus-$(VERSION) ; ls -A )
250 rm -rf mk-livestatus-$(VERSION)
252 tar czf $(DISTNAME)/pnp-templates.tar.gz $(TAROPTS) -C pnp-templates $$(cd pnp-templates ; ls *.php)
253 tar cf $(DISTNAME)/doc.tar $(TAROPTS) -C doc $$(cd doc ; ls)
254 tar rf $(DISTNAME)/doc.tar $(TAROPTS) COPYING AUTHORS ChangeLog
255 tar rf $(DISTNAME)/doc.tar $(TAROPTS) livestatus/api --exclude "*~" --exclude "*.pyc" --exclude ".gitignore" --exclude .f12
256 gzip $(DISTNAME)/doc.tar
258 cd agents ; tar czf ../$(DISTNAME)/agents.tar.gz $(TAROPTS) \
259 --exclude check_mk_agent.spec \
260 --exclude special/lib \
261 cfg_examples \
262 plugins \
263 sap \
264 special \
265 z_os \
266 check-mk-agent_*.deb \
267 check-mk-agent-*.rpm \
268 check_mk_agent.* \
269 check_mk_caching_agent.linux \
270 CONTENTS \
271 mk-job* \
272 waitmax \
273 windows/cfg_examples \
274 windows/check_mk_agent*.{exe,msi} \
275 windows/check_mk.example.ini \
276 windows/CONTENTS \
277 windows/mrpe \
278 windows/plugins
279 cd $(DISTNAME) ; ../scripts/make_package_info $(VERSION) > package_info
280 install -m 755 scripts/*.{sh,py} $(DISTNAME)
281 install -m 644 COPYING AUTHORS ChangeLog standalone.make $(DISTNAME)
282 echo "$(VERSION)" > $(DISTNAME)/VERSION
283 tar czf $(DISTNAME).tar.gz $(TAROPTS) $(DISTNAME)
284 rm -rf $(DISTNAME)
286 @echo "=============================================================================="
287 @echo " FINISHED. "
288 @echo "=============================================================================="
290 omd/packages/openhardwaremonitor/OpenHardwareMonitorCLI.exe omd/packages/openhardwaremonitor/OpenHardwareMonitorLib.dll:
291 make -C omd/packages/openhardwaremonitor dist
293 .werks/werks: $(WERKS)
294 PYTHONPATH=. python scripts/precompile-werks.py .werks .werks/werks cre
296 ChangeLog: .werks/werks
297 PYTHONPATH=. python scripts/create-changelog.py ChangeLog .werks/werks
299 packages:
300 $(MAKE) -C agents packages
302 # NOTE: Old tar versions (e.g. on CentOS 5) don't have the --transform option,
303 # so we do things in a slightly complicated way.
304 mk-livestatus-$(VERSION).tar.gz:
305 rm -rf mk-livestatus-$(VERSION)
306 mkdir -p mk-livestatus-$(VERSION)
307 tar cf - $(TAROPTS) -C livestatus $$(cd livestatus ; echo $(LIVESTATUS_SOURCES) ) | tar xf - -C mk-livestatus-$(VERSION)
308 cp -a configure.ac m4 mk-livestatus-$(VERSION)
309 cd mk-livestatus-$(VERSION) && autoreconf --install --include=m4 && rm -rf autom4te.cache
310 tar czf mk-livestatus-$(VERSION).tar.gz $(TAROPTS) mk-livestatus-$(VERSION)
311 rm -rf mk-livestatus-$(VERSION)
313 version:
314 [ "$$(head -c 6 /etc/issue)" = "Ubuntu" \
315 -o "$$(head -c 16 /etc/issue)" = "Debian GNU/Linux" ] \
316 || { echo 'You are not on the reference system!' ; exit 1; }
317 @newversion=$$(dialog --stdout --inputbox "New Version:" 0 0 "$(VERSION)") ; \
318 if [ -n "$$newversion" ] ; then $(MAKE) NEW_VERSION=$$newversion setversion ; fi
320 setversion:
321 $(MAKE) -C omd NEW_VERSION=$(NEW_VERSION) setversion
322 sed -ri 's/^(VERSION[[:space:]]*:?= *).*/\1'"$(NEW_VERSION)/" defines.make ; \
323 sed -i 's/^AC_INIT.*/AC_INIT([MK Livestatus], ['"$(NEW_VERSION)"'], [mk@mathias-kettner.de])/' configure.ac ; \
324 sed -i 's/^VERSION=".*/VERSION="$(NEW_VERSION)"/' bin/mkbackup ; \
325 sed -i 's/^__version__ = ".*"$$/__version__ = "$(NEW_VERSION)"/' cmk/__init__.py bin/mkbench bin/livedump; \
326 sed -i 's/^VERSION=.*/VERSION='"$(NEW_VERSION)"'/' scripts/setup.sh ; \
327 $(MAKE) -C agents NEW_VERSION=$(NEW_VERSION) setversion
328 $(MAKE) -C docker NEW_VERSION=$(NEW_VERSION) setversion
329 ifeq ($(ENTERPRISE),yes)
330 $(MAKE) -C enterprise NEW_VERSION=$(NEW_VERSION) setversion
331 endif
333 headers:
334 doc/helpers/headrify
336 healspaces:
337 @echo "Removing trailing spaces from code lines..."
338 @sed -ri 's/[[:space:]]+$$//g' $(HEAL_SPACES_IN)
340 optimize-images:
341 @if type pngcrush >/dev/null 2>&1; then \
342 for F in $(PNG_FILES); do \
343 echo "Optimizing $$F..." ; \
344 pngcrush -q -rem alla -brute $$F $$F.opt ; \
345 mv $$F.opt $$F; \
346 done ; \
347 else \
348 echo "Missing pngcrush, not optimizing images! (run \"make setup\" to fix this)" ; \
351 install-minified-js: $(JAVASCRIPT_MINI)
352 cp $? $(DESTDIR)/web/htdocs/js
354 %_min.js: %.js
355 @if type slimit >/dev/null 2>&1; then \
356 cat $< | slimit > $@ ; \
357 else \
358 echo "missing slimit: $< not minified, run \"make setup\" to fix this" ; \
361 # TODO(sp) The target below is not correct, we should not e.g. remove any stuff
362 # which is needed to run configure, this should live in a separate target. In
363 # fact, we should really clean up all this cleaning-chaos and finally follow the
364 # GNU standards here (see "Standard Targets for Users",
365 # https://www.gnu.org/prep/standards/html_node/Standard-Targets.html).
366 clean:
367 rm -rf clang-analyzer dist.tmp rpm.topdir *.rpm *.deb *.exe \
368 mk-livestatus-*.tar.gz \
369 $(NAME)-*.tar.gz *~ counters autochecks \
370 precompiled cache web/htdocs/js/*_min.js \
371 .werks/werks \
372 ChangeLog
374 mrproper:
375 git clean -d --force -x --exclude='\.werks/.last' --exclude='\.werks/.my_ids'
377 setup:
378 sudo apt-get install \
379 aptitude \
380 autoconf \
381 bear \
382 build-essential \
383 clang-6.0 \
384 clang-format-6.0 \
385 clang-tidy-6.0 \
386 doxygen \
387 figlet \
388 g++ \
389 libboost-dev \
390 libboost-system-dev \
391 libclang-6.0-dev \
392 libpcap-dev \
393 librrd-dev \
394 llvm-6.0-dev \
395 libsasl2-dev \
396 pngcrush \
397 slimit \
398 valgrind \
399 direnv \
400 python-pip \
401 chrpath \
402 enchant
403 sudo -H pip install pipenv
404 $(MAKE) -C omd setup
405 $(MAKE) -C omd/packages/openhardwaremonitor setup
406 $(MAKE) -C docker setup
407 ifeq ($(ENTERPRISE),yes)
408 $(MAKE) -C enterprise/locale setup
409 endif
411 linesofcode:
412 @wc -l $$(find -type f -name "*.py" -o -name "*.js" -o -name "*.cc" -o -name "*.h" -o -name "*.css" | grep -v openhardwaremonitor | grep -v jquery | grep -v livestatus/src ) | sort -n
414 ar-lib compile config.guess config.sub install-sh missing depcomp: configure.ac
415 autoreconf --install --include=m4
416 touch ar-lib compile config.guess config.sub install-sh missing depcomp
418 # TODO(sp): We should really detect and use our own packages in a less hacky way...
419 config.status: $(DIST_DEPS)
420 @echo "Build $@ (newer targets: $?)"
421 @if test -f config.status; then \
422 echo "update config.status by reconfiguring in the same conditions" ; \
423 ./config.status --recheck; \
424 else \
425 if test -d ../boost/destdir ; then \
426 BOOST_OPT="--with-boost=$(abspath ../boost/destdir)" ; \
427 elif test -d omd/packages/boost/destdir ; then \
428 BOOST_OPT="--with-boost=$(abspath omd/packages/boost/destdir)" ; \
429 else \
430 BOOST_OPT="DUMMY1=" ; \
431 fi ; \
432 if test -d "omd/packages/rrdtool/rrdtool-1.7.0/src/.libs"; then \
433 RRD_OPT="LDFLAGS=-L$(realpath omd/packages/rrdtool/rrdtool-1.7.0/src/.libs)" ; \
434 else \
435 RRD_OPT="DUMMY2=" ; \
436 fi ; \
437 if test -d ../re2/destdir ; then \
438 RE2_OPT="--with-re2=$(abspath ../re2/destdir)" ; \
439 elif test -d omd/packages/re2/destdir ; then \
440 RE2_OPT="--with-re2=$(abspath omd/packages/re2/destdir)" ; \
441 else \
442 RE2_OPT="DUMMY3=" ; \
443 fi ; \
444 echo "configure CXXFLAGS=\"$(CXX_FLAGS)\" \"$$BOOST_OPT\" \"$$RRD_OPT\" \"$$RE2_OPT\"" ; \
445 ./configure CXXFLAGS="$(CXX_FLAGS)" "$$BOOST_OPT" "$$RRD_OPT" "$$RE2_OPT" ; \
448 configure: $(CONFIGURE_DEPS)
449 autoconf
451 aclocal.m4: $(M4_DEPS)
452 aclocal
454 config.h.in: $(CONFIGURE_DEPS)
455 autoheader
456 rm -f stamp-h1
457 touch $@
459 config.h: stamp-h1
460 @test -f $@ || rm -f stamp-h1
461 @test -f $@ || $(MAKE) stamp-h1
463 stamp-h1: config.h.in config.status
464 @rm -f stamp-h1
465 ./config.status config.h
467 GTAGS: config.h
468 # automake generates "gtags -i ...", but incremental updates seem to be a bit
469 # fragile, so let's start from scratch, gtags is quite fast.
470 $(RM) GTAGS GRTAGS GSYMS GPATH
471 # Note: Even if we descend into livestatus, gtags is run on the top level (next
472 # to configure.ac).
473 $(MAKE) -C livestatus GTAGS
475 compile-neb-cmc: config.status
476 $(MAKE) -C livestatus -j4
477 ifeq ($(ENTERPRISE),yes)
478 $(MAKE) -C enterprise/core -j4
479 endif
481 tidy: config.h
482 $(MAKE) -C livestatus/src tidy
483 ifeq ($(ENTERPRISE),yes)
484 $(MAKE) -C enterprise/core/src tidy
485 endif
487 iwyu: config.h
488 $(MAKE) -C livestatus/src iwyu
489 ifeq ($(ENTERPRISE),yes)
490 $(MAKE) -C enterprise/core/src iwyu
491 endif
493 # Not really perfect rules, but better than nothing
494 analyze: config.h
495 $(MAKE) -C livestatus clean
496 cd livestatus && $(SCAN_BUILD) -o ../clang-analyzer $(MAKE) CXXFLAGS="-std=c++17"
498 # GCC-like output on stderr intended for human consumption.
499 cppcheck: config.h
500 $(MAKE) -C livestatus/src cppcheck
501 ifeq ($(ENTERPRISE),yes)
502 $(MAKE) -C enterprise/core/src cppcheck
503 endif
505 # XML output into file intended for machine processing.
506 cppcheck-xml: config.h
507 $(MAKE) -C livestatus/src cppcheck-xml
508 ifeq ($(ENTERPRISE),yes)
509 $(MAKE) -C enterprise/core/src cppcheck-xml
510 endif
512 # TODO: We should probably handle this rule via AM_EXTRA_RECURSIVE_TARGETS in
513 # src/configure.ac, but this needs at least automake-1.13, which in turn is only
514 # available from e.g. Ubuntu Saucy (13) onwards, so some magic is needed.
515 format:
516 $(CLANG_FORMAT) -style=file -i $(FILES_TO_FORMAT)
518 # Note: You need the doxygen and graphviz packages.
519 documentation: config.h
520 $(MAKE) -C livestatus/src documentation
521 ifeq ($(ENTERPRISE),yes)
522 $(MAKE) -C enterprise/core/src documentation
523 endif
525 Pipfile.lock: Pipfile
526 $(PIPENV) lock
527 # TODO: Can be removed if pipenv fixes this issue.
528 # See: https://github.com/pypa/pipenv/issues/3140
529 # https://github.com/pypa/pipenv/issues/3026
530 # The recent pipenv version 2018.10.13 has a bug that places wrong markers in the
531 # Pipfile.lock. This leads to an error when installing packages with this
532 # markers and prints an error message. Example:
533 # Ignoring pyopenssl: markers 'extra == "security"' don't match your environment
534 sed -i "/\"markers\": \"extra == /d" Pipfile.lock
535 # TODO: pipenv and make don't really cooperate nicely: Locking alone already
536 # creates a virtual environment with setuptools/pip/wheel. This could lead to a
537 # wrong up-to-date status of it later, so let's remove it here. What we really
538 # want is a check if the contents of .venv match the contents of Pipfile.lock.
539 # We should do this via some move-if-change Kung Fu, but for now rm suffices.
540 rm -rf .venv
542 .venv: Pipfile.lock
543 $(PIPENV) install --dev
544 $(PIPENV) clean
545 # TODO: Part 2 of the hack for the Pipfile.lock target.
546 touch .venv
548 # This dummy rule is called from subdirectories whenever one of the
549 # top-level Makefile's dependencies must be updated. It does not
550 # need to depend on %MAKEFILE% because GNU make will always make sure
551 # %MAKEFILE% is updated before considering the am--refresh target.
552 am--refresh: