Module: check_mk
Branch: master
Commit: 38937d9ee7c112d7c07c63690c85a453dac0abfe
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=38937d9ee7c112…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Aug 24 11:09:47 2014 +0200
Cleanup main Makefile a bit
---
Makefile | 73 +++++++++++++++++++++++++++++++++++---------------------------
1 file changed, 41 insertions(+), 32 deletions(-)
diff --git a/Makefile b/Makefile
index 0bd0218..847971e 100644
--- a/Makefile
+++ b/Makefile
@@ -34,11 +34,25 @@ LIBDIR = $(PREFIX)/lib/$(NAME)
DISTNAME = $(NAME)-$(VERSION)
TAROPTS = --owner=root --group=root --exclude=.svn --exclude=*~ \
--exclude=.gitignore --exclude=.*.swp --exclude=.f12
+
+# File to pack into livestatus-$(VERSION).tar.gz
LIVESTATUS_SOURCES = configure aclocal.m4 config.guess config.h.in config.sub \
configure.ac ltmain.sh Makefile.am Makefile.in missing \
- nagios/README nagios/*.h nagios4/README nagios4/*.h src/*.{h,c,cc}
src/Makefile.{in,am} \
+ nagios/README nagios/*.h nagios4/README nagios4/*.h \
+ src/*.{h,c,cc} src/Makefile.{in,am} \
depcomp install-sh api/python/{*.py,README} api/perl/*
+# Files that are checked for trailing spaces
+HEAL_SPACES_IN = checkman/* modules/* checks/* notifications/* inventory/* \
+ $$(find -name Makefile) livestatus/src/*{cc,c,h} \
+ web/htdocs/*.{py,css} web/htdocs/js/*.js web/plugins/*/*.py \
+ doc/helpers/* scripts/setup.sh scripts/autodetect.py \
+ $$(find pnp-templates -type f -name "*.php") \
+ mkeventd/bin/mkeventd mkeventd/web/htdocs/*.py mkeventd/web/plugins/*/*.py
\
+ mkeventd/src/*.c mkeventd/checks/* check_mk_templates.cfg \
+ doc/treasures/mknotifyd agents/check_mk_agent* \
+ $$(find agents/plugins -type f)
+
.PHONY: help install clean
@@ -62,11 +76,6 @@ check-binaries:
echo -n "Checking precompiled binaries..." && file agents/waitmax
| grep 32-bit >/dev/null && echo OK ; \
fi
-check-version:
- @sed -n 1p ChangeLog | fgrep -qx '$(VERSION):' || { \
- echo "Version $(VERSION) not listed at top of ChangeLog!" ; \
- false ; }
-
check: check-spaces check-permissions check-binaries check-version
@@ -140,6 +149,11 @@ mk-livestatus:
rm -rf mk-livestatus-$(VERSION)
+check-version:
+ @sed -n 1p ChangeLog | fgrep -qx '$(VERSION):' || { \
+ echo "Version $(VERSION) not listed at top of ChangeLog!" ; \
+ false ; }
+
version:
[ "$$(head -c 12 /etc/issue)" = "Ubuntu 10.10" \
-o "$$(head -c 12 /etc/issue)" = "Ubuntu 11.04" \
@@ -227,43 +241,38 @@ deb-agent: $(NAME)-agent-$(VERSION)-1.noarch.rpm
$(NAME)-agent-logwatch-$(VERSIO
done
-clean:
- rm -rf dist.tmp rpm.topdir *.rpm *.deb *.exe \
- mkeventd-*.tar.gz mk-livestatus-*.tar.gz \
- $(NAME)-*.tar.gz *~ counters autochecks \
- precompiled cache
- find -name "*~" | xargs rm -f
-
-mrproper:
- git clean -xfd -e .bugs 2>/dev/null || git clean -xfd
+setup:
+ $(MAKE) dist
+ rm -rf $(DISTNAME)
+ tar xzf $(DISTNAME).tar.gz
+ cd $(DISTNAME) && ./setup.sh --yes
+ rm -rf $(DISTNAME)
+ check_mk -R
+ /etc/init.d/apache2 reload
-SOURCE_FILES = checkman/* modules/* checks/* notifications/* inventory/* $$(find -name
Makefile) \
- livestatus/src/*{cc,c,h} web/htdocs/*.{py,css} web/htdocs/js/*.js
web/plugins/*/*.py \
- doc/helpers/* scripts/setup.sh scripts/autodetect.py $$(find pnp-templates
-type f -name "*.php") \
- mkeventd/bin/mkeventd mkeventd/web/htdocs/*.py mkeventd/web/plugins/*/*.py
mkeventd/src/*.c \
- mkeventd/checks/* check_mk_templates.cfg doc/treasures/mknotifyd
agents/check_mk_agent* \
- $$(find agents/plugins -type f)
check-spaces:
@echo -n "Checking for trailing spaces..."
- @if grep -q '[[:space:]]$$' $(SOURCE_FILES) ; then echo $$? ; figlet "Space
error" \
+ @if grep -q '[[:space:]]$$' $(HEAL_SPACES_IN) ; then echo $$? ; figlet
"Space error" \
; echo "Aborting due to trailing spaces. Please use 'make
healspaces' to repair." \
; echo "Affected files: " \
- ; grep -l '[[:space:]]$$' $(SOURCE_FILES) \
+ ; grep -l '[[:space:]]$$' $(HEAL_SPACES_IN) \
; exit 1 ; fi
@echo OK
+
healspaces:
@echo "Removing trailing spaces from code lines..."
- @sed -ri 's/[[:space:]]+$$//g' $(SOURCE_FILES)
+ @sed -ri 's/[[:space:]]+$$//g' $(HEAL_SPACES_IN)
-setup:
- $(MAKE) dist
- rm -rf $(DISTNAME)
- tar xzf $(DISTNAME).tar.gz
- cd $(DISTNAME) && ./setup.sh --yes
- rm -rf $(DISTNAME)
- check_mk -R
- /etc/init.d/apache2 reload
+clean:
+ rm -rf dist.tmp rpm.topdir *.rpm *.deb *.exe \
+ mkeventd-*.tar.gz mk-livestatus-*.tar.gz \
+ $(NAME)-*.tar.gz *~ counters autochecks \
+ precompiled cache
+ find -name "*~" | xargs rm -f
+
+mrproper:
+ git clean -xfd -e .bugs 2>/dev/null || git clean -xfd