1#
2# Pacemaker code
3#
4# Copyright (C) 2004 Andrew Beekhof
5#
6# This program is free software; you can redistribute it and/or
7# modify it under the terms of the GNU General Public License
8# as published by the Free Software Foundation; either version 2
9# of the License, or (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19#
20
21EXTRA_DIST		= CONTRIBUTING.md	\
22			  GNUmakefile		\
23			  INSTALL.md		\
24			  README.markdown	\
25			  autogen.sh		\
26			  m4/gnulib-cache.m4	\
27			  m4/gnulib-tool.m4	\
28			  rpm/rpmlintrc		\
29			  rpm/pacemaker.spec.in
30
31DISTCLEANFILES		= config.status
32
33MAINTAINERCLEANFILES	= Makefile.in		\
34			  aclocal.m4		\
35			  config.guess		\
36			  config.sub		\
37			  configure		\
38			  depcomp		\
39			  install-sh		\
40			  ltmain.sh		\
41			  missing		\
42			  py-compile		\
43			  test-driver
44
45# Disable building Publican documentation when doing "make distcheck", because
46# some of our book sources are in the source directory, while others are
47# dynamically generated in the build directory, and publican can't handle that.
48#
49# In a non-VPATH build, doc isn't entered with a plain "make" because the
50# GNUmakefile sets "core" as the default target. However in a VPATH build,
51# there is no GNUmakefile, so "all" becomes the default target.
52#
53# Also, don't try to install files outside the build directory.
54#
55# @TODO To support VPATH builds for Publican, we could use the same "copy all
56# static inputs into the build tree" trick that xml/Makefile.am uses for
57# static schema files.
58AM_DISTCHECK_CONFIGURE_FLAGS	= --with-brand=""					\
59				  --prefix="$$dc_install_base/usr"			\
60				  --sysconfdir="$$dc_install_base/etc"			\
61				  --with-initdir="$$dc_install_base/etc/init.d"		\
62				  --with-ocfdir="$$dc_install_base/usr/lib/ocf"		\
63				  --with-systemdsystemunitdir="$$dc_install_base$(systemdsystemunitdir)"
64
65CORE	= replace include lib mcp attrd pengine cib crmd fencing lrmd tools xml
66SUBDIRS	= $(CORE) extra doc
67
68AM_CPPFLAGS		= -I$(top_srcdir)/include
69
70doc_DATA = README.markdown COPYING
71
72ACLOCAL_AMFLAGS  = -I m4
73
74licensedir              = $(docdir)/licenses/
75dist_license_DATA	= $(wildcard licenses/*)
76
77# Test components
78SUBDIRS	+= cts
79
80testdir			= $(datadir)/$(PACKAGE)/tests/
81test_SCRIPTS		= coverage.sh
82dist_test_SCRIPTS	= BasicSanity.sh
83dist_test_DATA		= valgrind-pcmk.suppressions
84
85EXTRA_SCRIPTS		= abi-check bumplibs.sh
86
87# Scratch file for ad-hoc testing
88EXTRA_PROGRAMS		= scratch
89nodist_scratch_SOURCES	= scratch.c
90scratch_LDADD		= $(top_builddir)/lib/common/libcrmcommon.la
91
92core:
93	@echo "Building only core components: $(CORE)"
94	@for subdir in $(CORE); do \
95		echo "Building $$subdir"; \
96		$(MAKE) -C $$subdir all || exit 1; \
97	done
98
99core-install:
100	@echo "Installing only core components: $(CORE)"
101	@for subdir in $(CORE); do \
102	    echo "Installing $$subdir"; \
103	    $(MAKE) -C $$subdir install || exit 1; \
104	done
105
106core-clean:
107	@echo "Cleaning only core components: $(CORE)"
108	@for subdir in $(CORE); do \
109		echo "Cleaning $$subdir"; \
110		$(MAKE) -C $$subdir clean || exit 1; \
111	done
112
113install-exec-local:
114if BUILD_CS_PLUGIN
115	$(INSTALL) -d $(DESTDIR)/$(LCRSODIR)
116endif
117	$(INSTALL) -d -m 750 $(DESTDIR)/$(CRM_CONFIG_DIR)
118	$(INSTALL) -d -m 750 $(DESTDIR)/$(CRM_CORE_DIR)
119	$(INSTALL) -d -m 750 $(DESTDIR)/$(CRM_BLACKBOX_DIR)
120	-chown $(CRM_DAEMON_USER):$(CRM_DAEMON_GROUP) $(DESTDIR)/$(CRM_CONFIG_DIR)
121	-chown $(CRM_DAEMON_USER):$(CRM_DAEMON_GROUP) $(DESTDIR)/$(CRM_CORE_DIR)
122	-chown $(CRM_DAEMON_USER):$(CRM_DAEMON_GROUP) $(DESTDIR)/$(CRM_BLACKBOX_DIR)
123if BUILD_CS_PLUGIN
124	rm -f $(DESTDIR)$(LCRSODIR)/pacemaker.lcrso $(DESTDIR)$(LCRSODIR)/service_crm.so
125	cp $(DESTDIR)$(libdir)/service_crm.so $(DESTDIR)$(LCRSODIR)/pacemaker.lcrso
126endif
127# Use chown because the user/group may not exist
128
129clean-generic:
130	-rm -f *.tar.bz2 *.sed
131
132PACKAGE         ?= pacemaker
133
134# In a normal build, this file is included by GNUmakefile, which serves as the
135# "real" makefile. But in a VPATH build, GNUmakefile won't exist in the build
136# tree, and this file will be the "real" makefile. EXTRA_CLEAN_TARGETS handles
137# both cases: GNUmakefile defines it before including this file, so the
138# clean-local target can clean up files created by GNUmakefile targets.
139# If this file is used alone, the variable will be undefined.
140clean-local: $(EXTRA_CLEAN_TARGETS)
141	-rm -f scratch $(builddir)/$(PACKAGE)-*.tar.gz
142
143distclean-local:
144	-rm -rf libltdl autom4te.cache
145