xfstests: Use installed libraries only
[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 TESTS = $(shell sed -n -e '/^[0-9][0-9][0-9]*/s/ .*//p' group)
43 CONFIGURE = configure include/builddefs include/config.h
44 LSRCFILES = configure configure.in aclocal.m4 README VERSION
45 LDIRT = config.log .ltdep .dep config.status config.cache confdefs.h \
46         conftest* check.log check.time
47
48
49 LIB_SUBDIRS = include lib
50 TOOL_SUBDIRS = ltp src m4
51 ifeq ($(HAVE_DMAPI), true)
52 TOOL_SUBDIRS += dmapi
53 endif
54
55 SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS)
56
57 default: include/builddefs $(DMAPI_MAKEFILE) $(TESTS)
58 ifeq ($(HAVE_BUILDDEFS), no)
59         $(Q)$(MAKE) $(MAKEOPTS) $@
60 else
61         $(Q)$(MAKE) $(MAKEOPTS) $(SUBDIRS)
62 endif
63
64 # tool/lib dependencies
65 $(TOOL_SUBDIRS): $(LIB_SUBDIRS)
66
67 ifeq ($(HAVE_BUILDDEFS), yes)
68 include $(BUILDRULES)
69 else
70 clean:  # if configure hasn't run, nothing to clean
71 endif
72
73 configure: configure.in
74         autoheader
75         autoconf
76
77 include/builddefs include/config.h: configure
78         ./configure \
79                 --libexecdir=/usr/lib \
80                 --enable-lib64=yes
81
82 aclocal.m4::
83         aclocal --acdir=`pwd`/m4 --output=$@
84
85 depend: include/builddefs $(addsuffix -depend,$(SUBDIRS))
86
87 install: default $(addsuffix -install,$(SUBDIRS))
88         $(INSTALL) -m 755 -d $(PKG_LIB_DIR)
89         $(INSTALL) -m 755 check $(PKG_LIB_DIR)
90         $(INSTALL) -m 755 [0-9]?? $(PKG_LIB_DIR)
91         $(INSTALL) -m 755 run.* $(PKG_LIB_DIR)
92         $(INSTALL) -m 644 group $(PKG_LIB_DIR)
93         $(INSTALL) -m 644 randomize.awk $(PKG_LIB_DIR)
94         $(INSTALL) -m 644 [0-9]??.* $(PKG_LIB_DIR)
95         $(INSTALL) -m 644 common* $(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