r1757: added .PHONY to makefile
[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.9 2002/04/07 07:55:29 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 docs tagcvs dist
19
20 all: libs
21
22 libs:
23         (cd interfaces/mysql; make)
24         (cd interfaces/clsql-uffi; make)
25
26 clean:
27         @rm -f $(PKG)-*.tar.gz $(PKG)-*.zip
28         @find . -type d -name .bin |xargs rm -rf 
29         @find . -type f -name \*.a -or -name \*.so |xargs rm -rf 
30
31 realclean: clean
32         @find . -type f -name "#*" -or -name \*~ -exec rm {} \;
33
34 docs:
35         @(cd doc; make dist-doc)
36
37 VERSION=$(shell cat VERSION)
38 DISTDIR=$(PKG)-$(VERSION)
39 DIST_TARBALL=$(DISTDIR).tar.gz
40 DIST_ZIP=$(DISTDIR).zip
41 SOURCE_FILES=interfaces sql cmucl-compat doc test-suite Makefile VERSION \
42         COPYING.CLSQL COPYING.MaiSQL README INSTALL ChangeLog NEWS TODO \
43         set-logical.cl clsql-uffi.system \
44         clsql.system clsql-aodbc.system clsql-mysql.system \
45         clsql-postgresql.system clsql-postgresql-socket.system
46
47 VERSION_UNDERSCORE=$(shell cat VERSION | tr . _)
48 TAG=dist_$(VERSION_UNDERSCORE)
49
50 tagcvs:
51         cvs -q rtag -d $(TAG) $(PKG)
52         cvs -q tag -F $(TAG)
53
54 dist: realclean docs tagcvs
55         @rm -fr $(DISTDIR) $(DIST_TARBALL) $(DIST_ZIP)
56         @mkdir $(DISTDIR)
57         @cp -a $(SOURCE_FILES) $(DISTDIR)
58         @find $(DISTDIR) -type d -name CVS | xargs rm -r
59         @find $(DISTDIR) -type f -name .cvsignore -exec rm {} \;
60         @find $(DISTDIR) -type f -and -name \*.tex -or -name \*.aux -or \
61                  -name \*.log -or -name \*.out -or -name \*.dvi -or \
62                  -name \*~ -or -name \*.ps -or -name test.config | xargs rm -f
63         @tar czf $(DIST_TARBALL) $(DISTDIR)
64         @find $(DISTDIR) -type f -name \*.cl -or -name \*.list -or \
65                 -name \*.system -or -name Makefile -or -name ChangeLog -or \
66                 -name COPYRIGHT -or -name TODO -or -name README -or -name INSTALL \
67                 -or -name NEWS -or -name \*.sgml -or -name COPYING\* -or -name catalog \
68                 | xargs unix2dos -q
69         @zip -rq $(DIST_ZIP) $(DISTDIR)
70         @rm -r $(DISTDIR)