Handle reference manual automatically.
[clon.git] / Makefile
blob402c1f36f9564b13b491a7d257175567a6e796d5
1 ### Makefile --- Toplevel directory
3 ## Copyright (C) 2010, 2011 Didier Verna
5 ## Author: Didier Verna <didier@lrde.epita.fr>
6 ## Maintainer: Didier Verna <didier@lrde.epita.fr>
8 ## This file is part of CLon
10 ## Permission to use, copy, modify, and distribute this software for any
11 ## purpose with or without fee is hereby granted, provided that the above
12 ## copyright notice and this permission notice appear in all copies.
14 ## THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
15 ## WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16 ## MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
17 ## ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18 ## WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19 ## ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
20 ## OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 ### Commentary:
25 ## Contents management by FCM version 0.1.
27 ## Please use GNU Make with this makefile.
30 ### Code:
32 TOP_DIR := .
34 include Makefile.cnf
36 hack: all
38 include Makefile.inc
39 include version.inc
42 SUBDIRS := src sbcl clisp \
43 share doc \
44 demos
45 SYSTEMS_DIR := $(SHARE)/common-lisp/systems
46 ASDF_FILE := com.dvlsoft.clon.asd
48 DIST_NAME := clon-$(SHORT_VERSION)
49 TARBALL := $(DIST_NAME).tar.gz
50 SIGNATURE := $(TARBALL).asc
52 install-system:
53 ln -fs "`pwd`/$(ASDF_FILE)" "$(SYSTEMS_DIR)/"
55 all-formats dvi ps ref all-formats-ref dvi-ref ps-ref:
56 cd doc && $(MAKE) $@
58 # Needed because we have an INSTALL file which fucks up the gen mechanism
59 # (remember that Mac OSX is case-insensitive).
60 install:
61 $(MAKE) gen TARGET=install
63 uninstall:
64 -rm -f "$(SYSTEMS_DIR)/$(ASDF_FILE)"
65 $(MAKE) gen TARGET=uninstall
67 clean:
68 -rm *~
69 $(MAKE) gen TARGET=clean
71 # #### NOTE: be sure to propagate to the subdirs first, otherwise, version.inc
72 # will keep on being reconstructed.
73 distclean: clean
74 $(MAKE) gen TARGET=distclean
75 -rm *.tar.gz *.tar.gz.asc
76 -rm -fr version.inc
77 -rm -fr $($(LISP)_BINLOC)-*
78 -rm -fr "${HOME}"/.cache/common-lisp/$($(LISP)_CACHE)-*"`pwd`"
80 tag:
81 git tag -a -m 'Version $(LONG_VERSION)' 'version-$(SHORT_VERSION)'
83 tar: $(TARBALL)
84 gpg: $(SIGNATURE)
85 dist: tar gpg
87 install-www: dist
88 -install -m 644 $(TARBALL) "$(W3DIR)/attic/"
89 -install -m 644 $(SIGNATURE) "$(W3DIR)/attic/"
90 echo "\
91 <? lref (\"clon/attic/clon-$(SHORT_VERSION).tar.gz\", \
92 contents (\"Dernière version\", \"Latest version\")); ?> \
93 | \
94 <? lref (\"clon/attic/clon-$(SHORT_VERSION).tar.gz.asc\", \
95 contents (\"Signature GPG\", \"GPG Signature\")); ?>" \
96 > "$(W3DIR)/latest.txt"
97 chmod 644 "$(W3DIR)/latest.txt"
98 git push --tags "$(W3DIR)/clon.git" :
99 $(MAKE) gen TARGET=install-www
100 cd "$(W3DIR)" \
101 && ln -fs attic/$(TARBALL) latest.tar.gz \
102 && ln -fs attic/$(SIGNATURE) latest.tar.gz.asc
104 update-version:
105 cd doc && $(MAKE) $@
107 gen:
108 @for i in $(SUBDIRS) ; do \
109 echo "making $(TARGET) in $${i} ..." ; \
110 ( cd $${i} && $(MAKE) $(TARGET) ) ; \
111 done
113 $(TARBALL):
114 git archive --format=tar --prefix=$(DIST_NAME)/ \
115 --worktree-attributes HEAD \
116 | gzip -c > $@
118 $(SIGNATURE): $(TARBALL)
119 gpg -b -a $<
121 .DEFAULT:
122 $(MAKE) gen TARGET=$@
124 .PHONY: hack \
125 all-formats dvi ps ref all-formats-ref dvi-ref ps-ref \
126 install-system install install-ref uninstall \
127 clean distclean \
128 tag tar gpg dist install-www \
129 update-version \
133 ### Makefile ends here