80 columns formatting fixes.
[clon.git] / Makefile
blob4a7878be7ad31a93932e61627ae1a15a269bc767
1 ### Makefile --- Toplevel directory
3 ## Copyright (C) 2010 Didier Verna
5 ## Author: Didier Verna <didier@lrde.epita.fr>
6 ## Maintainer: Didier Verna <didier@lrde.epita.fr>
7 ## Created: Sun May 31 17:13:07 2009
8 ## Last Revision: Sat Sep 25 18:58:06 2010
10 ## This file is part of CLon
12 ## Clon is free software; you can redistribute it and/or modify
13 ## it under the terms of the GNU General Public License version 3,
14 ## as published by the Free Software Foundation.
16 ## Clon is distributed in the hope that it will be useful,
17 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ## GNU General Public License for more details.
21 ## You should have received a copy of the GNU General Public License
22 ## along with this program; if not, write to the Free Software
23 ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 ### Commentary:
28 ## Contents management by FCM version 0.1.
30 ## Please use GNU Make with this makefile.
33 ### Code:
35 TOP_DIR := .
37 include Makefile.cnf
39 hack: all
41 include Makefile.inc
42 include version.inc
45 SUBDIRS := src sbcl clisp \
46 share doc \
47 demos
48 SYSTEMS_DIR := $(SHARE)/common-lisp/systems
49 ASDF_FILE := com.dvlsoft.clon.asd
51 DIST_NAME := clon-$(SHORT_VERSION)
52 TARBALL := $(DIST_NAME).tar.gz
53 SIGNATURE := $(TARBALL).asc
55 install-system:
56 ln -fs "`pwd`/$(ASDF_FILE)" "$(SYSTEMS_DIR)/"
58 all-formats dvi ps ref all-formats-ref dvi-ref ps-ref:
59 cd doc && $(MAKE) $@
61 # Needed because we have an INSTALL file which fucks up the gen mechanism
62 # (remember that Mac OSX is case-insensitive).
63 install:
64 $(MAKE) gen TARGET=install
66 uninstall:
67 -rm -f "$(SYSTEMS_DIR)/$(ASDF_FILE)"
68 $(MAKE) gen TARGET=uninstall
70 clean:
71 -rm *~
72 $(MAKE) gen TARGET=clean
74 # #### NOTE: be sure to propagate to the subdirs first, otherwise, version.inc
75 # will keep on being reconstructed.
76 distclean: clean
77 $(MAKE) gen TARGET=distclean
78 -rm *.tar.gz *.tar.gz.asc
79 -rm -fr version.inc
80 -rm -fr $($(LISP)_BINLOC)-*
81 -rm -fr "${HOME}"/.cache/common-lisp/$($(LISP)_CACHE)-*"`pwd`"
83 tag:
84 git tag -a -m 'Version $(LONG_VERSION)' 'version-$(SHORT_VERSION)'
86 tar: $(TARBALL)
87 gpg: $(SIGNATURE)
88 dist: tar gpg
90 install-www: dist
91 -install -m 644 $(TARBALL) "$(W3DIR)/attic/"
92 -install -m 644 $(SIGNATURE) "$(W3DIR)/attic/"
93 echo "\
94 <? lref (\"clon/attic/clon-$(SHORT_VERSION).tar.gz\", \
95 contents (\"Dernière version\", \"Latest version\")); ?> \
96 | \
97 <? lref (\"clon/attic/clon-$(SHORT_VERSION).tar.gz.asc\", \
98 contents (\"Signature GPG\", \"GPG Signature\")); ?>" \
99 > "$(W3DIR)/latest.txt"
100 chmod 644 "$(W3DIR)/latest.txt"
101 git push --tags "$(W3DIR)/clon.git" :
102 $(MAKE) gen TARGET=install-www
103 cd "$(W3DIR)" \
104 && ln -fs attic/$(TARBALL) latest.tar.gz \
105 && ln -fs attic/$(SIGNATURE) latest.tar.gz.asc
107 update-version:
108 cd doc && $(MAKE) $@
110 gen:
111 @for i in $(SUBDIRS) ; do \
112 echo "making $(TARGET) in $${i} ..." ; \
113 ( cd $${i} && $(MAKE) $(TARGET) ) ; \
114 done
116 $(TARBALL):
117 git archive --format=tar --prefix=$(DIST_NAME)/ \
118 --worktree-attributes HEAD \
119 | gzip -c > $@
121 $(SIGNATURE): $(TARBALL)
122 gpg -b -a $<
124 .DEFAULT:
125 $(MAKE) gen TARGET=$@
127 .PHONY: hack \
128 all-formats dvi ps ref all-formats-ref dvi-ref ps-ref \
129 install-system install install-ref uninstall \
130 clean distclean \
131 tag tar gpg dist install-www \
132 update-version \
136 ### Makefile ends here