Sync usage with man page.
[netbsd-mini2440.git] / external / gpl2 / lvm2 / dist / test / Makefile.in
blobae056507291c585d710e53a45f841644cd925216
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)
15 TAR ?= $(TAR)
16 RM ?= rm -f
18 subdir := $(shell pwd|sed 's,.*/,,')
20 srcdir = @srcdir@
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@
28 all: init.sh
29 ./bin/harness t-*.sh
31 bin/not: $(srcdir)/not.c .bin-dir-stamp
32 $(CC) -o bin/not $<
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)
38 rm -f $@-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
47 chmod a-w $@-t
48 mv $@-t $@
49 -cp $(srcdir)/test-utils.sh .
50 -cp $(srcdir)/test-lib.sh .
51 -cp $(T) .
53 # Shell quote;
54 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
56 T = $(wildcard $(srcdir)/t-*.sh)
58 ifeq ("@APPLIB@", "yes")
59 T += lvm2app.sh
60 all: api/vgtest
61 api/vgtest:
62 $(MAKE) -C api vgtest
63 endif
65 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
66 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
68 #$(T): init.sh
69 # ./bin/harness $@
71 .bin-dir-stamp: lvm-wrapper
72 rm -rf bin
73 mkdir bin
74 for i in lvm $$(cat ../tools/.commands); do \
75 ln -s ../lvm-wrapper bin/$$i; \
76 done
77 ln -s "$(abs_top_builddir)/tools/dmsetup" bin/dmsetup
78 touch $@
80 lvm-wrapper: Makefile
81 rm -f $@-t $@
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
87 chmod a-w,a+x $@-t
88 mv $@-t $@
90 clean:
91 rm -rf init.sh lvm-wrapper bin .bin-dir-stamp
93 distclean: clean
94 rm -f Makefile
96 .PHONY: $(T) clean distclean
97 .NOTPARALLEL: