2009-07-28 18:46:53 +04:00
###############################################################################
###############################################################################
##
2009-09-23 20:04:32 +04:00
## Copyright (C) 2009 Red Hat, Inc.
2009-07-28 18:46:53 +04:00
##
## This copyrighted material is made available to anyone wishing to use,
## modify, copy, or redistribute it subject to the terms and conditions
## of the GNU General Public License v.2.
##
###############################################################################
###############################################################################
2009-08-17 17:58:06 +04:00
i n c l u d e . . / M a k e f i l e . t o p
2009-07-28 18:46:53 +04:00
2009-09-15 23:17:14 +04:00
#
# Modular information
#
with_modules = @modules@
2009-07-28 18:46:53 +04:00
2009-08-21 22:05:48 +04:00
TARGETS = fence_virtd
2009-09-15 23:17:14 +04:00
MAIN_LIBS = -L../config -lsimpleconfig -ldl
2009-11-05 22:01:35 +03:00
COROSYNC_LIBS = -L/usr/lib64/corosync -lcpg
2012-02-07 19:54:53 +04:00
PACEMAKER_LIBS = -lcib -lcrmcommon -lpe_status -lplumb \
` pkg-config --libs ncurses` ` pkg-config --libs glib-2.0`
2011-11-15 18:54:52 +04:00
PACEMAKER_INCLUDES = ` pkg-config --cflags glib-2.0` -I/usr/include/pacemaker -I/usr/include/heartbeat
2009-11-05 22:01:35 +03:00
CMAN_LIBS = -lcman
2009-09-15 23:17:14 +04:00
VIRT_LIBS = -lvirt
2012-03-27 01:12:49 +04:00
VIRT_QPID = -lqmf2
# No longer needed: -lqpidclient -lqpidtypes -lqpidcommon -lqpidmessaging
2009-09-15 23:17:14 +04:00
NSS_LIBS = -lnss3
2010-12-08 21:52:42 +03:00
XML_LIBS = ` xml2-config --libs`
2010-01-11 18:17:24 +03:00
INCLUDES = -I../include ` nss-config --cflags` ` nspr-config --cflags` ` xml2-config --cflags`
2009-09-15 23:17:14 +04:00
2010-01-14 23:00:43 +03:00
LIBS += -L../common -lfence_virt -Wl,-wrap,syslog,-wrap,closelog -lpthread -luuid
2009-08-21 22:05:48 +04:00
2009-09-15 23:17:14 +04:00
MODULE_PATH = ${ libdir } /${ PACKAGE_NAME }
2009-08-17 17:58:06 +04:00
2009-09-15 23:17:14 +04:00
#
# Module sources
#
2010-01-15 02:45:47 +03:00
fence_virtd_SOURCES = main.c plugin.c config.c static_map.c uuid-test.c \
daemon_init.c
2009-12-08 02:11:25 +03:00
libvirt_so_SOURCES = libvirt.c virt.c uuid-test.c
2009-09-02 03:11:15 +04:00
null_so_SOURCES = null.c
2011-11-15 18:54:52 +04:00
libvirt_qmf_so_SOURCES = uuid-test.c
libvirt_qmf_cxx_so_SOURCES = libvirt-qmf.cpp
pm_fence_so_SOURCES = pm-fence.c
2017-05-28 04:19:41 +03:00
cpg_so_SOURCES = cpg-virt.c cpg.c virt.c history.c uuid-test.c
2009-09-14 23:06:38 +04:00
multicast_so_SOURCES = mcast.c history.c
2012-06-01 23:22:02 +04:00
tcp_so_SOURCES = tcp.c history.c
2010-01-14 21:38:37 +03:00
serial_so_SOURCES = virt-serial.c virt-sockets.c serial.c history.c
2009-08-20 23:03:41 +04:00
2009-07-28 18:46:53 +04:00
2009-09-15 23:17:14 +04:00
################################
2012-02-07 19:54:53 +04:00
# Generated by configure
################################
2009-09-15 23:17:14 +04:00
mod_null = @mod_null@
mod_libvirt = @mod_libvirt@
2011-11-15 18:54:52 +04:00
mod_libvirt_qmf = @mod_libvirt_qmf@
mod_pm_fence = @mod_pm_fence@
2017-05-28 04:19:41 +03:00
mod_cpg = @mod_cpg@
2009-09-15 23:17:14 +04:00
mod_multicast = @mod_multicast@
2010-01-13 10:24:19 +03:00
mod_serial = @mod_serial@
2012-06-01 23:22:02 +04:00
mod_tcp = @mod_tcp@
2009-09-15 23:17:14 +04:00
2012-02-07 19:54:53 +04:00
################################
i f e q ( $( with_modules ) , y e s )
2009-09-15 23:17:14 +04:00
#################
# Modular build #
#################
CFLAGS += -D_MODULE -DMODULE_PATH= \" ${ MODULE_PATH } \"
MODULES =
i f n e q ( $( mod_libvirt ) , n o )
MODULES += libvirt.so
e n d i f
2011-11-15 18:54:52 +04:00
i f n e q ( $( mod_libvirt_qmf ) , n o )
MODULES += libvirt-qmf.so
e n d i f
i f n e q ( $( mod_pm_fence ) , n o )
2012-02-07 19:47:12 +04:00
INCLUDES += $( PACEMAKER_INCLUDES)
2011-11-15 18:54:52 +04:00
MODULES += pm-fence.so
2009-11-05 20:53:55 +03:00
e n d i f
2017-05-28 04:19:41 +03:00
i f n e q ( $( mod_cpg ) , n o )
MODULES += cpg.so
e n d i f
2009-09-15 23:17:14 +04:00
i f n e q ( $( mod_multicast ) , n o )
MODULES += multicast.so
e n d i f
2010-01-11 18:17:24 +03:00
i f n e q ( $( mod_serial ) , n o )
MODULES += serial.so
e n d i f
2012-06-01 23:22:02 +04:00
i f n e q ( $( mod_tcp ) , n o )
MODULES += tcp.so
e n d i f
2009-09-15 23:17:14 +04:00
i f n e q ( $( mod_null ) , n o )
MODULES += null.so
e n d i f
e l s e
####################
# Monolithic build #
####################
i f n e q ( $( mod_libvirt ) , n o )
fence_virtd_SOURCES += ${ libvirt_so_SOURCES }
2009-12-08 02:11:25 +03:00
LIBS += $( VIRT_LIBS) $( UUID_LIBS)
2009-09-15 23:17:14 +04:00
e n d i f
2011-11-15 18:54:52 +04:00
i f n e q ( $( mod_libvirt_qmf ) , n o )
fence_virtd_SOURCES += ${ libvirt_qmf_so_SOURCES }
fence_virtd_cxx_SOURCES += ${ libvirt_qmf_cxx_so_SOURCES }
2009-11-05 22:01:35 +03:00
LIBS += $( VIRT_QPID)
2009-09-15 23:17:14 +04:00
e n d i f
2011-11-15 18:54:52 +04:00
i f n e q ( $( mod_pm_fence ) , n o )
fence_virtd_SOURCES += ${ pm_fence_so_SOURCES }
INCLUDES += $( PACEMAKER_INCLUDES)
LIBS += $( PACEMAKER_LIBS)
e n d i f
2017-05-28 04:19:41 +03:00
i f n e q ( $( mod_cpg ) , n o )
fence_virtd_SOURCES += ${ cpg_so_SOURCES }
e n d i f
2009-09-15 23:17:14 +04:00
i f n e q ( $( mod_multicast ) , n o )
fence_virtd_SOURCES += ${ multicast_so_SOURCES }
2012-02-07 19:54:53 +04:00
LIBS += $( NSS_LIBS)
2009-09-15 23:17:14 +04:00
e n d i f
2010-01-11 18:17:24 +03:00
i f n e q ( $( mod_serial ) , n o )
fence_virtd_SOURCES += ${ serial_so_SOURCES }
2012-02-07 19:54:53 +04:00
LIBS += $( NSS_LIBS) $( XML_LIBS)
2010-01-11 18:17:24 +03:00
e n d i f
2012-06-01 23:22:02 +04:00
i f n e q ( $( mod_tcp ) , n o )
fence_virtd_SOURCES += ${ tcp_so_SOURCES }
LIBS += $( NSS_LIBS)
e n d i f
2009-09-15 23:17:14 +04:00
i f n e q ( $( mod_null ) , n o )
fence_virtd_SOURCES += ${ null_so_SOURCES }
e n d i f
e n d i f
CFLAGS += -DSYSCONFDIR= \" @sysconfdir@\"
2009-07-28 18:46:53 +04:00
2011-11-15 18:54:52 +04:00
pm_ver = @pm_ver@
i f e q ( $( pm_ver ) , 1 . 0 )
CFLAGS += -DPM_1_0
e n d i f
2009-08-21 22:05:48 +04:00
all : ${TARGETS } ${MODULES }
2009-07-28 18:46:53 +04:00
2009-11-05 22:01:35 +03:00
fence_virtd : ${fence_virtd_SOURCES :.c =.o } ${fence_virtd_cxx_SOURCES :.cpp =.opp }
$( CXX) -o $@ $^ $( MAIN_LIBS) $( LIBS)
2009-07-28 18:46:53 +04:00
2009-09-02 02:54:17 +04:00
multicast.so : ${multicast_so_SOURCES :.c =.o }
2009-09-15 23:17:14 +04:00
$( CC) -o $@ $^ $( LIBS) -shared $( NSS_LIBS)
2009-09-02 02:54:17 +04:00
2009-08-17 17:58:06 +04:00
libvirt.so : ${libvirt_so_SOURCES :.c =.o }
2009-12-08 02:11:25 +03:00
$( CC) -o $@ $^ $( LIBS) -shared $( VIRT_LIBS) $( UUID_LIBS)
2009-08-17 17:58:06 +04:00
2011-11-15 18:54:52 +04:00
libvirt-qmf.so : ${libvirt_qmf_so_SOURCES :.c =.o } ${libvirt_qmf_cxx_so_SOURCES :.cpp =.opp }
2009-11-05 22:01:35 +03:00
$( CXX) -o $@ $^ $( LIBS) -shared $( VIRT_QPID)
2009-11-05 20:53:55 +03:00
2011-11-15 18:54:52 +04:00
pm-fence.so : ${pm_fence_so_SOURCES :.c =.o }
$( CC) -o $@ $^ $( LIBS) -shared $( PACEMAKER_LIBS)
2017-05-28 04:19:41 +03:00
cpg.so : ${cpg_so_SOURCES :.c =.o }
$( CC) -o $@ $^ $( LIBS) -shared $( VIRT_LIBS) $( UUID_LIBS) $( XML_LIBS) $( COROSYNC_LIBS)
2009-09-02 03:11:15 +04:00
null.so : ${null_so_SOURCES :.c =.o }
2009-09-15 23:17:14 +04:00
$( CC) -o $@ $^ $( LIBS) -shared
2009-09-02 03:11:15 +04:00
2010-01-11 18:17:24 +03:00
serial.so : ${serial_so_SOURCES :.c =.o }
2010-12-08 21:52:42 +03:00
$( CC) -o $@ $^ $( LIBS) -shared $( VIRT_LIBS) $( UUID_LIBS) $( XML_LIBS)
2010-01-11 18:17:24 +03:00
2012-06-01 23:22:02 +04:00
tcp.so : ${tcp_so_SOURCES :.c =.o }
$( CC) -o $@ $^ $( LIBS) -shared $( NSS_LIBS)
2009-07-28 18:46:53 +04:00
%.o : %.c
2009-09-15 23:17:14 +04:00
$( CC) $( CFLAGS) -c -o $@ $^ $( INCLUDES)
2009-07-28 18:46:53 +04:00
2009-11-05 20:53:55 +03:00
%.opp : %.cpp
2009-11-05 20:59:26 +03:00
$( CXX) $( CFLAGS) -c -o $@ $^ $( INCLUDES)
2009-11-05 20:53:55 +03:00
2009-07-28 18:46:53 +04:00
install : all
2009-09-17 23:16:24 +04:00
if [ ! -d ${ DESTDIR } /${ sbindir } ] ; then \
install -d ${ DESTDIR } /${ sbindir } ; \
2009-07-28 18:46:53 +04:00
fi
2009-09-17 23:16:24 +04:00
install -m755 ${ TARGETS } ${ DESTDIR } /${ sbindir }
2009-09-15 23:17:14 +04:00
i f e q ( $( with_modules ) , y e s )
2009-09-17 23:16:24 +04:00
if [ ! -d ${ DESTDIR } /${ MODULE_PATH } ] ; then \
install -d ${ DESTDIR } /${ MODULE_PATH } ; \
2009-08-21 22:12:58 +04:00
fi
2009-09-17 23:16:24 +04:00
install -m755 ${ MODULES } ${ DESTDIR } /${ MODULE_PATH }
2009-09-15 23:17:14 +04:00
e n d i f
2009-07-28 18:46:53 +04:00
clean :
2009-11-05 21:02:12 +03:00
rm -f ${ TARGETS } ${ MODULES } *.o *.d *~ *.opp