Tizen 2.1 base
[external/device-mapper.git] / daemons / clvmd / Makefile.in
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
14 srcdir = @srcdir@
15 top_srcdir = @top_srcdir@
16 top_builddir = @top_builddir@
17
18 CCS_LIBS = @CCS_LIBS@
19 CCS_CFLAGS = @CCS_CFLAGS@
20 CMAN_LIBS = @CMAN_LIBS@
21 CMAN_CFLAGS = @CMAN_CFLAGS@
22 CONFDB_LIBS = @CONFDB_LIBS@
23 CONFDB_CFLAGS = @CONFDB_CFLAGS@
24 CPG_LIBS = @CPG_LIBS@
25 CPG_CFLAGS = @CPG_CFLAGS@
26 DLM_LIBS = @DLM_LIBS@
27 DLM_CFLAGS = @DLM_CFLAGS@
28 GULM_LIBS = @GULM_LIBS@
29 GULM_CFLAGS = @GULM_CFLAGS@
30 QUORUM_LIBS = @QUORUM_LIBS@
31 QUORUM_CFLAGS = @QUORUM_CFLAGS@
32 SALCK_LIBS = @SALCK_LIBS@
33 SALCK_CFLAGS = @SALCK_CFLAGS@
34
35 SOURCES = \
36         clvmd-command.c  \
37         clvmd.c          \
38         lvm-functions.c  \
39         refresh_clvmd.c
40
41 ifeq ("@DEBUG@", "yes")
42         DEFS += -DDEBUG
43 endif
44
45 ifneq (,$(findstring gulm,, "@CLVMD@,"))
46         SOURCES += clvmd-gulm.c tcp-comms.c
47         LMLIBS += $(CCS_LIBS) $(GULM_LIBS)
48         CFLAGS += $(CCS_CFLAGS) $(GULM_CFLAGS)
49         DEFS += -DUSE_GULM
50 endif
51
52 ifneq (,$(findstring cman,, "@CLVMD@,"))
53         SOURCES += clvmd-cman.c
54         LMLIBS += $(CMAN_LIBS) $(CONFDB_LIBS) $(DLM_LIBS)
55         CFLAGS += $(CMAN_CFLAGS) $(CONFDB_CFLAGS) $(DLM_CFLAGS)
56         DEFS += -DUSE_CMAN
57 endif
58
59 ifneq (,$(findstring openais,, "@CLVMD@,"))
60         SOURCES += clvmd-openais.c
61         LMLIBS += $(CONFDB_LIBS) $(CPG_LIBS) $(SALCK_LIBS)
62         CFLAGS += $(CONFDB_CFLAGS) $(CPG_CFLAGS) $(SALCK_CFLAGS)
63         DEFS += -DUSE_OPENAIS
64 endif
65
66 ifneq (,$(findstring corosync,, "@CLVMD@,"))
67         SOURCES += clvmd-corosync.c
68         LMLIBS += $(CONFDB_LIBS) $(CPG_LIBS) $(DLM_LIBS) $(QUORUM_LIBS)
69         CFLAGS += $(CONFDB_CFLAGS) $(CPG_CFLAGS) $(DLM_CFLAGS) $(QUORUM_CFLAGS)
70         DEFS += -DUSE_COROSYNC
71 endif
72
73 ifneq (,$(findstring singlenode,, "@CLVMD@,"))
74         SOURCES += clvmd-singlenode.c
75         DEFS += -DUSE_SINGLENODE
76 endif
77
78 ifeq ($(MAKECMDGOALS),distclean)
79         SOURCES += clvmd-gulm.c tcp-comms.c
80         SOURCES += clvmd-cman.c
81         SOURCES += clvmd-openais.c
82         SOURCES += clvmd-corosync.c
83         SOURCES += clvmd-singlenode.c
84 endif
85
86 TARGETS = \
87         clvmd
88
89 LVMLIBS = $(LVMINTERNAL_LIBS)
90
91 ifeq ("@DMEVENTD@", "yes")
92         LVMLIBS += -ldevmapper-event
93 endif
94  
95 include $(top_builddir)/make.tmpl
96
97 LVMLIBS += -ldevmapper
98 LIBS += $(PTHREAD_LIBS)
99
100 DEFS += -D_REENTRANT
101 CFLAGS += -fno-strict-aliasing
102
103 INSTALL_TARGETS = \
104         install_clvmd
105
106 clvmd: $(OBJECTS) $(top_builddir)/lib/liblvm-internal.a
107         $(CC) $(CFLAGS) $(LDFLAGS) -o clvmd $(OBJECTS) \
108                 $(LVMLIBS) $(LMLIBS) $(LIBS)
109
110 .PHONY: install_clvmd
111
112 install_clvmd: $(TARGETS)
113         $(INSTALL_PROGRAM) -D clvmd $(usrsbindir)/clvmd
114
115 install: $(INSTALL_TARGETS)
116
117 install_cluster: $(INSTALL_TARGETS)