summaryrefslogtreecommitdiff
path: root/src/pmieconf/GNUmakefile.rules
diff options
context:
space:
mode:
Diffstat (limited to 'src/pmieconf/GNUmakefile.rules')
-rw-r--r--src/pmieconf/GNUmakefile.rules55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/pmieconf/GNUmakefile.rules b/src/pmieconf/GNUmakefile.rules
new file mode 100644
index 0000000..6a12eba
--- /dev/null
+++ b/src/pmieconf/GNUmakefile.rules
@@ -0,0 +1,55 @@
+# This program 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; either version 2 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+
+TOPDIR = ../../..
+include $(TOPDIR)/src/include/builddefs
+
+# localdefs needs to set ALL_RULES (all the rules files to be included
+# in the builds and tar balls) and set LOCAL_RULES (the subset of the
+# rules that will work on the TARGET_OS platform)
+#
+include localdefs
+
+WORKDIR := $(shell pwd)
+GROUP := $(shell basename $(WORKDIR))
+RULESDIR = $(PCP_VAR_DIR)/config/pmieconf
+
+LDIRT = GNUmakefile
+
+LSRCFILES = localdefs $(ALL_RULES)
+
+CONFIGS = $(subst "./","",$(LOCAL_RULES))
+
+default_pcp: $(LOCAL_RULES)
+
+install_pcp: install
+
+install: default_pcp
+ $(INSTALL) -d $(RULESDIR)/$(GROUP)
+ @for f in $(CONFIGS); do \
+ $(INSTALL) -m 644 $$f $(RULESDIR)/$(GROUP)/$$f; \
+ done
+
+local:
+ @test ! -d ../rules/$(GROUP) && mkdir -p ../rules/$(GROUP); exit 0
+ @rm -f ../rules/$(GROUP)/*
+ @for f in IGNORE_DUMMY_RULE $(LOCAL_RULES); do \
+ [ $$f = IGNORE_DUMMY_RULE ] && continue; \
+ cp ../$(GROUP)/$$f ../rules/$(GROUP)/$$f; \
+ sed -e's|/usr/pcp/lib/pmie_email|$(PCP_BINADM_DIR)/pmie_email|' \
+ -e's|/usr/pcp/bin/pmpost|$(PCP_BINADM_DIR)/pmpost|' <$$f \
+ >../rules/$(GROUP)/$$f; \
+ done
+
+pmlogconf:
+ @if [ -n "$(CONFIGS)" ]; then sh ../xtractnames $(CONFIGS); fi
+
+include $(BUILDRULES)