r1758: *** empty log message ***
[clsql.git] / Makefile
1 # FILE IDENTIFICATION
2
3 #  Name:         Makefile
4 #  Purpose:      Makefile for the CLSQL package
5 #  Programer:    Kevin M. Rosenberg
6 #  Date Started: Mar 2002
7 #
8 #  CVS Id:   $Id: Makefile,v 1.10 2002/04/07 08:09:11 kevin Exp $
9 #
10 # This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
11 #
12 # CLSQL users are granted the rights to distribute and use this software
13 # as governed by the terms of the Lisp Lesser GNU Public License
14 # (http://opensource.franz.com/preamble.html), also known as the LLGPL.
15
16 PKG=clsql
17
18 .PHONY: all libs clean realclean doc tagcvs dist
19
20 SUBDIRS=interfaces/mysql interfaces/clsql-uffi
21 .PHONY: subdirs $(SUBDIRS)
22
23 all: $(SUBDIRS)
24
25 $(SUBDIRS):
26         $(MAKE) -C $@
27
28 clean:
29         @rm -f $(PKG)-*.tar.gz $(PKG)-*.zip
30         @find . -type d -name .bin |xargs rm -rf 
31         $(MAKE) -C doc clean
32         for i in $(SUBDIRS) ; do \
33                 $(MAKE) -C $$i clean; \
34         done
35
36 realclean: clean
37         @find . -type f -name "#*" -or -name \*~ -exec rm {} \;
38
39 doc:
40         $(MAKE) -C doc dist-doc
41
42 VERSION=$(shell cat VERSION)
43 DISTDIR=$(PKG)-$(VERSION)
44 DIST_TARBALL=$(DISTDIR).tar.gz
45 DIST_ZIP=$(DISTDIR).zip
46 SOURCE_FILES=interfaces sql cmucl-compat doc test-suite Makefile VERSION \
47         COPYING.CLSQL COPYING.MaiSQL README INSTALL ChangeLog NEWS TODO \
48         set-logical.cl clsql-uffi.system \
49         clsql.system clsql-aodbc.system clsql-mysql.system \
50         clsql-postgresql.system clsql-postgresql-socket.system
51
52 VERSION_UNDERSCORE=$(shell cat VERSION | tr . _)
53 TAG=dist_$(VERSION_UNDERSCORE)
54
55 tagcvs:
56         cvs -q rtag -d $(TAG) $(PKG)
57         cvs -q tag -F $(TAG)
58
59 dist: realclean docs tagcvs
60         @rm -fr $(DISTDIR) $(DIST_TARBALL) $(DIST_ZIP)
61         @mkdir $(DISTDIR)
62         @cp -a $(SOURCE_FILES) $(DISTDIR)
63         @find $(DISTDIR) -type d -name CVS | xargs rm -r
64         @find $(DISTDIR) -type f -name .cvsignore -exec rm {} \;
65         @find $(DISTDIR) -type f -and -name \*.tex -or -name \*.aux -or \
66                  -name \*.log -or -name \*.out -or -name \*.dvi -or \
67                  -name \*~ -or -name \*.ps -or -name test.config | xargs rm -f
68         @tar czf $(DIST_TARBALL) $(DISTDIR)
69         @find $(DISTDIR) -type f -name \*.cl -or -name \*.list -or \
70                 -name \*.system -or -name Makefile -or -name ChangeLog -or \
71                 -name COPYRIGHT -or -name TODO -or -name README -or -name INSTALL \
72                 -or -name NEWS -or -name \*.sgml -or -name COPYING\* -or -name catalog \
73                 | xargs unix2dos -q
74         @zip -rq $(DIST_ZIP) $(DISTDIR)
75         @rm -r $(DISTDIR)