2 # Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved.
3 # Copyright (C) 2009 Andreas Gruenbacher <agruen@suse.de>
5 # This program is free software: you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
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 libattr
39 TOOL_SUBDIRS = attr getfattr setfattr examples test m4 man doc po debian package
41 SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS)
43 default: include/builddefs include/config.h
44 ifeq ($(HAVE_BUILDDEFS), no)
50 # tool/lib dependencies
52 getfattr setfattr: libmisc libattr
55 ifeq ($(HAVE_BUILDDEFS), yes)
58 clean: # if configure hasn't run, nothing to clean
61 # Recent versions of libtool require the -i option for copying auxiliary
62 # files (config.sub, config.guess, install-sh, ltmain.sh), while older
63 # versions will copy those files anyway, and don't understand -i.
64 LIBTOOLIZE_INSTALL = `libtoolize -n -i >/dev/null 2>/dev/null && echo -i`
66 configure include/builddefs:
67 libtoolize -c $(LIBTOOLIZE_INSTALL) -f
68 cp include/install-sh .
77 --libexecdir=/usr/lib \
79 --includedir=/usr/include \
80 --mandir=/usr/share/man \
81 --datadir=/usr/share \
82 $$LOCAL_CONFIGURE_OPTIONS
85 include/config.h: include/builddefs
86 ## Recover from the removal of $@
87 @if test -f $@; then :; else \
88 rm -f include/builddefs; \
89 $(MAKE) $(AM_MAKEFLAGS) include/builddefs; \
92 install: default $(addsuffix -install,$(SUBDIRS))
93 $(INSTALL) -m 755 -d $(PKG_DOC_DIR)
94 $(INSTALL) -m 644 README $(PKG_DOC_DIR)
96 install-dev: default $(addsuffix -install-dev,$(SUBDIRS))
98 install-lib: install $(addsuffix -install-lib,$(SUBDIRS))
101 $(MAKE) -C $* install
104 $(MAKE) -C $* install-dev
107 $(MAKE) -C $* install-lib
109 realclean distclean: clean
110 rm -f $(LDIRT) $(CONFIGURE)
111 rm -f include/builddefs include/config.h install-sh libtool
112 rm -rf autom4te.cache Logs
114 .PHONY: tests root-tests ext-tests
115 tests root-tests ext-tests: default
118 # HACK: Convert the man pages into html
120 @for man in $$(find man -name '*.[1-9]'); do \
121 echo $${man%.*}.html ; \
122 groff -man -Thtml -P-h -P-l $$man > $${man%.*}.html; \