pmdalinux: header cleanup, move to using pagesize bitshift
[pcp.git] / GNUmakefile
blobf742baad29005829eab6ad0d5735c8bef1ab0c82
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 ifneq "$(findstring $(TARGET_OS), mingw)" ""
76 $(INSTALL) -m 1777 -d $(PCP_TMPFILE_DIR)
77 endif
78 $(INSTALL) -m 775 -o $(PCP_USER) -g $(PCP_GROUP) -d $(PCP_TMP_DIR)
79 ifeq "$(findstring $(PACKAGE_DISTRIBUTION), debian)" ""
80 # $PCP_RUN_DIR usually -> /var/run which may be a temporary filesystem
81 # and Debian's lintian complains about packages including /var/run/xxx
82 # artifacts ... $PCP_RUN_DIR is also conditionally created on the
83 # fly in each before use case, so the inclusion in the package is
84 # sometimes desirable, but not mandatory
86 $(INSTALL) -m 775 -o $(PCP_USER) -g $(PCP_GROUP) -d $(PCP_RUN_DIR)
87 endif
88 $(INSTALL) -m 755 -d $(PCP_SYSCONFIG_DIR)
89 $(INSTALL) -m 755 -d $(PCP_SYSCONF_DIR)
90 $(INSTALL) -m 755 -d $(PCP_BINADM_DIR)
91 $(INSTALL) -m 755 -d $(PCP_SHARE_DIR)/lib
92 $(INSTALL) -m 755 -d $(PCP_SHARE_DIR)/examples
93 $(INSTALL) -m 755 -d $(PCP_INC_DIR)
94 $(INSTALL) -m 755 -d $(PCP_VAR_DIR)/config
95 $(INSTALL) -m 755 -d $(PCP_VAR_DIR)/config/pmchart
96 $(INSTALL) -m 755 -d $(PCP_VAR_DIR)/config/pmieconf
97 $(INSTALL) -m 755 -d $(PCP_VAR_DIR)/config/pmlogconf
98 $(INSTALL) -m 775 -o $(PCP_USER) -g $(PCP_GROUP) -d $(PCP_VAR_DIR)/config/pmda
99 $(INSTALL) -m 775 -o $(PCP_USER) -g $(PCP_GROUP) -d $(PCP_LOG_DIR)
100 $(INSTALL) -m 775 -o $(PCP_USER) -g $(PCP_GROUP) -d $(PCP_NSSDB_DIR)
101 $(INSTALL) -m 755 -d $(PCP_VAR_DIR)/pmns
102 $(INSTALL) -m 755 -d $(PCP_PMDAS_DIR)
103 $(INSTALL) -m 755 -d $(PCP_DOC_DIR)
104 $(INSTALL) -m 755 -d $(PCP_DEMOS_DIR)
106 @for d in `echo $(SUBDIRS)`; do \
107 if test -d "$$d" ; then \
108 echo === $$d ===; \
109 $(MAKE) -C $$d $@ || exit $$?; \
110 fi; \
111 done
112 ifneq "$(PACKAGE_DISTRIBUTION)" "debian"
113 $(INSTALL) -m 644 $(LICFILES) $(PCP_DOC_DIR)/$(LICFILES)
114 endif
115 $(INSTALL) -m 644 pcp.lsm $(DOCFILES) $(PCP_DOC_DIR)
116 $(INSTALL) -m 755 install-sh $(PCP_BINADM_DIR)/install-sh
118 ifdef BUILDRULES
119 include $(BUILDRULES)
120 else
121 # if src/include/builddefs doesn't exist, we are pristine (hence also clean)
122 realclean distclean clean clobber:
123 @true
124 endif
126 check :: check_pcp
128 check_pcp : src
129 $(SUBDIRS_MAKERULE)
132 aclocal.m4:
133 # older aclocal(1) versions use --acdir but not the current versions
134 aclocal --system-acdir=`pwd`/m4 --output=$@
136 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
137 @echo Please run ./configure with the appropriate options to generate $@.
138 @false