/[clhp]/clhp/Makefile
ViewVC logotype

Contents of /clhp/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.24 - (show annotations)
Fri Nov 14 22:45:39 2003 UTC (10 years, 5 months ago) by aventimiglia
Branch: MAIN
CVS Tags: HEAD
Changes since 1.23: +4 -4 lines
Versioning changes post release
1 # $Id: Makefile,v 1.24 2003/11/14 22:45:39 aventimiglia Exp $
2 #
3 # CLHP the Common Lisp Hypertext Preprocessor
4 # (C) 2003 Anthony J Ventimiglia
5 #
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
10 #
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #
20 # email: aventimiglia@common-lisp.net
21 # HomePage: http://common-lisp.net/project/clhp/
22
23 # This is where lisp sources will be installed
24 SRCDIR=/usr/lib/cmucl/source/clhp
25
26 # Directory to install the clhp lisp core
27 COREDIR=/usr/lib/cmucl
28
29 # Directory to install documentation
30 DOCDIR=/usr/local/share/clhp
31
32 # path to cmucl
33 LISP=/usr/bin/lisp
34
35 # path to install binary
36 INSTALL=/bin/install
37
38 # path to chmod
39 CHMOD=/bin/chmod
40
41 # path to tar
42 TAR=/bin/tar
43
44 # path to apxs
45 APXS=/usr/sbin/apxs
46
47 DIRMODE=0775 # mode for cmucl dirs
48 FMODE=0664 # mode for installed files
49
50 ############### DO NOT EDIT ANYTHING BELOW THIS LINE ######################
51
52 INSTALLDIR=$(INSTALL) -m $(DIRMODE) -d
53 INSTALLFILE=$(INSTALL) -m $(FMODE)
54
55 LISPC=$(LISP) -noinit -load config/lispc -eval '(make)'
56
57 BUILD_CORE=config/build-core.x86f
58 APACHE_MOD=mod_clhp.so
59 SOURCES=cgi.lisp clhp.lisp package.lisp clhp.asd mod_clhp.c utility.lisp
60 CORE=clhp.core
61 LISPCBIN=config/lispc.x86f
62 DOCS=COPYING INSTALL ChangeLog NEWS README TODO
63
64 DIST_SUBDIRS=config examples
65 NON_DIST_SUBDIRS=tests
66 RECURSIVE_SUBDIRS = tests
67 EXTRADIST=config/build-core.lisp config/lispc.lisp examples/index.clhp \
68 Makefile config/lisp-init.lisp
69
70 NON_DIST= tests/Makefile tests/cgi-test.lisp tests/test-suite.lisp
71
72 CLEAN_TARGETS=$(LISPCBIN) $(CORE) $(CORE).BAK $(TARBALL) \
73 $(APACHE_MOD) mod_clhp.o
74
75 DISTFILES=$(SOURCES) $(DOCS) $(EXTRADIST)
76
77 # This is the version for the next release, during cvs development the
78 # real version number is based on the date of the last change to
79 # clhp.lisp, the only place this version carries in is during
80 # make-dist.
81 #
82 # I've put a nice little trick to make sure tarballs made with make
83 # dist have a cvs-type versioning number. The version here in the
84 # makefile most likeley will not match the cvs version ID in
85 # clhp.lisp, since they depend on their own file's cvs date keyword.
86
87 CVSID=$(shell echo $Date: 2003/11/14 22:45:39 $ | \
88 awk '{print $$2}'| sed s/\\///g )cvs
89
90 VERSION=$(CVSID)
91 #VERSION=0.2.1alpha
92 TARROOT=clhp-$(VERSION)
93 TARBALL=$(TARROOT).tar.gz
94
95 RECURSIVE_TARGETS=clean-recursive clean-all-recursive check-recursive
96
97 all: $(LISPCBIN) $(CORE)
98
99 module:$(APACHE_MOD)
100
101 $(APACHE_MOD): mod_clhp.c
102 $(APXS) -c $<
103
104 .PHONY: all install uninstall clean clean-all clean-backups install-dirs \
105 install-source install-source-dirs uninstall-files uninstall-dirs \
106 install-core clean-dist $(RECURSIVE_TARGETS) check \
107 module-install
108
109 %.x86f: %.lisp
110 $(LISPC) $<
111
112 %.clcgi: %.x86f
113 mv -v $< $@
114
115 check: $(CORE) check-recursive
116
117 $(LISPCBIN): config/lispc.lisp
118
119 $(CORE): $(SOURCES) $(BUILD_CORE)
120 $(LISP) -noinit -load "config/build-core"
121
122 module-install: $(APACHE_MOD)
123 $(APXS) -i -a $<
124
125 install: all install-dirs install-core
126 $(INSTALL) $(DOCS) $(DOCDIR)
127
128 install-core: $(CORE) install-dirs
129 $(INSTALLFILE) -b -S .BAK $(CORE) $(COREDIR)
130
131 install-source: install install-source-dirs
132 for f in $(SOURCES); do \
133 $(INSTALLFILE) $$f $(SRCDIR) ; \
134 done
135
136 install-dirs:
137 $(INSTALLDIR) $(COREDIR)
138 $(INSTALLDIR) $(DOCDIR)
139
140 install-source-dirs:
141 $(INSTALLDIR) $(SRCDIR)
142
143 uninstall: uninstall-files uninstall-dirs
144
145 uninstall-files:
146 for f in $(SOURCES) ; do \
147 if test -f $(SRCDIR)/$$f; then rm -v $(SRCDIR)/$$f ; fi ; \
148 done
149 for f in $(DOCS) ; do \
150 fullpath=$(DOCDIR)/$$f ; \
151 if test -f $$fullpath; then rm -v $$fullpath ; fi ; \
152 done
153 core=$(COREDIR)/$(CORE) ; \
154 if test -f $$core ; then rm -v $$core; fi ; \
155 if test -f $$core.BAK; then mv -v $$core.BAK $$core; fi
156
157 uninstall-dirs: uninstall-files
158 -rmdir -v $(SRCDIR)
159 -rmdir -v $(COREDIR)
160 -rmdir -v $(BINDIR)
161 -rmdir -v $(DOCDIR)
162
163 dist: $(TARBALL) clean-dist
164
165 $(TARBALL): $(DISTFILES)
166 distdir=clhp-$(VERSION) ; \
167 if test ! -d $$distdir; then mkdir -v $$distdir ; fi ; \
168 for dir in $(DIST_SUBDIRS); do \
169 if test ! -d $$distdir/$$dir; then \
170 mkdir -v $$distdir/$$dir ; \
171 fi ; \
172 done ; \
173 for file in $(DISTFILES); do \
174 cp -v $$file $$distdir/$$file ; \
175 done
176 tarfile=$(TARROOT).tar ; \
177 if test -f $$tarfile.gz; then rm -v $$tarfile.gz; fi ; \
178 tar cvf $$tarfile $(TARROOT) ; \
179 gzip $$tarfile
180
181 clean-all: clean-all-recursive clean clean-backups clean-dist
182
183 clean: clean-recursive
184 for f in $(CLEAN_TARGETS); \
185 do \
186 if test -f $$f ; then rm -v $$f ; fi \
187 done
188 find -iname "*.x86f" -exec rm -v {} \;
189 find -iname "*.tar.gz" -exec rm -v {} \;
190
191 clean-backups:
192 find -iname "*~" -exec rm -v {} \;
193
194 clean-dist:
195 if test -d $(TARROOT); then rm -rv $(TARROOT); fi
196
197 $(RECURSIVE_TARGETS):
198 @set fnord $(MAKEFLAGS); amf=$$2 \
199 dot_seen=no ; \
200 target=`echo $@ | sed s/-recursive//`; \
201 list='$(RECURSIVE_SUBDIRS)' ; for subdir in $$list; do \
202 echo ">>>>> Making $$target in $$subdir"; \
203 (cd $$subdir && $(MAKE) $$target) || \
204 case "$$amf" in \
205 *=*) exit 1 ;; \
206 *k*) exit 1 ;; \
207 *) exit 1 ;; \
208 esac ; \
209 done

  ViewVC Help
Powered by ViewVC 1.1.5