summaryrefslogtreecommitdiff
path: root/src/pmieconf/GNUmakefile.rules
blob: 6a12eba7f8ddbc714f78d71cf5f2faf4ec0c05a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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)