update changelog
[platform/upstream/acl.git] / package / Makefile
1 #
2 # Copyright (c) 2000-2002 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 include $(TOPDIR)/include/builddefs
21
22 MANIFEST=src-manifest
23 SRCTAR=$(PKG_NAME)-$(PKG_VERSION).src.tar.gz
24
25 LDIRT = *-manifest *.gz $(TOPDIR)/$(PKG_NAME)-*
26
27 # for clean and clobber
28 SUBDIRS = tar rpm
29
30 # nothing to build here (it's all packaging)
31 default install install-dev install-lib:
32
33 include $(BUILDRULES)
34
35 # Symlink in the TOPDIR is used to pack files relative to
36 # product-version directory.
37 $(MANIFEST) : $(_FORCE)
38         @if [ ! -L $(TOPDIR)/$(PKG_NAME)-$(PKG_VERSION) ] ; then \
39             $(LN_S) . $(TOPDIR)/$(PKG_NAME)-$(PKG_VERSION) ; \
40         fi
41         @CDIR=`pwd`; cd $(TOPDIR); \
42         $(MAKE) --no-print-directory source | \
43             sed -e 's/^\./$(PKG_NAME)-$(PKG_VERSION)/' > $$CDIR/$@ ;\
44         if [ $$? -ne 0 ] ; then  \
45             exit 1; \
46         else \
47             unset TAPE; \
48             $(TAR) -T $$CDIR/$@ -cf - | $(ZIP) --best > $$CDIR/$(SRCTAR); \
49             echo Wrote: $$CDIR/$(SRCTAR); \
50         fi
51
52 dist : default $(MANIFEST)
53         @DIST_MANIFEST=`pwd`/bin-manifest; DIST_ROOT=/tmp/$$$$; \
54         export DIST_MANIFEST DIST_ROOT; \
55         rm -f $$DIST_MANIFEST; \
56         echo === install === && $(MAKE) -C $(TOPDIR) install || exit $$?; \
57         if [ -x $(TAR) ]; then \
58             ( echo "=== tar ===" && $(MAKEF) -C tar $@ || exit $$? ); \
59         fi; \
60         if [ -x $(RPMBUILD) ]; then \
61             ( echo "=== rpm ===" && $(MAKEF) -C rpm $@ || exit $$? ); \
62         fi; \
63         test -z "$$KEEP_DIST_ROOT" || rm -rf $$DIST_ROOT; echo Done