2 # Copyright (C) 2000-2008, 2011 SGI All Rights Reserved.
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 2 of the
7 # License, or (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 GNU
12 # 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., 51 Franklin Street, Fifth Floor, Boston, MA
20 ifeq ("$(origin V)", "command line")
27 ifeq ($(BUILD_VERBOSE),1)
33 MAKEOPTS = --no-print-directory Q=$(Q)
36 HAVE_BUILDDEFS = $(shell test -f $(TOPDIR)/include/builddefs && echo yes || echo no)
38 ifeq ($(HAVE_BUILDDEFS), yes)
39 include $(TOPDIR)/include/builddefs
42 SRCTAR = $(PKG_NAME)-$(PKG_VERSION).tar.gz
44 CONFIGURE = configure include/config.h include/config.h.in \
45 aclocal.m4 config.guess config.sub install-sh ltmain.sh \
46 m4/libtool.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 \
48 LSRCFILES = configure configure.ac aclocal.m4 README VERSION
49 LDIRT = config.log .ltdep .dep config.status config.cache confdefs.h \
50 conftest* check.log check.time libtool include/builddefs
52 ifeq ($(HAVE_BUILDDEFS), yes)
56 LIB_SUBDIRS = include lib
57 TOOL_SUBDIRS = ltp src m4 common
58 ifeq ($(HAVE_DMAPI), true)
62 export TESTS_DIR = tests
63 SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS) $(TESTS_DIR)
65 default: include/builddefs $(DMAPI_MAKEFILE)
66 ifeq ($(HAVE_BUILDDEFS), no)
67 $(Q)$(MAKE) $(MAKEOPTS) $@
69 $(Q)$(MAKE) $(MAKEOPTS) $(SUBDIRS)
72 # tool/lib dependencies
73 $(TOOL_SUBDIRS): $(LIB_SUBDIRS)
75 ifeq ($(HAVE_BUILDDEFS), yes)
78 clean: # if configure hasn't run, nothing to clean
81 configure: configure.ac
87 include/builddefs include/config.h: configure
89 --libexecdir=/usr/lib \
90 --exec_prefix=/var/lib
93 aclocal --acdir=`pwd`/m4 --output=$@
95 depend: include/builddefs $(addsuffix -depend,$(SUBDIRS))
97 install: default $(addsuffix -install,$(SUBDIRS))
98 $(INSTALL) -m 755 -d $(PKG_LIB_DIR)
99 $(INSTALL) -m 755 check $(PKG_LIB_DIR)
100 $(INSTALL) -m 644 randomize.awk $(PKG_LIB_DIR)
103 install-dev install-lib:
106 $(MAKE) $(MAKEOPTS) -C $* install
108 realclean distclean: clean
109 $(Q)rm -f $(LDIRT) $(CONFIGURE)
110 $(Q)rm -rf autom4te.cache Logs
112 dist: include/builddefs include/config.h default
113 ifeq ($(HAVE_BUILDDEFS), no)
114 $(Q)$(MAKE) $(MAKEOPTS) -C . $@
116 $(Q)$(MAKE) $(MAKEOPTS) $(SRCTAR)
120 $(Q)git archive --prefix=$(PKG_NAME)-$(PKG_VERSION)/ --format=tar \
121 v$(PKG_VERSION) > $(PKG_NAME)-$(PKG_VERSION).tar
122 $(Q)$(TAR) --transform "s,^,$(PKG_NAME)-$(PKG_VERSION)/," \
123 -rf $(PKG_NAME)-$(PKG_VERSION).tar $(CONFIGURE)
124 $(Q)$(ZIP) $(PKG_NAME)-$(PKG_VERSION).tar