1#
2# Copyright (C) 2004 Red Hat, Inc. All rights reserved.
3#
4# This file is part of LVM2.
5#
6# This copyrighted material is made available to anyone wishing to use,
7# modify, copy, or redistribute it subject to the terms and conditions
8# of the GNU General Public License v.2.
9#
10# You should have received a copy of the GNU General Public License
11# along with this program; if not, write to the Free Software Foundation,
12# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
13
14srcdir = @srcdir@
15top_srcdir = @top_srcdir@
16top_builddir = @top_builddir@
17VPATH = @srcdir@
18
19CCS_LIBS = @CCS_LIBS@
20CCS_CFLAGS = @CCS_CFLAGS@
21CMAN_LIBS = @CMAN_LIBS@
22CMAN_CFLAGS = @CMAN_CFLAGS@
23CONFDB_LIBS = @CONFDB_LIBS@
24CONFDB_CFLAGS = @CONFDB_CFLAGS@
25CPG_LIBS = @CPG_LIBS@
26CPG_CFLAGS = @CPG_CFLAGS@
27DLM_LIBS = @DLM_LIBS@
28DLM_CFLAGS = @DLM_CFLAGS@
29GULM_LIBS = @GULM_LIBS@
30GULM_CFLAGS = @GULM_CFLAGS@
31QUORUM_LIBS = @QUORUM_LIBS@
32QUORUM_CFLAGS = @QUORUM_CFLAGS@
33SALCK_LIBS = @SALCK_LIBS@
34SALCK_CFLAGS = @SALCK_CFLAGS@
35
36SOURCES = \
37	clvmd-command.c  \
38	clvmd.c          \
39	lvm-functions.c  \
40	refresh_clvmd.c
41
42ifeq ("@DEBUG@", "yes")
43	DEFS += -DDEBUG
44endif
45
46ifneq (,$(findstring gulm,, "@CLVMD@,"))
47	SOURCES += clvmd-gulm.c tcp-comms.c
48	LMLIBS += $(CCS_LIBS) $(GULM_LIBS)
49	CFLAGS += $(CCS_CFLAGS) $(GULM_CFLAGS)
50	DEFS += -DUSE_GULM
51endif
52
53ifneq (,$(findstring cman,, "@CLVMD@,"))
54	SOURCES += clvmd-cman.c
55	LMLIBS += $(CMAN_LIBS) $(CONFDB_LIBS) $(DLM_LIBS)
56	CFLAGS += $(CMAN_CFLAGS) $(CONFDB_CFLAGS) $(DLM_CFLAGS)
57	DEFS += -DUSE_CMAN
58endif
59
60ifneq (,$(findstring openais,, "@CLVMD@,"))
61	SOURCES += clvmd-openais.c
62	LMLIBS += $(CONFDB_LIBS) $(CPG_LIBS) $(SALCK_LIBS)
63	CFLAGS += $(CONFDB_CFLAGS) $(CPG_CFLAGS) $(SALCK_CFLAGS)
64	DEFS += -DUSE_OPENAIS
65endif
66
67ifneq (,$(findstring corosync,, "@CLVMD@,"))
68	SOURCES += clvmd-corosync.c
69	LMLIBS += $(CONFDB_LIBS) $(CPG_LIBS) $(DLM_LIBS) $(QUORUM_LIBS)
70	CFLAGS += $(CONFDB_CFLAGS) $(CPG_CFLAGS) $(DLM_CFLAGS) $(QUORUM_CFLAGS)
71	DEFS += -DUSE_COROSYNC
72endif
73
74
75TARGETS = \
76	clvmd
77
78LVMLIBS = -llvm-internal -lpthread
79
80ifeq ("@DMEVENTD@", "yes")
81	LVMLIBS += -ldevmapper-event
82endif
83
84LVMLIBS += -ldevmapper
85
86DEFS += -D_REENTRANT
87CFLAGS += -fno-strict-aliasing
88
89include ../../make.tmpl
90
91INSTALL_TARGETS = \
92	install_clvmd
93
94clvmd: $(OBJECTS) $(top_builddir)/lib/liblvm-internal.a
95	$(CC) $(CFLAGS) $(LDFLAGS) -o clvmd $(OBJECTS) \
96		$(LVMLIBS) $(LMLIBS) $(LIBS)
97
98.PHONY: install_clvmd
99
100install_clvmd: $(TARGETS)
101	$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) clvmd \
102		$(usrsbindir)/clvmd
103
104install: $(INSTALL_TARGETS)
105
106install_cluster: $(INSTALL_TARGETS)
107
108