r1826: *** 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.16 2002/04/28 10:58:07 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 DEBPKG=cl-sql
18 SUBDIRS:=interfaces sql cmucl-compat
19 DOCSUBDIRS:=doc
20
21 include Makefile.common
22
23 .PHONY: all libs clean distclean doc tagcvs dist wwwdist
24
25 LIBSUBDIRS=interfaces/mysql interfaces/clsql-uffi
26 .PHONY: subdirs $(LIBSUBDIRS)
27
28 all: $(LIBSUBDIRS)
29
30 $(LIBSUBDIRS):
31         $(MAKE) -C $@
32
33 clean:
34         @rm -f $(PKG)-*.tar.gz $(PKG)-*.zip
35         @find . -type d -name .bin |xargs rm -rf 
36         @find . -type f -name "#*" -or -name \*~ -exec rm {} \;
37         @for i in $(LIBSUBDIRS) ; do $(MAKE) -C $$i $@ ; done
38
39 distclean: clean
40
41 VERSION=$(shell cat VERSION)
42 DISTDIR=$(PKG)-$(VERSION)
43 DIST_TARBALL=$(DISTDIR).tar.gz
44 DIST_ZIP=$(DISTDIR).zip
45 SOURCE_FILES=interfaces sql cmucl-compat doc test-suite Makefile VERSION \
46         COPYING.CLSQL COPYING.MaiSQL README INSTALL ChangeLog NEWS TODO \
47         set-logical.cl clsql-uffi.system \
48         clsql.system clsql-aodbc.system clsql-mysql.system \
49         clsql-postgresql.system clsql-postgresql-socket.system
50
51 VERSION_UNDERSCORE=$(shell cat VERSION | tr . _)
52 TAG=dist_$(VERSION_UNDERSCORE)
53
54 tagcvs:
55         @cvs -q rtag -d $(TAG) $(PKG) > /dev/null
56         @cvs -q tag -F $(TAG) > /dev/null
57
58 dist: distclean tagcvs
59         @$(MAKE) -C doc $@
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
74         @zip -rq $(DIST_ZIP) $(DISTDIR)
75         @rm -r $(DISTDIR)
76
77 wwwdist: dist
78         @./copy