xfstests: check for dmapi headers
[xfstests-dev.git] / Makefile
1 #
2 # Copyright (c) 2000-2008 Silicon Graphics, Inc.  All Rights Reserved.
3 #
4
5 TOPDIR = .
6 HAVE_BUILDDEFS = $(shell test -f $(TOPDIR)/include/builddefs && echo yes || echo no)
7
8 ifeq ($(HAVE_BUILDDEFS), yes)
9 include $(TOPDIR)/include/builddefs
10 endif
11
12 TESTS = $(shell sed -n -e '/^[0-9][0-9][0-9]*/s/ .*//p' group)
13 CONFIGURE = configure include/builddefs include/config.h
14 DMAPI_MAKEFILE = dmapi/Makefile
15 LSRCFILES = configure configure.in aclocal.m4 README VERSION
16 LDIRT = config.log .dep config.status config.cache confdefs.h conftest* \
17         check.log check.time
18
19 SUBDIRS = include lib ltp src m4
20
21 default: $(CONFIGURE) $(DMAPI_MAKEFILE) new remake check $(TESTS)
22 ifeq ($(HAVE_BUILDDEFS), no)
23         $(MAKE) $@
24 else
25         $(SUBDIRS_MAKERULE)
26         # automake doesn't always support "default" target 
27         # so do dmapi make explicitly with "all"
28 ifeq ($(HAVE_DMAPI), true)
29         cd $(TOPDIR)/dmapi; make all
30 endif
31 endif
32
33 ifeq ($(HAVE_BUILDDEFS), yes)
34 include $(BUILDRULES)
35 else
36 clean:  # if configure hasn't run, nothing to clean
37 endif
38
39 $(CONFIGURE):
40         autoheader
41         autoconf
42         ./configure \
43                 --libexecdir=/usr/lib \
44                 --enable-lib64=yes
45
46 $(DMAPI_MAKEFILE):
47         cd $(TOPDIR)/dmapi/ ; ./configure
48
49 aclocal.m4::
50         aclocal --acdir=`pwd`/m4 --output=$@
51
52 install install-dev install-lib:
53
54 realclean distclean: clean
55         rm -f $(LDIRT) $(CONFIGURE)
56         rm -rf autom4te.cache Logs