Merge branch 'master' of https://github.com/kmcdonell/pcp into kenj-merge
[pcp.git] / GNUmakefile
blobd111f2b6e4f7249c45140c9e3100bdc1bb5ee2b4
2 # Copyright (c) 2012-2016 Red Hat.
3 # Copyright (c) 2000,2003 Silicon Graphics, Inc. All Rights Reserved.
4 #
5 # This program is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by the
7 # Free Software Foundation; either version 2 of the License, or (at your
8 # option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 # for more details.
16 ifneq (,)
17 This makefile requires GNU Make.
18 endif
20 TOPDIR = .
21 -include $(TOPDIR)/src/include/builddefs
22 -include ./GNUlocaldefs
24 CONFIGURE_GENERATED = pcp.lsm \
25 $(TOPDIR)/src/include/builddefs \
26 $(TOPDIR)/src/include/pcp/platform_defs.h
28 LICFILES = COPYING
29 DOCFILES = README.md INSTALL.md CHANGELOG VERSION.pcp
30 CONFFILES = pcp.lsm
31 LDIRT = config.cache config.status config.log files.rpm pro_files.rpm \
32 autom4te.cache install.manifest install_pro.manifest \
33 debug*.list devel_files libs_files conf_files \
34 base_files.rpm libs_files.rpm devel_files.rpm \
35 perl-pcp*.list* python-pcp*.list* python3-pcp*.list*
36 LDIRDIRT = pcp-[0-9]*.[0-9]*.[0-9]* pcp-*-[0-9]*.[0-9]*.[0-9]*
38 SUBDIRS = src
39 ifneq ($(TARGET_OS),mingw)
40 SUBDIRS += qa
41 endif
42 SUBDIRS += man books images build debian
44 default :: default_pcp
46 pcp : default_pcp
48 default_pcp : $(CONFIGURE_GENERATED)
49 +for d in `echo $(SUBDIRS)`; do \
50 if test -d "$$d" ; then \
51 echo === $$d ===; \
52 $(MAKE) -C $$d $@ || exit $$?; \
53 fi; \
54 done
56 install :: default_pcp install_pcp
58 pack_pcp : default_pcp
59 $(MAKE) -C build $@
61 install_pcp : default_pcp
62 # install the common directories _once_
63 $(INSTALL) -m 755 -d $(PCP_VAR_DIR)
64 $(INSTALL) -m 755 -d $(PCP_SHARE_DIR)
65 ifneq "$(findstring $(TARGET_OS),darwin mingw)" ""
66 $(INSTALL) -m 755 -d $(PCP_RC_DIR)
67 $(INSTALL) -m 755 -d $(PCP_SASLCONF_DIR)
68 $(INSTALL) -m 755 -d $(PCP_BIN_DIR)
69 $(INSTALL) -m 755 -d $(PCP_LIB_DIR)
70 $(INSTALL) -m 755 -d $(PCP_LIB_DIR)/pkgconfig
71 $(INSTALL) -m 755 -d $(PCP_MAN_DIR)
72 $(INSTALL) -m 755 -d $(PCP_MAN_DIR)/man1
73 $(INSTALL) -m 755 -d $(PCP_MAN_DIR)/man3
74 $(INSTALL) -m 755 -d $(PCP_MAN_DIR)/man5
75 endif
76 ifneq "$(findstring $(TARGET_OS), mingw)" ""
77 $(INSTALL) -m 1777 -d $(PCP_TMPFILE_DIR)
78 endif
79 $(INSTALL) -m 775 -o $(PCP_USER) -g $(PCP_GROUP) -d $(PCP_TMP_DIR)
80 ifeq "$(findstring $(PACKAGE_DISTRIBUTION), debian)" ""
81 # $PCP_RUN_DIR usually -> /var/run which may be a temporary filesystem
82 # and Debian's lintian complains about packages including /var/run/xxx
83 # artifacts ... $PCP_RUN_DIR is also conditionally created on the
84 # fly in each before use case, so the inclusion in the package is
85 # sometimes desirable, but not mandatory
87 $(INSTALL) -m 775 -o $(PCP_USER) -g $(PCP_GROUP) -d $(PCP_RUN_DIR)
88 endif
89 $(INSTALL) -m 755 -d $(PCP_SYSCONFIG_DIR)
90 $(INSTALL) -m 755 -d $(PCP_SYSCONF_DIR)
91 $(INSTALL) -m 755 -d $(PCP_BINADM_DIR)
92 $(INSTALL) -m 755 -d $(PCP_SHARE_DIR)/lib
93 $(INSTALL) -m 755 -d $(PCP_SHARE_DIR)/examples
94 $(INSTALL) -m 755 -d $(PCP_INC_DIR)
95 $(INSTALL) -m 755 -d $(PCP_VAR_DIR)/config
96 $(INSTALL) -m 755 -d $(PCP_VAR_DIR)/config/pmchart
97 $(INSTALL) -m 755 -d $(PCP_VAR_DIR)/config/pmieconf
98 $(INSTALL) -m 755 -d $(PCP_VAR_DIR)/config/pmlogconf
99 $(INSTALL) -m 775 -o $(PCP_USER) -g $(PCP_GROUP) -d $(PCP_VAR_DIR)/config/pmda
100 $(INSTALL) -m 775 -o $(PCP_USER) -g $(PCP_GROUP) -d $(PCP_LOG_DIR)
101 $(INSTALL) -m 775 -o $(PCP_USER) -g $(PCP_GROUP) -d $(PCP_NSSDB_DIR)
102 $(INSTALL) -m 755 -d $(PCP_VAR_DIR)/pmns
103 $(INSTALL) -m 755 -d $(PCP_PMDAS_DIR)
104 $(INSTALL) -m 755 -d $(PCP_DOC_DIR)
105 $(INSTALL) -m 755 -d $(PCP_DEMOS_DIR)
107 @for d in `echo $(SUBDIRS)`; do \
108 if test -d "$$d" ; then \
109 echo === $$d ===; \
110 $(MAKE) -C $$d $@ || exit $$?; \
111 fi; \
112 done
113 ifneq "$(PACKAGE_DISTRIBUTION)" "debian"
114 $(INSTALL) -m 644 $(LICFILES) $(PCP_DOC_DIR)/$(LICFILES)
115 endif
116 $(INSTALL) -m 644 pcp.lsm $(DOCFILES) $(PCP_DOC_DIR)
117 $(INSTALL) -m 755 install-sh $(PCP_BINADM_DIR)/install-sh
119 ifdef BUILDRULES
120 include $(BUILDRULES)
121 else
122 # if src/include/builddefs doesn't exist, we are pristine (hence also clean)
123 realclean distclean clean clobber:
124 @true
125 endif
127 check :: check_pcp
129 check_pcp : src
130 $(SUBDIRS_MAKERULE)
133 aclocal.m4:
134 # older aclocal(1) versions use --acdir but not the current versions
135 aclocal --system-acdir=`pwd`/m4 --output=$@
137 pcp.lsm src/include/builddefs src/include/pcp/platform_defs.h: configure pcp.lsm.in src/include/builddefs.in src/include/pcp/platform_defs.h.in
138 @echo Please run ./configure with the appropriate options to generate $@.
139 @false