mirror of
https://github.com/munin-monitoring/muninlite.git
synced 2024-09-28 22:01:29 +02:00
Makefile: use make variables for filenames
This commit is contained in:
parent
519a1c2ef9
commit
6dcd179e56
39
Makefile
39
Makefile
@ -1,9 +1,14 @@
|
|||||||
PLUGINS = df cpu if_ if_err_ load memory processes swap netstat uptime interrupts irqstats ntpdate plugindir_
|
PLUGINS = df cpu if_ if_err_ load memory processes swap netstat uptime interrupts irqstats ntpdate plugindir_
|
||||||
|
CONFIGURATION_FILE ?= munin-node.conf
|
||||||
|
TARGET_FILE ?= munin-node
|
||||||
|
VERSION ?= $(shell cat VERSION)
|
||||||
|
DIST_DIR = releases
|
||||||
|
TGZ_FILE ?= $(DIST_DIR)/muninlite-$(VERSION).tar.gz
|
||||||
|
|
||||||
|
|
||||||
munin-node: plugins/* munin-node.conf
|
$(TARGET_FILE): plugins/* $(CONFIGURATION_FILE)
|
||||||
@export VERSION=$$(cat VERSION); \
|
@export VERSION="$(VERSION)"; \
|
||||||
export CONF=$$(grep -v '^#' munin-node.conf); \
|
export CONF=$$(grep -v '^#' "$(CONFIGURATION_FILE)"); \
|
||||||
export "PLUGINS=$(PLUGINS)"; \
|
export "PLUGINS=$(PLUGINS)"; \
|
||||||
echo "Making munin-node for muninlite version $$VERSION"; \
|
echo "Making munin-node for muninlite version $$VERSION"; \
|
||||||
export PLSTR=""; \
|
export PLSTR=""; \
|
||||||
@ -17,30 +22,32 @@ munin-node: plugins/* munin-node.conf
|
|||||||
s/\@\@CONF\@\@/$$ENV{"CONF"}/; \
|
s/\@\@CONF\@\@/$$ENV{"CONF"}/; \
|
||||||
s/\@\@PLUGINS\@\@/$$ENV{"PLUGINS"}/; \
|
s/\@\@PLUGINS\@\@/$$ENV{"PLUGINS"}/; \
|
||||||
s/\@\@PLSTR\@\@/$$ENV{"PLSTR"}/;' \
|
s/\@\@PLSTR\@\@/$$ENV{"PLSTR"}/;' \
|
||||||
munin-node.in > munin-node
|
munin-node.in >"$(TARGET_FILE)"
|
||||||
@chmod +x munin-node
|
@chmod +x "$(TARGET_FILE)"
|
||||||
|
|
||||||
all: munin-node
|
all: $(TARGET_FILE)
|
||||||
|
|
||||||
clean-node:
|
clean-node:
|
||||||
@echo "Removing munin-node"
|
@echo "Removing $(TARGET_FILE)"
|
||||||
@rm -f munin-node
|
@rm -f "$(TARGET_FILE)"
|
||||||
|
|
||||||
clean-tgz:
|
clean-tgz:
|
||||||
@echo "Removing old releases"
|
@echo "Removing old releases"
|
||||||
@rm -rf releases
|
@rm -rf "$(DIST_DIR)"
|
||||||
|
|
||||||
clean: clean-node
|
clean: clean-node
|
||||||
|
|
||||||
clean-all: clean-node clean-tgz
|
clean-all: clean-node clean-tgz
|
||||||
|
|
||||||
tgz: clean-node
|
tgz: $(TGZ_FILE)
|
||||||
@VERSION=$$(cat VERSION); \
|
|
||||||
echo "Building release/muninlite-$$VERSION.tar.gz"; \
|
$(TGZ_FILE):
|
||||||
mkdir -p releases; \
|
@VERSION="$(VERSION)"; \
|
||||||
cp -ra . releases/muninlite-$$VERSION 2>/dev/null || true; \
|
echo "Building "$(DIST_DIR)"/muninlite-$$VERSION.tar.gz"; \
|
||||||
cd releases; \
|
mkdir -p "$(DIST_DIR)"; \
|
||||||
rm -rf muninlite-$$VERSION/releases; \
|
cp -ra . "$(DIST_DIR)"/muninlite-$$VERSION 2>/dev/null || true; \
|
||||||
|
cd "$(DIST_DIR)"; \
|
||||||
|
rm -rf muninlite-$$VERSION/"$(DIST_DIR)"; \
|
||||||
rm -rf muninlite-$$VERSION/.svn; \
|
rm -rf muninlite-$$VERSION/.svn; \
|
||||||
tar zcvf muninlite-$$VERSION.tar.gz muninlite-$$VERSION >/dev/null; \
|
tar zcvf muninlite-$$VERSION.tar.gz muninlite-$$VERSION >/dev/null; \
|
||||||
rm -rf muninlite-$$VERSION;
|
rm -rf muninlite-$$VERSION;
|
||||||
|
Loading…
Reference in New Issue
Block a user