2008-12-07 22:37:07 +03:00
#
2009-07-21 17:51:05 +04:00
# Copyright (C) 2009 Red Hat, Inc. All rights reserved.
2008-12-07 22:37:07 +03:00
#
# This file is part of LVM2.
#
# 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.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
2009-07-21 17:51:05 +04:00
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2008-12-07 22:37:07 +03:00
srcdir = @srcdir@
top_srcdir = @top_srcdir@
2009-10-02 23:10:31 +04:00
top_builddir = @top_builddir@
2008-12-07 22:37:07 +03:00
i f e q ( "@DEBUG@" , "yes" )
DEFS += -DDEBUG
e n d i f
2010-12-12 23:49:38 +03:00
TARGETS =
2011-03-02 00:30:43 +03:00
i f e q ( "@APPLIB@" , "yes" )
TARGETS += test
2009-07-21 17:51:05 +04:00
test_SOURCES = test.c
2010-12-12 23:36:38 +03:00
wrapper_SOURCES = test.c
2009-10-02 23:10:31 +04:00
INCLUDES += -I../../include
2008-12-07 22:37:07 +03:00
2011-03-02 00:30:43 +03:00
TARGETS += vgtest.t percent.t
e n d i f
2010-12-12 23:36:38 +03:00
2009-05-22 18:44:59 +04:00
LVMLIBS = @LVM2APP_LIB@ -ldevmapper
2009-11-30 18:12:34 +03:00
DEPLIBS = $( top_builddir) /liblvm/liblvm2app.so $( top_builddir) /libdm/libdevmapper.so
2008-12-07 22:37:07 +03:00
DEFS += -D_REENTRANT
2009-11-30 18:12:34 +03:00
i n c l u d e $( top_builddir ) / m a k e . t m p l
2008-12-07 22:37:07 +03:00
2009-11-30 18:12:34 +03:00
LDFLAGS = -L$( top_builddir) /libdm -L$( top_builddir) /liblvm
2009-03-08 20:06:55 +03:00
2009-09-15 02:56:27 +04:00
i f e q ( "@DMEVENTD@" , "yes" )
2010-03-04 14:21:05 +03:00
LVMLIBS += -ldevmapper-event
2009-11-30 18:12:34 +03:00
LDFLAGS += -L$( top_builddir) /daemons/dmeventd
2009-09-15 02:56:27 +04:00
e n d i f
2009-07-21 17:51:05 +04:00
test_OBJECTS = $( test_SOURCES:.c= .o)
2010-12-12 23:36:38 +03:00
wrapper_OBJECTS = $( wrapper_SOURCES:.c= .o)
2010-12-12 23:49:38 +03:00
OBJECTS = $( test_OBJECTS)
2009-07-21 17:51:05 +04:00
2011-03-02 00:30:43 +03:00
all : tests
2010-12-13 00:08:00 +03:00
2011-03-02 00:30:43 +03:00
tests : $( TARGETS )
2010-12-12 23:36:38 +03:00
2009-07-21 17:51:05 +04:00
test : $( test_OBJECTS ) $( DEPLIBS )
2010-04-14 20:13:34 +04:00
$( CC) -o test $( test_OBJECTS) $( CFLAGS) $( LDFLAGS) $( LVMLIBS) $( LIBS) $( READLINE_LIBS)
2008-12-07 22:37:07 +03:00
2010-12-12 23:36:38 +03:00
%.t : %.o $( DEPLIBS )
$( CC) -o $@ $( <) $( CFLAGS) $( LDFLAGS) $( LVMLIBS) $( LIBS)
wrapper : $( wrapper_OBJECTS ) $( DEPLIBS )
$( CC) -o wrapper $( wrapper_OBJECTS) $( CFLAGS) $( LDFLAGS) $( LVMLIBS) $( LIBS) -lreadline
Makefile : $( srcdir ) /Makefile .in $( top_builddir ) /config .status
cd $( top_builddir) && $( SHELL) ./config.status test/api/Makefile
2011-01-07 16:07:10 +03:00
clean :
rm -f *.t