-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
228 lines (191 loc) · 7.61 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
#******************************************************************************
#FILE: Makefile
#LANGUAGE: make
#SYSTEM: UNIX
#USER-INTERFACE: None
#DESCRIPTION
#
# This Makefile tells how to compile the lisp libraries.
#
# Input variables are:
#
# $(PREFIX) where the non-lisp stuff will be installed
# such as in $(PREFIX)/bin/, $(PREFIX)/lib/.
#
#
# It will be created a subdirectory in this
# $(PREFIX) named after the library:
#
#
#AUTHORS
# <PJB> Pascal J. Bourguignon
#MODIFICATIONS
# 2001-06-19 <PJB> Reorganized and simplified.
#LEGAL
# AGPL3
#
# Copyright Pascal J. Bourguignon 2012 - 2016
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
#******************************************************************************
all::
include implementations.mk
help::
@printf 'NOTE: Most of this makefile is obsolete.\n Please use ASDF or QUICKLISP to compile and load these systems.\n'
help::
@for c in $(COMPILERS) ; do printf $(HELP_FMT) "compile-with-$$c" "Compile with $$c." ; done
@printf $(HELP_FMT) 'all' 'Compile with all the available compilers.'
# Let's compile with all the available compilers ( $(GCL) not yet ).
all:: \
compile-with-$(CLISP) \
compile-with-$(ECL) \
compile-with-$(SBCL) \
compile-with-$(OPENMCL) \
compile-with-$(CMUCL) \
compile-with-$(ALLEGRO) \
compile-with-$(ABCL) \
compile-with-$(CCL)
# compile-with-$(CMUCL) breaks on decode-raw-cardinal in bencode...
# compile-with-$(ALLEGRO) fails on posix-regexp out of memory...
# compile-with-$(ABCL) chokes on unicode!
# compile-with-$(CCL) doesn't run from Makefile (it runs well from the shell!).
#PREFIX=/usr/local
#PACKAGES:=$(shell get-directory SHARE_LISP | sed -e 's-/$$--')/packages
PREFIX=$(HOME)/quicklisp/local-projects
PACKAGES=$(PREFIX)
PACKAGE_PATH=com/informatimago
MODULES= announces common-lisp clext clmisc clisp susv3 rdp small-cl-pgms/botihn
help::
@printf $(HELP_FMT) 'show-variables' 'Shows the variables'
show-variables::
@printf $(VAR_FMT) 'Where non-lisp stuff will be installed:' PREFIX "$(PREFIX)"
@printf $(VAR_FMT) 'Where lisp packages are installed.' PACKAGES "$(PACKAGES)"
@printf $(VAR_FMT) 'Subpath for this library.' PACKAGE_PATH "$(PACKAGE_PATH)"
@printf $(VAR_FMT) 'List of sub-modules of this project.' MODULES "$(MODULES)"
.PHONY::show-variables
MM=$(MAKE) $(MFLAGS) PREFIX=$(PREFIX)
clean::
find . \( -name \*.fasl -o -name \*.o -o -name \*.[dl]x64fsl \) -exec rm {} \;
help::
@printf $(HELP_FMT) 'clean' 'Clean in each submodule directory.'
clean::
@for module in $(MODULES) ; do \
if [ -r "$$module/Makefile" ] ; then \
printf $(LINE) ;\
printf ";;;;;; CLEANING $$module\n" ;\
$(MM) MODULE_PATH=$(PACKAGES)/$(PACKAGE_PATH)/$$module -C $$module clean ;\
fi ;\
done
@find . \( -name \*.abcl-tmp \) -exec rm {} \;
@printf $(LINE)
help::
@printf $(HELP_FMT) 'install' 'Install each submodule directory specific stuff,'
@printf $(HELP_FMT_2) 'then copy the whole library to '"$(PACKAGES)/$(PACKAGE_PATH)"
install::
@echo "Obsolete. Use quicklisp."
@exit 1
# @for module in $(MODULES) ; do \
# printf $(LINE) ;\
# printf ";;;;;; INSTALLING STUFF SPECIFIC TO $$module \n" ;\
# $(MM) MODULE_PATH=$(PACKAGES)/$(PACKAGE_PATH)/$$module -C $$module install ;\
# done
# @printf $(LINE)
# @for module in $(MODULES) ; do \
# printf 'Installing the sources to %s\n' "$(PACKAGES)/$(PACKAGE_PATH)/$$module" ;\
# mkdir -p "$(PACKAGES)/$(PACKAGE_PATH)/$$module" || true ;\
# rm -rf "$(PACKAGES)/$(PACKAGE_PATH)/$$module/"* ;\
# tar --exclude \*~ -cf - $$module | tar -C "$(PACKAGES)/$(PACKAGE_PATH)/" -xf - ;\
# done
# @printf $(LINE)
help::
@printf $(HELP_FMT) 'systems' 'Analyses the sources and generates the ASDF systems.'
@printf $(HELP_FMT) 'summaries' 'Analyses the sources and generates the summary.html files.'
systems system system.asd summaries summary summary.html:
@echo not implemented yet
@false
.PHONY::systems system summaries summary
help::
@printf $(HELP_FMT) 'tags' 'Generate the TAGS file, for emacs.'
etags tags TAGS::
find $$(pwd) \( \
-name '[^#.]*.lisp' -o -name '[^#.]*.lsp' -o -name '[^#.]*.cl' \
-o -name '[^#.]*.h' -o -name '[^#.]*.c' -o -name '[^#.]*.m' \
-o -name '[^#.]*.hh' -o -name '[^#.]*.cc' -o -name '[^#.]*.mm' \
\) -print \
| tee -a /dev/stderr -a /dev/stdout \
| etags -
@printf ';; Done.\n'
.PHONY::etags tags TAGS
WEBDOCDIR="$(HOME)/public_html/sites/com.informatimago.www"
help::
@printf $(HELP_FMT) 'doc' 'Generates documentation lispdoc and upload.'
@printf $(HELP_FMT) 'documentation' 'Generates the README.pdf file.'
@printf $(HELP_FMT) 'html' 'Generates the html files.'
@printf $(HELP_FMT) 'lispdoc' "Generates the lispdoc documentation (in $(WEBDOCDIR))."
@printf $(HELP_FMT) 'upload' "Uploads $(WEBDOCDIR) to the web hosting server."
doc:documentation
documentation:readme
readme: README.pdf README.html README.md
doc-upload:documentation lispdoc upload
lispdoc:$(WEBDOCDIR)/develop/lisp/doc
html:: README.html
$(MAKE) $(MFLAGS) -C clext/ html
$(MAKE) $(MFLAGS) -C small-cl-pgms/ html
.PHONY::doc documentation readme doc-upload lispdoc html
$(WEBDOCDIR)/develop/lisp/doc:
$(MAKE) $(MFLAGS) -C lispdoc
upload:
$(MAKE) $(MFLAGS) -C $(WEBDOCDIR) update upload
.PHONY::upload
README.md:README
pandoc -f rst -t markdown_github -o README.md README
README.html:README
( rst2html.py README > out.html && mv out.html README.html ) \
|| ( rst2html README > out.html && mv out.html README.html )
README.pdf:README
rst2pdf README
help::
@printf $(HELP_FMT) 'show-pdfs' 'Opens README.pdf'
showpdf show-pdfs:README.pdf
open README.pdf
.PHONY::showpdf show
help::
@printf $(HELP_FMT) 'quicklisp-tag' 'Update the quicklisp tag on the remote repositories.'
help::
@printf $(HELP_FMT) 'try' 'Try to compile all systems with sbcl and write report.'
try:
$(call eval_with_sbcl,'(progn (load #P"~/quicklisp/setup.lisp") (funcall (find-symbol "QUICKLOAD" "QL") :com.informatimago.tools.try-systems) (funcall (find-symbol "TRY-SYSTEMS" "COM.INFORMATIMAGO.TOOLS.TRY-SYSTEMS")))')
help::
@printf $(HELP_FMT) 'system-index.txt' 'Builds a list of all asd files.'
clean::
-rm -f system-index.txt
system-index.txt:
@find * -name \*.asd | while read line ; do echo "$${#line}:$${line}" ; done | sort -t: -k 1n | awk -F: '{print $$2;}' > system-index.txt
# quicklisp-tag: quicklisp-tag-remove quicklisp-tag-add
#
# quicklisp-tag-remove:
# git tag -d quicklisp
# git push origin :refs/tags/quicklisp
# git push github :refs/tags/quicklisp
# git push gitlab :refs/tags/quicklisp
# git push framasoft :refs/tags/quicklisp
#
# quicklisp-tag-add:
# git tag -f -s quicklisp -m 'current version for quicklisp'
# git push --tags framasoft
# git push --tags gitlab
# git push --tags github
# git push --tags origin
# .PHONY::quicklisp-tag quicklisp-tag-remove quicklisp-tag-add
#### THE END ####