resetting manifest requested domain to floor
[platform/upstream/acl.git] / Makefile
1 #
2 # Copyright (c) 2000-2006 Silicon Graphics, Inc.  All Rights Reserved.
3 #
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.
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
12 # GNU 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 #
18
19 TOPDIR = .
20 HAVE_BUILDDEFS = $(shell test -f $(TOPDIR)/include/builddefs && echo yes || echo no)
21
22 ifeq ($(HAVE_BUILDDEFS), yes)
23 include $(TOPDIR)/include/builddefs
24 endif
25
26 CONFIGURE = \
27         aclocal.m4 \
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
31 LSRCFILES = \
32         configure.in Makepkgs install-sh exports README VERSION \
33         $(CONFIGURE)
34
35 LDIRT = config.log .dep config.status config.cache confdefs.h conftest* \
36         Logs/* built .census install.* install-dev.* install-lib.* *.gz
37
38 LIB_SUBDIRS = include libmisc libacl
39 TOOL_SUBDIRS = getfacl setfacl chacl m4 man doc po test examples package debian
40
41 SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS)
42
43 default: include/builddefs include/config.h
44 ifeq ($(HAVE_BUILDDEFS), no)
45         $(MAKE) -C . $@
46 else
47         $(MAKE) $(SUBDIRS)
48 endif
49
50 # tool/lib dependencies
51 libacl: libmisc
52 getfacl setfacl chacl: libacl
53
54 ifeq ($(HAVE_BUILDDEFS), yes)
55 include $(BUILDRULES)
56 else
57 clean:  # if configure hasn't run, nothing to clean
58 endif
59
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`
64
65 configure include/builddefs:
66         libtoolize -c $(LIBTOOLIZE_INSTALL) -f
67         cp include/install-sh .
68         aclocal -I m4
69         autoconf
70         ./configure \
71                 --prefix=/ \
72                 --exec-prefix=/ \
73                 --sbindir=/bin \
74                 --bindir=/usr/bin \
75                 --libdir=/lib \
76                 --libexecdir=/usr/lib \
77                 --enable-lib64=yes \
78                 --includedir=/usr/include \
79                 --mandir=/usr/share/man \
80                 --datadir=/usr/share \
81                 $$LOCAL_CONFIGURE_OPTIONS
82         touch .census
83
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; \
89         fi
90
91 install: default $(addsuffix -install,$(SUBDIRS))
92         $(INSTALL) -m 755 -d $(PKG_DOC_DIR)
93         $(INSTALL) -m 644 README $(PKG_DOC_DIR)
94
95 install-dev: default $(addsuffix -install-dev,$(SUBDIRS))
96
97 install-lib: default $(addsuffix -install-lib,$(SUBDIRS))
98
99 %-install:
100         $(MAKE) -C $* install
101
102 %-install-lib:
103         $(MAKE) -C $* install-lib
104
105 %-install-dev:
106         $(MAKE) -C $* install-dev
107
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
112
113 .PHONY: tests root-tests nfs-tests
114 tests root-tests nfs-tests: default
115         $(MAKE) -C test/ $@