f61626c108
Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
202 lines
5.2 KiB
Makefile
202 lines
5.2 KiB
Makefile
###############################################################################
|
|
###############################################################################
|
|
##
|
|
## Copyright (C) 2009 Red Hat, Inc.
|
|
##
|
|
## 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.
|
|
##
|
|
###############################################################################
|
|
###############################################################################
|
|
|
|
include ../Makefile.top
|
|
|
|
#
|
|
# Modular information
|
|
#
|
|
with_modules=@modules@
|
|
|
|
TARGETS=fence_virtd
|
|
|
|
MAIN_LIBS=-L../config -lsimpleconfig -ldl
|
|
AIS_LIBS=-L/usr/lib64/openais -lSaCkpt
|
|
COROSYNC_LIBS=-L/usr/lib64/corosync -lcpg
|
|
PACEMAKER_LIBS=-lcib -lcrmcommon -lpe_status -lplumb \
|
|
`pkg-config --libs ncurses` `pkg-config --libs glib-2.0`
|
|
PACEMAKER_INCLUDES=`pkg-config --cflags glib-2.0` -I/usr/include/pacemaker -I/usr/include/heartbeat
|
|
CMAN_LIBS=-lcman
|
|
VIRT_LIBS=-lvirt
|
|
VIRT_QPID=-lqmf2
|
|
# No longer needed: -lqpidclient -lqpidtypes -lqpidcommon -lqpidmessaging
|
|
NSS_LIBS=-lnss3
|
|
XML_LIBS=`xml2-config --libs`
|
|
INCLUDES=-I../include `nss-config --cflags` `nspr-config --cflags` `xml2-config --cflags`
|
|
|
|
LIBS+=-L../common -lfence_virt -Wl,-wrap,syslog,-wrap,closelog -lpthread -luuid
|
|
|
|
MODULE_PATH=${libdir}/${PACKAGE_NAME}
|
|
|
|
#
|
|
# Module sources
|
|
#
|
|
fence_virtd_SOURCES = main.c plugin.c config.c static_map.c uuid-test.c \
|
|
daemon_init.c
|
|
libvirt_so_SOURCES = libvirt.c virt.c uuid-test.c
|
|
null_so_SOURCES = null.c
|
|
libvirt_qmf_so_SOURCES = uuid-test.c
|
|
libvirt_qmf_cxx_so_SOURCES = libvirt-qmf.cpp
|
|
pm_fence_so_SOURCES = pm-fence.c
|
|
multicast_so_SOURCES = mcast.c history.c
|
|
tcp_so_SOURCES = tcp.c history.c
|
|
checkpoint_so_SOURCES = virt.c vm_states.c history.c checkpoint.c cpg.c
|
|
serial_so_SOURCES = virt-serial.c virt-sockets.c serial.c history.c
|
|
|
|
|
|
################################
|
|
# Generated by configure
|
|
################################
|
|
|
|
mod_null=@mod_null@
|
|
mod_libvirt=@mod_libvirt@
|
|
mod_checkpoint=@mod_checkpoint@
|
|
mod_libvirt_qmf=@mod_libvirt_qmf@
|
|
mod_pm_fence=@mod_pm_fence@
|
|
mod_multicast=@mod_multicast@
|
|
mod_serial=@mod_serial@
|
|
mod_tcp=@mod_tcp@
|
|
|
|
################################
|
|
ifeq ($(with_modules),yes)
|
|
|
|
#################
|
|
# Modular build #
|
|
#################
|
|
CFLAGS+=-D_MODULE -DMODULE_PATH=\"${MODULE_PATH}\"
|
|
MODULES=
|
|
ifneq ($(mod_libvirt),no)
|
|
MODULES+=libvirt.so
|
|
endif
|
|
ifneq ($(mod_checkpoint),no)
|
|
MODULES+=checkpoint.so
|
|
endif
|
|
ifneq ($(mod_libvirt_qmf),no)
|
|
MODULES+=libvirt-qmf.so
|
|
endif
|
|
ifneq ($(mod_pm_fence),no)
|
|
INCLUDES+=$(PACEMAKER_INCLUDES)
|
|
MODULES+=pm-fence.so
|
|
endif
|
|
ifneq ($(mod_multicast),no)
|
|
MODULES+=multicast.so
|
|
endif
|
|
ifneq ($(mod_serial),no)
|
|
MODULES+=serial.so
|
|
endif
|
|
ifneq ($(mod_tcp),no)
|
|
MODULES+=tcp.so
|
|
endif
|
|
ifneq ($(mod_null),no)
|
|
MODULES+=null.so
|
|
endif
|
|
|
|
|
|
else
|
|
|
|
####################
|
|
# Monolithic build #
|
|
####################
|
|
ifneq ($(mod_libvirt),no)
|
|
fence_virtd_SOURCES+=${libvirt_so_SOURCES}
|
|
LIBS+=$(VIRT_LIBS) $(UUID_LIBS)
|
|
endif
|
|
ifneq ($(mod_checkpoint),no)
|
|
fence_virtd_SOURCES+=${checkpoint_so_SOURCES}
|
|
LIBS+=$(AIS_LIBS) $(COROSYNC_LIBS) $(CMAN_LIBS)
|
|
endif
|
|
ifneq ($(mod_libvirt_qmf),no)
|
|
fence_virtd_SOURCES+=${libvirt_qmf_so_SOURCES}
|
|
fence_virtd_cxx_SOURCES+=${libvirt_qmf_cxx_so_SOURCES}
|
|
LIBS+=$(VIRT_QPID)
|
|
endif
|
|
ifneq ($(mod_pm_fence),no)
|
|
fence_virtd_SOURCES+=${pm_fence_so_SOURCES}
|
|
INCLUDES+=$(PACEMAKER_INCLUDES)
|
|
LIBS+=$(PACEMAKER_LIBS)
|
|
endif
|
|
ifneq ($(mod_multicast),no)
|
|
fence_virtd_SOURCES+=${multicast_so_SOURCES}
|
|
LIBS+=$(NSS_LIBS)
|
|
endif
|
|
ifneq ($(mod_serial),no)
|
|
fence_virtd_SOURCES+=${serial_so_SOURCES}
|
|
LIBS+=$(NSS_LIBS) $(XML_LIBS)
|
|
endif
|
|
ifneq ($(mod_tcp),no)
|
|
fence_virtd_SOURCES+=${tcp_so_SOURCES}
|
|
LIBS+=$(NSS_LIBS)
|
|
endif
|
|
ifneq ($(mod_null),no)
|
|
fence_virtd_SOURCES+=${null_so_SOURCES}
|
|
endif
|
|
|
|
endif
|
|
|
|
CFLAGS+=-DSYSCONFDIR=\"@sysconfdir@\"
|
|
|
|
pm_ver=@pm_ver@
|
|
ifeq ($(pm_ver),1.0)
|
|
CFLAGS+=-DPM_1_0
|
|
endif
|
|
|
|
all: ${TARGETS} ${MODULES}
|
|
|
|
fence_virtd: ${fence_virtd_SOURCES:.c=.o} ${fence_virtd_cxx_SOURCES:.cpp=.opp}
|
|
$(CXX) -o $@ $^ $(MAIN_LIBS) $(LIBS)
|
|
|
|
multicast.so: ${multicast_so_SOURCES:.c=.o}
|
|
$(CC) -o $@ $^ $(LIBS) -shared $(NSS_LIBS)
|
|
|
|
libvirt.so: ${libvirt_so_SOURCES:.c=.o}
|
|
$(CC) -o $@ $^ $(LIBS) -shared $(VIRT_LIBS) $(UUID_LIBS)
|
|
|
|
libvirt-qmf.so: ${libvirt_qmf_so_SOURCES:.c=.o} ${libvirt_qmf_cxx_so_SOURCES:.cpp=.opp}
|
|
$(CXX) -o $@ $^ $(LIBS) -shared $(VIRT_QPID)
|
|
|
|
pm-fence.so: ${pm_fence_so_SOURCES:.c=.o}
|
|
$(CC) -o $@ $^ $(LIBS) -shared $(PACEMAKER_LIBS)
|
|
|
|
null.so: ${null_so_SOURCES:.c=.o}
|
|
$(CC) -o $@ $^ $(LIBS) -shared
|
|
|
|
checkpoint.so: ${checkpoint_so_SOURCES:.c=.o}
|
|
$(CC) -o $@ $^ $(LIBS) -shared $(AIS_LIBS) $(VIRT_LIBS) \
|
|
$(COROSYNC_LIBS) $(CMAN_LIBS)
|
|
|
|
serial.so: ${serial_so_SOURCES:.c=.o}
|
|
$(CC) -o $@ $^ $(LIBS) -shared $(VIRT_LIBS) $(UUID_LIBS) $(XML_LIBS)
|
|
|
|
tcp.so: ${tcp_so_SOURCES:.c=.o}
|
|
$(CC) -o $@ $^ $(LIBS) -shared $(NSS_LIBS)
|
|
|
|
%.o: %.c
|
|
$(CC) $(CFLAGS) -c -o $@ $^ $(INCLUDES)
|
|
|
|
%.opp: %.cpp
|
|
$(CXX) $(CFLAGS) -c -o $@ $^ $(INCLUDES)
|
|
|
|
install: all
|
|
if [ ! -d ${DESTDIR}/${sbindir} ]; then \
|
|
install -d ${DESTDIR}/${sbindir} ; \
|
|
fi
|
|
install -m755 ${TARGETS} ${DESTDIR}/${sbindir}
|
|
ifeq ($(with_modules),yes)
|
|
if [ ! -d ${DESTDIR}/${MODULE_PATH} ]; then \
|
|
install -d ${DESTDIR}/${MODULE_PATH} ; \
|
|
fi
|
|
install -m755 ${MODULES} ${DESTDIR}/${MODULE_PATH}
|
|
endif
|
|
|
|
clean:
|
|
rm -f ${TARGETS} ${MODULES} *.o *.d *~ *.opp
|