Module: check_mk
Branch: master
Commit: 56c985d965d423eb0f127e2eadd71a92cab9316f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=56c985d965d423…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Sep 3 22:04:21 2018 +0200
Makefile: Move some generic definitions to includable file
This is needed for the upcoming container packaging and can also
be used by other Makefiles to reduce redundant definitions.
Change-Id: Ib165b6a23b7592736ee1cde061f91cd103a9d6cc
---
Makefile | 28 ++--------------------------
agents/Makefile | 5 ++---
defines.make | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
omd/Makefile | 1 -
omd/Makefile.omd | 18 +++---------------
5 files changed, 59 insertions(+), 45 deletions(-)
diff --git a/Makefile b/Makefile
index fe6c04b..bcddb2e 100644
--- a/Makefile
+++ b/Makefile
@@ -23,32 +23,8 @@
# Boston, MA 02110-1301 USA.
#
-EDITION := raw
-EDITION_SHORT := cre
-
-ifneq (,$(wildcard enterprise))
-ENTERPRISE := yes
-EDITION := enterprise
-EDITION_SHORT := cee
-else
-ENTERPRISE := no
-endif
-
-ifneq (,$(wildcard managed))
-MANAGED := yes
-EDITION := managed
-EDITION_SHORT := cme
-else
-MANAGED := no
-endif
-
-VERSION := 1.6.0i1
-DEMO_SUFFIX :=
-OMD_VERSION := $(VERSION).$(EDITION_SHORT)$(DEMO_SUFFIX)
+include defines.make
-SHELL := /bin/bash
-# TODO: Be more strict - Add this:
-#SHELL := /bin/bash -e -o pipefail
NAME := check_mk
PREFIX := /usr
BINDIR := $(PREFIX)/bin
@@ -312,7 +288,7 @@ version:
if [ -n "$$newversion" ] ; then $(MAKE) NEW_VERSION=$$newversion setversion ;
fi
setversion:
- sed -ri 's/^(VERSION[[:space:]]*:?= *).*/\1'"$(NEW_VERSION)/" Makefile
; \
+ sed -ri 's/^(VERSION[[:space:]]*:?= *).*/\1'"$(NEW_VERSION)/"
defines.make ; \
sed -i 's/^AC_INIT.*/AC_INIT([MK Livestatus],
['"$(NEW_VERSION)"'], [mk(a)mathias-kettner.de])/' configure.ac ; \
sed -i 's/^VERSION=".*/VERSION="$(NEW_VERSION)"/' bin/mkbackup ;
\
sed -i 's/^__version__ = ".*"$$/__version__ =
"$(NEW_VERSION)"/' cmk/__init__.py bin/mkbench bin/livedump; \
diff --git a/agents/Makefile b/agents/Makefile
index 61b5d33..54a94f5 100644
--- a/agents/Makefile
+++ b/agents/Makefile
@@ -22,8 +22,8 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-SHELL = /bin/bash
-VERSION = 1.6.0i1
+include ../defines.make
+
RPM_VERSION = $(subst -,_,$(VERSION))
NAME = check-mk-agent
DISTNAME = $(NAME)-$(VERSION)
@@ -54,7 +54,6 @@ waitmax: waitmax.c
@echo "Fine. Typing 'make install' as root now will install into
/usr/bin"
setversion:
- sed -ri 's/^(VERSION[[:space:]]*:?= *).*/\1'"$(NEW_VERSION)/" Makefile
; \
sed -i 's/say "Version: .*"/say "Version: $(NEW_VERSION)"/'
check_mk_agent.openvms ; \
for agent in check_mk_agent.*; do \
if [ "$$agent" != windows -a "$$agent" != plugins -a
"$$agent" != hpux ] ; then \
diff --git a/defines.make b/defines.make
new file mode 100644
index 0000000..da0b190
--- /dev/null
+++ b/defines.make
@@ -0,0 +1,52 @@
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2014 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at
http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# tails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+#
+
+EDITION := raw
+EDITION_SHORT := cre
+
+ifneq (,$(wildcard enterprise))
+ENTERPRISE := yes
+EDITION := enterprise
+EDITION_SHORT := cee
+else
+ENTERPRISE := no
+endif
+
+ifneq (,$(wildcard managed))
+MANAGED := yes
+EDITION := managed
+EDITION_SHORT := cme
+else
+MANAGED := no
+endif
+
+VERSION := 1.6.0i1
+# Will be set to ".demo" by cmk build system when building a demo package
+DEMO_SUFFIX :=
+OMD_VERSION := $(VERSION).$(EDITION_SHORT)$(DEMO_SUFFIX)
+
+SHELL := /bin/bash
+# TODO: Be more strict - Add this:
+#SHELL := /bin/bash -e -o pipefail
diff --git a/omd/Makefile b/omd/Makefile
index 1be2c20..f5e52e7 100644
--- a/omd/Makefile
+++ b/omd/Makefile
@@ -289,7 +289,6 @@ alt:
setversion:
NEW_OMD_VERSION=$(NEW_VERSION).$(EDITION_SHORT)$(DEMO_SUFFIX) ; \
if [ -n "$$NEW_OMD_VERSION" ] && [ "$$NEW_OMD_VERSION" !=
"$(OMD_VERSION)" ]; then \
- sed -ri 's/^(CMK_VERSION[[:space:]]*:= *).*/\1'"$(NEW_VERSION)/"
Makefile.omd ; \
sed -ri 's/^(OMD_SERIAL[[:space:]]*= *).*/\1'"$(NEW_SERIAL)/"
Makefile.omd ; \
sed -ri 's/^(OMD_VERSION[[:space:]]*=
*).*/\1"'"$$NEW_OMD_VERSION"'"/' packages/omd/omd ; \
fi
diff --git a/omd/Makefile.omd b/omd/Makefile.omd
index 4819e77..570af7f 100644
--- a/omd/Makefile.omd
+++ b/omd/Makefile.omd
@@ -7,24 +7,12 @@ else
REPO_PATH := $(abspath ..)
endif
-PACKAGE_BASE := $(REPO_PATH)/omd/packages
+include $(REPO_PATH)/defines.make
-EDITION := raw
-EDITION_SHORT := cre
-ifneq (,$(wildcard $(REPO_PATH)/enterprise))
- EDITION := enterprise
- EDITION_SHORT := cee
-endif
-ifneq (,$(wildcard $(REPO_PATH)/managed))
- EDITION := managed
- EDITION_SHORT := cme
-endif
+PACKAGE_BASE := $(REPO_PATH)/omd/packages
-CMK_VERSION := 1.6.0i1
+CMK_VERSION := $(VERSION)
OMD_SERIAL := 38
-# Will be set to ".demo" by cmk build system when building a demo package
-DEMO_SUFFIX :=
-OMD_VERSION := $(CMK_VERSION).$(EDITION_SHORT)$(DEMO_SUFFIX)
OMD_BASE := /omd
OMD_PHYSICAL_BASE := /opt/omd