2009-07-28 10:46:53 -04:00
###############################################################################
###############################################################################
##
## 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.
##
###############################################################################
###############################################################################
2009-08-17 09: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 10:46:53 -04:00
2009-08-21 14:05:48 -04:00
TARGETS = fence_virtd
2009-09-01 19:11:15 -04:00
MODULES = libvirt.so checkpoint.so multicast.so null.so
2009-08-17 09:58:06 -04:00
2009-09-01 18:54:17 -04:00
fence_virtd_SOURCES = main.c plugin.c
2009-08-17 09:58:06 -04:00
libvirt_so_SOURCES = libvirt.c
2009-09-01 19:11:15 -04:00
null_so_SOURCES = null.c
2009-09-14 15:06:38 -04:00
multicast_so_SOURCES = mcast.c history.c
checkpoint_so_SOURCES = virt.c vm_states.c history.c
2009-08-20 15:03:41 -04:00
2009-07-28 10:46:53 -04:00
INCLUDES = -I../include\
-I/usr/include/openais -I/usr/include/libvirt \
-I/usr/include/nss3 -I/usr/include/nspr4 \
-I../../../cman/lib -I../../../ccs/lib -I/usr/include/libxml2 \
-I/usr/include/libvirt
2009-08-17 09:58:06 -04:00
CFLAGS += -DFENCE_RELEASE_NAME= \" devel\" -D_MODULE
2009-07-28 10:46:53 -04:00
LIBS += -L/usr/lib64/openais -lnss3 -lxml2 -lSaCkpt -lccs -lvirt -lcman \
2009-09-03 16:40:55 -04:00
-L../common -lfence_virt -Wl,-wrap,syslog,-wrap,closelog -lpthread
2009-08-17 16:53:58 -04:00
2009-09-03 16:40:55 -04:00
MAIN_LIBS = -L../config -lsimpleconfig
2009-07-28 10:46:53 -04:00
2009-08-21 14:05:48 -04:00
all : ${TARGETS } ${MODULES }
2009-07-28 10:46:53 -04:00
fence_virtd : ${fence_virtd_SOURCES :.c =.o }
2009-08-17 16:53:58 -04:00
gcc -o $@ $^ $( LIBS) $( MAIN_LIBS)
2009-07-28 10:46:53 -04:00
2009-09-01 18:54:17 -04:00
multicast.so : ${multicast_so_SOURCES :.c =.o }
gcc -o $@ $^ $( LIBS) -shared
2009-08-17 09:58:06 -04:00
libvirt.so : ${libvirt_so_SOURCES :.c =.o }
2009-08-17 16:53:58 -04:00
gcc -o $@ $^ $( LIBS) -shared
2009-08-17 09:58:06 -04:00
2009-09-01 19:11:15 -04:00
null.so : ${null_so_SOURCES :.c =.o }
gcc -o $@ $^ $( LIBS) -shared
2009-08-20 15:03:41 -04:00
checkpoint.so : ${checkpoint_so_SOURCES :.c =.o }
gcc -o $@ $^ $( LIBS) -shared
2009-07-28 10:46:53 -04:00
%.o : %.c
gcc $( CFLAGS) -c -o $@ $^ $( INCLUDES)
install : all
2009-08-21 14:05:48 -04:00
# XXX hardcoded sbin
if [ ! -d /usr/sbin ] ; then \
install -d /usr/sbin; \
2009-07-28 10:46:53 -04:00
fi
2009-08-21 14:05:48 -04:00
install -m755 ${ TARGETS } /usr/sbin
2009-08-21 14:12:58 -04:00
# XXX hardcoded sbin
if [ ! -d /usr/lib64/fence_virt ] ; then \
install -d /usr/lib64/fence_virt ; \
fi
install -m755 ${ MODULES } /usr/lib64/fence_virt
2009-07-28 10:46:53 -04:00
clean :
2009-09-01 16:23:09 -04:00
rm -f ${ TARGETS } ${ MODULES } *.o *.d *~