Allow parallel builds of the xfstests package
[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 LIB_SUBDIRS = include lib
20 TOOL_SUBDIRS = ltp src m4
21
22 SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS)
23
24 default: include/builddefs include/config.h $(DMAPI_MAKEFILE) new remake check $(TESTS)
25 ifeq ($(HAVE_BUILDDEFS), no)
26         $(MAKE) $@
27 else
28         $(MAKE) $(SUBDIRS)
29         # automake doesn't always support "default" target 
30         # so do dmapi make explicitly with "all"
31 ifeq ($(HAVE_DMAPI), true)
32         $(MAKE) -C $(TOPDIR)/dmapi all
33 endif
34 endif
35
36 # tool/lib dependencies
37 src ltp: lib
38
39 ifeq ($(HAVE_BUILDDEFS), yes)
40 include $(BUILDRULES)
41 else
42 clean:  # if configure hasn't run, nothing to clean
43 endif
44
45 include/builddefs:
46         autoheader
47         autoconf
48         ./configure \
49                 --libexecdir=/usr/lib \
50                 --enable-lib64=yes
51
52 include/config.h: include/builddefs
53 ## Recover from the removal of $@
54         @if test -f $@; then :; else \
55                 rm -f include/builddefs; \
56                 $(MAKE) $(AM_MAKEFLAGS) include/builddefs; \
57         fi
58
59 $(DMAPI_MAKEFILE):
60         cd $(TOPDIR)/dmapi/ ; ./configure
61
62 aclocal.m4::
63         aclocal --acdir=`pwd`/m4 --output=$@
64
65 install install-dev install-lib:
66
67 realclean distclean: clean
68         rm -f $(LDIRT) $(CONFIGURE)
69         rm -rf autom4te.cache Logs