1 # Copyright (C) 2007 Red Hat, Inc. All rights reserved.
3 # This file is part of LVM2.
5 # This copyrighted material is made available to anyone wishing to use,
6 # modify, copy, or redistribute it subject to the terms and conditions
7 # of the GNU General Public License v.2.
9 # You should have received a copy of the GNU General Public License
10 # along with this program; if not, write to the Free Software Foundation,
11 # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
13 #TEST_OPTS=--verbose --debug
14 SHELL_PATH ?
= $(SHELL
)
18 subdir
:= $(shell pwd|sed
's,.*/,,')
21 top_srcdir
= @top_srcdir@
22 top_builddir
= @top_builddir@
23 abs_srcdir
= @abs_srcdir@
24 abs_builddir
= @abs_builddir@
25 abs_top_builddir
= @abs_top_builddir@
26 abs_top_srcdir
= @abs_top_srcdir@
31 bin
/not
: $(srcdir)/not.c .bin-dir-stamp
34 bin
/harness
: $(srcdir)/harness.c .bin-dir-stamp
35 $(CC
) -o bin
/harness
$<
37 init.sh
: $(srcdir)/Makefile.in
$(srcdir)/test-utils.sh .bin-dir-stamp bin
/not bin
/harness
$(T
)
39 echo
'top_srcdir=$(top_srcdir)' >> $@
-t
40 echo
'abs_top_builddir=$(abs_top_builddir)' >> $@
-t
41 echo
'abs_top_srcdir=$(abs_top_builddir)' >> $@
-t
42 echo
'PATH=$(abs_top_builddir)/test/bin:$$PATH' >> $@
-t
43 echo
'export LD_LIBRARY_PATH="$(abs_top_builddir)/libdm:$(abs_top_builddir)/liblvm:$(abs_top_builddir)/daemons/dmeventd"' >> $@
-t
44 echo
'abs_srcdir=$(abs_srcdir)' >> $@
-t
45 echo
'abs_builddir=$(abs_builddir)' >> $@
-t
46 echo
'export PATH' >> $@
-t
49 -cp
$(srcdir)/test-utils.sh .
50 -cp
$(srcdir)/test-lib.sh .
54 SHELL_PATH_SQ
= $(subst ','\'',$(SHELL_PATH))
56 T = $(wildcard $(srcdir)/t-*.sh)
58 ifeq ("@APPLIB@", "yes")
65 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
66 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
71 .bin-dir-stamp: lvm-wrapper
74 for i in lvm $$(cat ../tools/.commands); do \
75 ln -s ../lvm-wrapper bin/$$i; \
77 ln -s "$(abs_top_builddir)/tools/dmsetup" bin/dmsetup
82 echo '#!/bin/sh' > $@-t
83 echo
'cmd=$$(echo ./$$0|sed "s,.*/,,")' >> $@
-t
84 echo
'test "$$cmd" = lvm &&' >> $@
-t
85 echo
'exec "$(abs_top_builddir)/tools/lvm" "$$@"' >> $@
-t
86 echo
'exec "$(abs_top_builddir)/tools/lvm" "$$cmd" "$$@"' >> $@
-t
91 rm -rf init.sh lvm-wrapper bin .bin-dir-stamp
96 .PHONY
: $(T
) clean distclean