fence-virt/server/Makefile.in

131 lines
3.1 KiB
Makefile
Raw Normal View History

###############################################################################
###############################################################################
##
## Copyright (C) 2006 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@
2009-08-21 22:05:48 +04:00
TARGETS=fence_virtd
MAIN_LIBS=-L../config -lsimpleconfig -ldl
AIS_LIBS=-L@libdir@/openais -lSaCkpt
COROSYNC_LIBS=-L@libdir@/corosync -lcpg
VIRT_LIBS=-lvirt
NSS_LIBS=-lnss3
INCLUDES=-I../include `nss-config --cflags` `nspr-config --cflags`
LIBS+=-L../common -lfence_virt -Wl,-wrap,syslog,-wrap,closelog -lpthread
2009-08-21 22:05:48 +04:00
MODULE_PATH=${libdir}/${PACKAGE_NAME}
#
# Module sources
#
fence_virtd_SOURCES = main.c plugin.c
libvirt_so_SOURCES = libvirt.c
null_so_SOURCES = null.c
multicast_so_SOURCES = mcast.c history.c
checkpoint_so_SOURCES = virt.c vm_states.c history.c checkpoint.c cpg.c
################################
ifeq ($(with_modules),yes)
mod_null=@mod_null@
mod_libvirt=@mod_libvirt@
mod_checkpoint=@mod_checkpoint@
mod_multicast=@mod_multicast@
mod_serial=@mod_serial@ # XXX Not done yet
#################
# 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_multicast),no)
MODULES+=multicast.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)
endif
ifneq ($(mod_checkpoint),no)
fence_virtd_SOURCES+=${checkpoint_so_SOURCES}
LIBS+=$(AIS_LIBS) $(COROSYNC_LIBS)
endif
ifneq ($(mod_multicast),no)
fence_virtd_SOURCES+=${multicast_so_SOURCES}
LIBS+=$(AIS_LIBS) $(NSS_LIBS)
endif
ifneq ($(mod_null),no)
fence_virtd_SOURCES+=${null_so_SOURCES}
endif
endif
CFLAGS+=-DSYSCONFDIR=\"@sysconfdir@\"
2009-08-21 22:05:48 +04:00
all: ${TARGETS} ${MODULES}
fence_virtd: ${fence_virtd_SOURCES:.c=.o}
$(CC) -o $@ $^ $(LIBS) $(MAIN_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)
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)
%.o: %.c
$(CC) $(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} ; \
2009-08-21 22:12:58 +04:00
fi
install -m755 ${MODULES} ${DESTDIR}/${MODULE_PATH}
endif
clean:
rm -f ${TARGETS} ${MODULES} *.o *.d *~