2007-09-18 18:02:22 +04:00
# Copyright (C) 2007 Red Hat, Inc. All rights reserved.
#
# 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,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2007-09-18 18:00:42 +04:00
#TEST_OPTS=--verbose --debug
SHELL_PATH ?= $( SHELL)
TAR ?= $( TAR)
RM ?= rm -f
subdir := $( shell pwd| sed 's,.*/,,' )
2007-09-18 18:02:22 +04:00
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
abs_srcdir = @abs_srcdir@
2007-10-09 17:13:06 +04:00
abs_builddir = @abs_builddir@
2007-09-18 18:02:22 +04:00
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
2007-09-18 18:00:42 +04:00
2009-02-12 22:54:45 +03:00
all : init .sh
./bin/harness $( T)
2008-09-29 20:07:02 +04:00
2009-02-12 22:54:45 +03:00
bin/not : .bin -dir -stamp not .c
2009-01-12 21:45:44 +03:00
$( CC) -o bin/not not.c
2009-02-12 22:54:45 +03:00
bin/harness : .bin -dir -stamp harness .c
$( CC) -o bin/harness harness.c
init.sh : Makefile .in .bin -dir -stamp bin /not bin /harness
2007-09-18 18:00:42 +04:00
rm -f $@ -t $@
echo 'top_srcdir=$(top_srcdir)' >> $@ -t
echo 'abs_top_builddir=$(abs_top_builddir)' >> $@ -t
echo 'abs_top_srcdir=$(abs_top_builddir)' >> $@ -t
echo 'PATH=$(abs_top_builddir)/test/bin:$$PATH' >> $@ -t
2008-11-07 04:30:03 +03:00
echo 'export LD_LIBRARY_PATH="$(abs_top_builddir)/libdm:$(abs_top_builddir)/dmeventd"' >> $@ -t
2007-09-18 18:00:42 +04:00
echo 'abs_srcdir=$(abs_srcdir)' >> $@ -t
2007-10-09 17:13:06 +04:00
echo 'abs_builddir=$(abs_builddir)' >> $@ -t
2007-09-18 18:00:42 +04:00
echo 'export PATH' >> $@ -t
chmod a-w $@ -t
mv $@ -t $@
# Shell quote;
SHELL_PATH_SQ = $( subst ',' \' ' ,$( SHELL_PATH) )
2007-09-21 21:12:13 +04:00
T = $( wildcard t-*.sh)
2007-09-18 18:00:42 +04:00
Makefile : $( srcdir ) /Makefile .in $( top_builddir ) /config .status
cd $( top_builddir) && $( SHELL) ./config.status $( subdir) /$@
2009-02-12 22:54:45 +03:00
$(T) : init .sh
./bin/harness $@
2007-09-18 18:00:42 +04:00
.bin-dir-stamp : lvm -wrapper
rm -rf bin
mkdir bin
for i in lvm $$ ( cat $( top_srcdir) /tools/.commands) ; do \
ln -s ../lvm-wrapper bin/$$ i; \
done
2008-11-04 17:37:10 +03:00
ln -s " $( abs_top_builddir) /tools/dmsetup " bin/dmsetup
2007-09-18 18:00:42 +04:00
touch $@
lvm-wrapper : Makefile
rm -f $@ -t $@
2007-09-18 18:02:22 +04:00
echo '#!/bin/sh' > $@ -t
echo 'cmd=$$(echo ./$$0|sed "s,.*/,,")' >> $@ -t
echo 'test "$$cmd" = lvm &&' >> $@ -t
echo 'exec "$(abs_top_builddir)/tools/lvm" "$$@"' >> $@ -t
2007-09-18 18:00:42 +04:00
echo 'exec "$(abs_top_builddir)/tools/lvm" "$$cmd" "$$@"' >> $@ -t
chmod a-w,a+x $@ -t
mv $@ -t $@
clean :
rm -rf init.sh lvm-wrapper bin .bin-dir-stamp
2008-06-27 23:24:17 +04:00
distclean : clean
2009-03-16 21:28:04 +03:00
rm -f Makefile
2008-06-27 23:24:17 +04:00
.PHONY : $( T ) clean distclean
2007-09-18 18:00:42 +04:00
.NOTPARALLEL :