Merge branch 'master' of git://git.pcp.io/kenj/pcp into kenj-merge
[pcp.git] / GNUmakefile
blob44b212fa18737feff5d8e72eaddf3b3ec7026a35
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_MAN_DIR)
71 $(INSTALL) -m 755 -d $(PCP_MAN_DIR)/man1
72 $(INSTALL) -m 755 -d $(PCP_MAN_DIR)/man3
73 $(INSTALL) -m 755 -d $(PCP_MAN_DIR)/man5
74 endif
75 $(INSTALL) -m 775 -o $(PCP_USER) -g $(PCP_GROUP) -d $(PCP_TMP_DIR)
76 ifeq "$(findstring $(PACKAGE_DISTRIBUTION), debian redhat fedora)" ""
77 # $PCP_RUN_DIR usually -> /var/run which may be a temporary filesystem
78 # and Debian's lintian complains about packages including /var/run/xxx
79 # artifacts ... $PCP_RUN_DIR is also conditionally created on the
80 # fly in each before use case, so the inclusion in the package is
81 # sometimes desirable, but not mandatory
83 $(INSTALL) -m 775 -o $(PCP_USER) -g $(PCP_GROUP) -d $(PCP_RUN_DIR)
84 endif
85 $(INSTALL) -m 755 -d $(PCP_SYSCONFIG_DIR)
86 $(INSTALL) -m 755 -d $(PCP_SYSCONF_DIR)
87 $(INSTALL) -m 755 -d $(PCP_BINADM_DIR)
88 $(INSTALL) -m 755 -d $(PCP_SHARE_DIR)/lib
89 $(INSTALL) -m 755 -d $(PCP_SHARE_DIR)/examples
90 $(INSTALL) -m 755 -d $(PCP_INC_DIR)
91 $(INSTALL) -m 755 -d $(PCP_VAR_DIR)/config
92 $(INSTALL) -m 755 -d $(PCP_VAR_DIR)/config/pmchart
93 $(INSTALL) -m 755 -d $(PCP_VAR_DIR)/config/pmieconf
94 $(INSTALL) -m 755 -d $(PCP_VAR_DIR)/config/pmlogconf
95 $(INSTALL) -m 775 -o $(PCP_USER) -g $(PCP_GROUP) -d $(PCP_VAR_DIR)/config/pmda
96 $(INSTALL) -m 775 -o $(PCP_USER) -g $(PCP_GROUP) -d $(PCP_LOG_DIR)
97 $(INSTALL) -m 775 -o $(PCP_USER) -g $(PCP_GROUP) -d $(PCP_NSSDB_DIR)
98 $(INSTALL) -m 755 -d $(PCP_VAR_DIR)/pmns
99 $(INSTALL) -m 755 -d $(PCP_PMDAS_DIR)
100 $(INSTALL) -m 755 -d $(PCP_DOC_DIR)
101 $(INSTALL) -m 755 -d $(PCP_DEMOS_DIR)
103 @for d in `echo $(SUBDIRS)`; do \
104 if test -d "$$d" ; then \
105 echo === $$d ===; \
106 $(MAKE) -C $$d $@ || exit $$?; \
107 fi; \
108 done
109 ifneq "$(PACKAGE_DISTRIBUTION)" "debian"
110 $(INSTALL) -m 644 $(LICFILES) $(PCP_DOC_DIR)/$(LICFILES)
111 endif
112 $(INSTALL) -m 644 pcp.lsm $(DOCFILES) $(PCP_DOC_DIR)
113 $(INSTALL) -m 755 install-sh $(PCP_BINADM_DIR)/install-sh
115 ifdef BUILDRULES
116 include $(BUILDRULES)
117 else
118 # if src/include/builddefs doesn't exist, we are pristine (hence also clean)
119 realclean distclean clean clobber:
120 @true
121 endif
123 aclocal.m4:
124 # older aclocal(1) versions use --acdir but not the current versions
125 aclocal --system-acdir=`pwd`/m4 --output=$@
127 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
128 @echo Please run ./configure with the appropriate options to generate $@.
129 @false