2 # Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
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
12 # GNU General Public License for more details.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 HAVE_BUILDDEFS = $(shell test -f $(TOPDIR)/include/builddefs && echo yes || echo no)
22 ifeq ($(HAVE_BUILDDEFS), yes)
23 include $(TOPDIR)/include/builddefs
28 configure config.guess config.sub \
29 ltmain.sh m4/libtool.m4 m4/ltoptions.m4 m4/ltsugar.m4 \
30 m4/ltversion.m4 m4/lt~obsolete.m4
32 configure.in Makepkgs install-sh exports README VERSION \
35 LDIRT = config.log .dep config.status config.cache confdefs.h conftest* \
36 Logs/* built .census install.* install-dev.* install-lib.* *.gz
38 LIB_SUBDIRS = include libmisc libacl
39 TOOL_SUBDIRS = getfacl setfacl chacl m4 man doc po test examples build debian
41 SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS)
43 default: include/builddefs include/config.h
44 ifeq ($(HAVE_BUILDDEFS), no)
50 # tool/lib dependencies
52 getfacl setfacl chacl: libacl
54 ifeq ($(HAVE_BUILDDEFS), yes)
57 clean: # if configure hasn't run, nothing to clean
60 # Recent versions of libtool require the -i option for copying auxiliary
61 # files (config.sub, config.guess, install-sh, ltmain.sh), while older
62 # versions will copy those files anyway, and don't understand -i.
63 LIBTOOLIZE_INSTALL = `libtoolize -n -i >/dev/null 2>/dev/null && echo -i`
65 configure include/builddefs:
66 libtoolize -c $(LIBTOOLIZE_INSTALL) -f
67 cp include/install-sh .
76 --libexecdir=/usr/lib \
78 --includedir=/usr/include \
79 --mandir=/usr/share/man \
80 --datadir=/usr/share \
81 $$LOCAL_CONFIGURE_OPTIONS
84 include/config.h: include/builddefs
85 ## Recover from the removal of $@
86 @if test -f $@; then :; else \
87 rm -f include/builddefs; \
88 $(MAKE) $(AM_MAKEFLAGS) include/builddefs; \
91 install: default $(addsuffix -install,$(SUBDIRS))
92 $(INSTALL) -m 755 -d $(PKG_DOC_DIR)
93 $(INSTALL) -m 644 README $(PKG_DOC_DIR)
95 install-dev: default $(addsuffix -install-dev,$(SUBDIRS))
97 install-lib: default $(addsuffix -install-lib,$(SUBDIRS))
100 $(MAKE) -C $* install
103 $(MAKE) -C $* install-lib
106 $(MAKE) -C $* install-dev
108 realclean distclean: clean
109 rm -f $(LDIRT) $(CONFIGURE)
110 rm -f include/builddefs include/config.h install-sh libtool
111 rm -rf autom4te.cache Logs
113 .PHONY: tests root-tests nfs-tests
114 tests root-tests nfs-tests: default