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