2 # Copyright (c) 2000-2008 Silicon Graphics, Inc. All Rights Reserved.
5 ifeq ("$(origin V)", "command line")
12 ifeq ($(BUILD_VERBOSE),1)
18 MAKEOPTS = --no-print-directory Q=$(Q)
21 HAVE_BUILDDEFS = $(shell test -f $(TOPDIR)/include/builddefs && echo yes || echo no)
23 ifeq ($(HAVE_BUILDDEFS), yes)
24 include $(TOPDIR)/include/builddefs
27 TESTS = $(shell sed -n -e '/^[0-9][0-9][0-9]*/s/ .*//p' group)
28 CONFIGURE = configure include/builddefs include/config.h
29 LSRCFILES = configure configure.in aclocal.m4 README VERSION
30 LDIRT = config.log .dep config.status config.cache confdefs.h conftest* \
33 ifeq ($(HAVE_DMAPI), true)
34 DMAPI_MAKEFILE = dmapi/Makefile
37 LIB_SUBDIRS = include lib
38 TOOL_SUBDIRS = ltp src m4
40 SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS)
42 default: include/builddefs include/config.h $(DMAPI_MAKEFILE) new remake check $(TESTS)
43 ifeq ($(HAVE_BUILDDEFS), no)
44 $(Q)$(MAKE) $(MAKEOPTS) $@
46 $(Q)$(MAKE) $(MAKEOPTS) $(SUBDIRS)
47 # automake doesn't always support "default" target
48 # so do dmapi make explicitly with "all"
49 ifeq ($(HAVE_DMAPI), true)
50 $(Q)$(MAKE) $(MAKEOPTS) -C $(TOPDIR)/dmapi all
54 # tool/lib dependencies
57 ifeq ($(HAVE_BUILDDEFS), yes)
60 clean: # if configure hasn't run, nothing to clean
63 configure include/builddefs:
67 --libexecdir=/usr/lib \
70 include/config.h: include/builddefs
71 ## Recover from the removal of $@
72 @if test -f $@; then :; else \
73 rm -f include/builddefs; \
74 $(MAKE) $(AM_MAKEFLAGS) include/builddefs; \
78 cd $(TOPDIR)/dmapi/ ; ./configure
81 aclocal --acdir=`pwd`/m4 --output=$@
83 install: default $(addsuffix -install,$(SUBDIRS))
84 $(INSTALL) -m 755 -d $(PKG_LIB_DIR)
85 $(INSTALL) -m 755 check $(PKG_LIB_DIR)
86 $(INSTALL) -m 755 [0-9]?? $(PKG_LIB_DIR)
87 $(INSTALL) -m 755 run.* $(PKG_LIB_DIR)
88 $(INSTALL) -m 644 group $(PKG_LIB_DIR)
89 $(INSTALL) -m 644 randomize.awk $(PKG_LIB_DIR)
90 $(INSTALL) -m 644 [0-9]??.* $(PKG_LIB_DIR)
91 $(INSTALL) -m 644 common* $(PKG_LIB_DIR)
94 install-dev install-lib:
97 $(MAKE) $(MAKEOPTS) -C $* install
99 realclean distclean: clean
100 rm -f $(LDIRT) $(CONFIGURE)
101 rm -rf autom4te.cache Logs