xfstests: fix typo in check
[xfstests-dev.git] / Makefile
1 #
2 # Copyright (C) 2000-2008, 2011 SGI  All Rights Reserved.
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 2 of the
7 # License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 # 02110-1301, USA.
18 #
19
20 ifeq ("$(origin V)", "command line")
21   BUILD_VERBOSE = $(V)
22 endif
23 ifndef BUILD_VERBOSE
24   BUILD_VERBOSE = 0
25 endif
26
27 ifeq ($(BUILD_VERBOSE),1)
28   Q =
29 else
30   Q = @
31 endif
32
33 MAKEOPTS = --no-print-directory Q=$(Q)
34
35 TOPDIR = .
36 HAVE_BUILDDEFS = $(shell test -f $(TOPDIR)/include/builddefs && echo yes || echo no)
37
38 ifeq ($(HAVE_BUILDDEFS), yes)
39 include $(TOPDIR)/include/builddefs
40 endif
41
42 SRCTAR = $(PKG_NAME)-$(PKG_VERSION).tar.gz
43
44 TESTS = $(shell sed -n -e '/^[0-9][0-9][0-9]*/s/ .*//p' group)
45 CONFIGURE = configure include/builddefs include/config.h
46 LSRCFILES = configure configure.ac aclocal.m4 README VERSION
47 LDIRT = config.log .ltdep .dep config.status config.cache confdefs.h \
48         conftest* check.log check.time
49
50 ifeq ($(HAVE_BUILDDEFS), yes)
51 LDIRT += $(SRCTAR)
52 endif
53
54 LIB_SUBDIRS = include lib
55 TOOL_SUBDIRS = ltp src m4 common
56 ifeq ($(HAVE_DMAPI), true)
57 TOOL_SUBDIRS += dmapi
58 endif
59
60 export TESTS_DIR = tests
61 SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS) $(TESTS_DIR)
62
63 default: include/builddefs $(DMAPI_MAKEFILE) $(TESTS)
64 ifeq ($(HAVE_BUILDDEFS), no)
65         $(Q)$(MAKE) $(MAKEOPTS) $@
66 else
67         $(Q)$(MAKE) $(MAKEOPTS) $(SUBDIRS)
68 endif
69
70 # tool/lib dependencies
71 $(TOOL_SUBDIRS): $(LIB_SUBDIRS)
72
73 ifeq ($(HAVE_BUILDDEFS), yes)
74 include $(BUILDRULES)
75 else
76 clean:  # if configure hasn't run, nothing to clean
77 endif
78
79 configure: configure.ac
80         autoheader
81         autoconf
82
83 include/builddefs include/config.h: configure
84         ./configure \
85                 --libexecdir=/usr/lib
86
87 aclocal.m4::
88         aclocal --acdir=`pwd`/m4 --output=$@
89
90 depend: include/builddefs $(addsuffix -depend,$(SUBDIRS))
91
92 install: default $(addsuffix -install,$(SUBDIRS))
93         $(INSTALL) -m 755 -d $(PKG_LIB_DIR)
94         $(INSTALL) -m 755 check $(PKG_LIB_DIR)
95         $(INSTALL) -m 644 randomize.awk $(PKG_LIB_DIR)
96
97 # Nothing.
98 install-dev install-lib:
99
100 %-install:
101         $(MAKE) $(MAKEOPTS) -C $* install
102
103 realclean distclean: clean
104         $(Q)rm -f $(LDIRT) $(CONFIGURE)
105         $(Q)rm -rf autom4te.cache Logs
106
107 dist: include/builddefs include/config.h default
108 ifeq ($(HAVE_BUILDDEFS), no)
109         $(Q)$(MAKE) $(MAKEOPTS) -C . $@
110 else
111         $(Q)$(MAKE) $(MAKEOPTS) $(SRCTAR)
112 endif
113
114 $(SRCTAR) : default
115         $(Q)git archive --prefix=$(PKG_NAME)-$(PKG_VERSION)/ --format=tar \
116           v$(PKG_VERSION) > $(PKG_NAME)-$(PKG_VERSION).tar
117         $(Q)$(TAR) --transform "s,^,$(PKG_NAME)-$(PKG_VERSION)/," \
118           -rf $(PKG_NAME)-$(PKG_VERSION).tar $(CONFIGURE)
119         $(Q)$(ZIP) $(PKG_NAME)-$(PKG_VERSION).tar
120         echo Wrote: $@