Makefile 11.2 KB
Newer Older
1
2
3
4
5
6
7
8
9
# Configuring this Makefile for your personal use:
# Set environment variable ASDF_TEST_LISPS to a space-separated list of values
# (see "defaultlisps" below, for an example).
# If you have a special way to find libraries that are used in the build and
# test process, you may bind ASDF_DEVEL_SOURCE_REGISTRY to a source registry to
# use (using the environment variable syntax), or bind it to "override" to use
# your normal CL source registry. Otherwise, it will use local copies of
# everything.

10
system		:= "asdf"
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
webhome_private := common-lisp.net:/project/asdf/public_html/
webhome_public	:= "http://common-lisp.net/project/asdf/"
clnet_home      := "/project/asdf/public_html/"
sourceDirectory := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

#### Common Lisp implementations available for testing.
## export ASDF_TEST_LISPS to override the default list of such implementations,
## or specify a lisps= argument at the make command-line
defaultLisps = ccl clisp sbcl ecl ecl_bytecodes cmucl abcl scl allegro lispworks allegromodern gcl xcl mkcl
ifdef ASDF_TEST_LISPS
lisps ?= ${ASDF_TEST_LISPS}
else
lisps ?= ${defaultLisps}
endif
ifdef ASDF_UPGRADE_TEST_LISPS
  ulisps ?= ${ASDF_UPGRADE_TEST_LISPS}
27
else
28
29
30
31
32
33
34
  ifdef ASDF_TEST_LISPS
    ulisps ?= ${ASDF_TEST_LISPS}
  else
    ulisps ?= ${defaultLisps}
  endif
endif

Robert Goldman's avatar
Robert Goldman committed
35
36
37
38
version := $(shell cat "version.lisp-expr")
#$(info $$version is [${version}])
version := $(patsubst "%",%,$(version))
#$(info $$version is [${version}])
39
fullversion := $(shell git describe --tags --match "[0-9][.][0-9]*" 2> /dev/null || echo $(version))
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

## grep for #+/#- features in the test/ directory to see plenty of disabled tests on some platforms
## NOT SUPPORTED BY OUR AUTOMATED TESTS:
##	cormancl genera lispworks-personal-edition rmcl
## Some are manually tested once in a while.
ifdef ASDF_TEST_SYSTEMS
s ?= ${ASDF_TEST_SYSTEMS}
endif

ifdef ASDF_DEVEL_SOURCE_REGISTRY
ifeq ($(ASDF_DEVEL_SOURCE_REGISTRY), override)
# do nothing... Use the user's CL_SOURCE_REGISTRY
else
export CL_SOURCE_REGISTRY = ${ASDF_DEVEL_SOURCE_REGISTRY}
endif
else # no ASDF_DEVEL_SOURCE_REGISTRY
Robert Goldman's avatar
Robert Goldman committed
56
export CL_SOURCE_REGISTRY = ${sourceDirectory}/:${sourceDirectory}/uiop/:${sourceDirectory}/ext//
57
endif
Robert Goldman's avatar
Robert Goldman committed
58
#$(error "CL_SOURCE_REGISTRY is ${CL_SOURCE_REGISTRY}")
59
60
sys := $(shell uname -s)
ifneq (,$(findstring CYGWIN,$(sys)))
Robert Goldman's avatar
Robert Goldman committed
61
62
63
CL_SOURCE_REGISTRY := $(shell cygpath -pw "${CL_SOURCE_REGISTRY}")
endif

64

65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
l ?= sbcl

ABCL ?= abcl
ALLEGRO ?= alisp
ALLEGROMODERN ?= mlisp
CCL ?= ccl
CLISP ?= clisp
CMUCL ?= cmucl
ECL ?= ecl
GCL ?= gcl
LISPWORKS ?= lispworks
MKCL ?= mkcl
SBCL ?= sbcl
SCL ?= scl
XCL ?= xcl

81
82
83
# If you need to sudo in order to use docker, modify this.
DOCKER ?= docker

84
header_lisp := header.lisp
85
driver_lisp := uiop/package.lisp uiop/common-lisp.lisp uiop/utility.lisp uiop/version.lisp uiop/os.lisp uiop/pathname.lisp uiop/filesystem.lisp uiop/stream.lisp uiop/image.lisp uiop/lisp-build.lisp uiop/launch-program.lisp uiop/run-program.lisp uiop/configuration.lisp uiop/backward-driver.lisp uiop/driver.lisp
86
defsystem_lisp := upgrade.lisp session.lisp component.lisp operation.lisp system.lisp system-registry.lisp action.lisp lisp-action.lisp find-component.lisp forcing.lisp plan.lisp operate.lisp find-system.lisp parse-defsystem.lisp bundle.lisp concatenate-source.lisp package-inferred-system.lisp output-translations.lisp source-registry.lisp backward-internals.lisp backward-interface.lisp interface.lisp user.lisp footer.lisp
87
88
all_lisp := $(header_lisp) $(driver_lisp) $(defsystem_lisp)

Robert Goldman's avatar
Robert Goldman committed
89
90
print-%  : ; @echo $* = $($*)

91
# Making ASDF itself should be our first, default, target:
92
build/asdf.lisp: $(all_lisp)
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
	mkdir -p build
	rm -f $@
	cat $(all_lisp) > $@

ext:
	git submodule update --init

noext:
	git submodule deinit .

# This quickly locates such mistakes as unbalanced parentheses:
load: build/asdf.lisp
	./test/run-tests.sh -t $l $(all_lisp)

install: archive

bump: bump-version
	git commit -a -m "Bump version to $$(eval a=$$(cat version.lisp-expr) ; echo $$a)"
	temp=$$(cat version.lisp-expr); temp="$${temp%\"}"; temp="$${temp#\"}"; git tag $$temp

bump-version: build/asdf.lisp
	./bin/bump-version ${v}

driver-files:
	@echo $(driver_lisp)

defsystem-files:
	@echo $(defsystem_lisp)

# FIXME: needs rewrite
#archive: build/asdf.lisp
#	./bin/asdf-builder make-and-publish-archive
Robert Goldman's avatar
Robert Goldman committed
125

Robert Goldman's avatar
Robert Goldman committed
126
archive: build/asdf.lisp
Robert Goldman's avatar
Robert Goldman committed
127
128
	$(eval UIOPDIR := "uiop-$(version)")
	mkdir -p build/$(UIOPDIR) 	# UIOP tarball
129
	cp -pHux uiop/README.md uiop/uiop.asd uiop/asdf-driver.asd ${driver_lisp} uiop/contrib/debug.lisp build/$(UIOPDIR)
Robert Goldman's avatar
Robert Goldman committed
130
131
132
133
134
135
136
137
	tar zcf "build/uiop-${version}.tar.gz" -C build $(UIOPDIR)
	rm -r build/$(UIOPDIR)
	$(eval ASDFDIR := "asdf-$(version)")
	mkdir -p build/$(ASDFDIR) # asdf-defsystem tarball
	cp -pHux build/asdf.lisp asdf.asd version.lisp-expr header.lisp README.md ${defsystem_lisp} build/$(ASDFDIR)
	tar zcf "build/asdf-defsystem-${version}.tar.gz" -C build $(ASDFDIR)
	rm -r build/$(ASDFDIR)
	git archive --worktree-attributes --prefix="asdf-$(version)/" --format=tar -o "build/asdf-${version}.tar" ${version} #asdf-all tarball
Robert Goldman's avatar
Robert Goldman committed
138
139
	gzip "build/asdf-${version}.tar"
	cp "build/asdf.lisp" "build/asdf-${version}.lisp"
140

Robert Goldman's avatar
Robert Goldman committed
141
publish-archive:
142
	rsync --times --chmod=a+rX,ug+w "build/uiop-${version}.tar.gz" "build/asdf-defsystem-${version}.tar.gz" \
143
144
"build/asdf-${version}.tar.gz" "build/asdf-${version}.lisp" common-lisp.net:/project/asdf/public_html/archives/
	ssh common-lisp.net "cd /project/asdf/public_html/archives/; ln -sf uiop-${version}.tar.gz uiop.tar.gz; ln -sf asdf-defsystem-${version}.tar.gz asdf-defsystem.tar.gz; ln -sf asdf-${version}.tar.gz asdf.tar.gz; ln -sf asdf-${version}.lisp asdf.lisp"
Robert Goldman's avatar
Robert Goldman committed
145

146
147
148
149
150
151
152
153
154
155
156
157
158
### Count lines separately for asdf-driver and asdf itself:
wc:
	@wc $(driver_lisp) | sort -n ; echo ; \
	wc $(header_lisp) $(defsystem_lisp) | sort -n ; \
	echo ; \
	wc $(header_lisp) $(driver_lisp) $(defsystem_lisp) | tail -n 1

push:
	git status
	git push --tags cl.net release master
	git push --tags github release master
	git fetch
	git status
159

Robert Goldman's avatar
Robert Goldman committed
160
161
162
163
164
doc:
	${MAKE} -C doc
# if you don't have the toolchain to build docs installed...
#doc: ;

165
166
website:
	${MAKE} -C doc website
167
	${MAKE} -C uiop/doc website
168

169
170
clean_dirs = $(sourceDirectory)
clean_extensions = fasl dfsl cfsl fasl fas lib dx32fsl lx64fsl lx32fsl ufasl o bak x86f vbin amd64f sparcf sparc64f hpf hp64f
171

172
173
174
175
176
177
178
179
clean:
	@for dir in $(clean_dirs); do \
	     if test -d $$dir; then \
		 echo Cleaning $$dir; \
		 for ext in $(clean_extensions); do \
		     find $$dir \( -name "*.$$ext" \) \
		    -and -not -path \""*/.git/*"\" \
			  -and -not -path \""*/_darcs/*"\" \
Robert P. Goldman's avatar
Robert P. Goldman committed
180
			  -and -not -path \""*/tags/*"\" -delete; \
181
182
		done; \
	     fi; \
183
	    echo "Cleaned $$dir"; \
184
	done
185
	echo "Done with cleaning loop."
186
187
188
	rm -rf build/ LICENSE test/try-reloading-dependency.asd test/hello-world-example asdf.lisp
	rm -rf test/hello-world-example.exe test/mkcl_*.dll # needed only on MS-Windows
	${MAKE} -C doc clean
189
	${MAKE} -C uiop/doc clean
190

191
192
mrproper:
	git clean -xfd
193

194
test-upgrade: build/asdf.lisp show-version
195
196
197
	./test/run-tests.sh -u ${l}
u: test-upgrade

198
test-clean-load: build/asdf.lisp show-version
199
200
	./test/run-tests.sh -c ${l}

201
202
203
show-version:
	@echo "Building and testing asdf $(fullversion)"

204
# test-glob has been replaced by t, and lisp by l, easier to type
205
test-lisp: build/asdf.lisp show-version
206
	@cd test; ./run-tests.sh ${l} ${t}
207

208
209
t: test-lisp

210
211
212
213
214
215
216
217
218
# Useful for reproducing test failures with Docker.
test-docker-repl:
	@${DOCKER} run --rm -i -t --pull always -u $(shell id -u):$(shell id -g) -v $(sourceDirectory):$(sourceDirectory) -w $(sourceDirectory)/test clfoundation/${l}:latest

test-docker-lisp: build/asdf.lisp show-version
	@${DOCKER} run --rm -i -t --pull always -u $(shell id -u):$(shell id -g) -v $(sourceDirectory):$(sourceDirectory) -w $(sourceDirectory) clfoundation/${l}:latest make test-lisp l=${l} t=${t}

td: test-docker-lisp

Robert Goldman's avatar
Robert Goldman committed
219
test: test-lisp test-clean-load test-load-systems
220

221
test-load-systems: build/asdf.lisp show-version
222
223
224
225
226
227
228
229
	./test/run-tests.sh -l ${l} ${s}

test-all-lisps: test-load-systems test-all-clean-load test-all-lisp test-all-upgrade

test-all-clean-load:
	@for lisp in ${lisps} ; do ${MAKE} test-clean-load l=$$lisp || exit 1 ; done

test-all-lisp:
230
	@for lisp in ${lisps} ; do ${MAKE} test-lisp l=$$lisp t=${t}|| exit 1 ; done
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297

test-all-upgrade:
	@for lisp in ${ulisps} ; do ${MAKE} test-upgrade l=$$lisp || exit 1 ; done

test-all-no-upgrade: doc test-load-systems test-all-clean-load test-all-lisp

test-all: test-all-no-upgrade test-all-upgrade

test-all-lisp-no-stop:
	@for lisp in ${lisps} ; do ${MAKE} test-lisp l=$$lisp ; done ; :

test-all-upgrade-no-stop:
	@for lisp in ${ulisps} ; do ${MAKE} test-upgrade l=$$lisp ; done ; :

test-all-no-upgrade-no-stop: doc test-load-systems test-all-clean-load test-all-lisp-no-stop
	make --quiet check-all-test-results

test-all-no-stop: doc test-load-systems test-all-clean-load test-all-lisp-no-stop test-all-upgrade-no-stop
	make --quiet check-all-results

check-all-test-results:
	@A="`grep -L '[5-9][0-9] passing and 0 failing' build/results/*-test.text`" ; \
	if [ -n "$$A" ] ; then \
		echo "Unexpected test failures on these implementations:" ; \
		echo "$$A" ; \
		exit 1 ; \
	fi

check-all-upgrade-results:
	@A="`grep -L 'Upgrade test succeeded for ' build/results/*-upgrade.text`" ; \
	if [ -n "$$A" ] ; then \
		echo "Unexpected upgrade failures on these implementations:" ; \
		echo "$$A" ; \
		exit 1 ; \
	fi

check-all-results:
	@r=0 ; \
	make --quiet check-all-test-results || r=1 ; \
	make --quiet check-all-upgrade-results || r=1 ; \
	exit $r

extract: extract-all-tagged-asdf
extract-all-tagged-asdf: build/asdf.lisp
	./test/run-tests.sh -H


# Delete wrongful tags from local repository
fix-local-git-tags:
	for i in ${WRONGFUL_TAGS} ; do git tag -d $$i ; done

# Delete wrongful tags from remote repository
fix-remote-git-tags:
	for i in ${WRONGFUL_TAGS} ; do git push $${REMOTE:-cl.net} :refs/tags/$$i ; done

release-push:
	git checkout master
	git merge release
	git checkout release
	git merge master
	git checkout master

TODO:
	exit 2

release: TODO test-all test-on-other-machines-too debian-changelog debian-package send-mail-to-mailing-lists

298
.PHONY: install archive push doc website clean mrproper show-version \
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
	test-forward-references test test-lisp test-upgrade test-forward-references \
	test-all test-all-lisps test-all-no-upgrade \
	debian-package release \
	replace-sbcl-asdf replace-ccl-asdf \
	fix-local-git-tags fix-remote-git-tags wc wc-driver wc-asdf \
	list-source-registry \
	ext noext

# debug the source registry that will be used to execute commands from this Makefile.
#list-source-registry:
#	${sourceDirectory}/bin/asdf-builder re '(uiop:writeln (sort (alexandria:hash-table-alist asdf::*source-registry*) `string< :key `car))'

# RELEASE or PUSH checklist:
# make test-all
# make test-load-systems s=fare-all
# make bump v=3.0
# edit debian/changelog # RELEASE only...
# git commit
# git tag 3.0 # for example ...
# make debian-package
# git push
# git push origin 3.0 # for example...
# everything from here for RELEASE only
# make release-push archive website debian-package
# dput mentors ../*.changes
# send debian mentors request
# send announcement to asdf-announce, asdf-devel, etc.
# Move all fixed bugs from Fix Committed -> Fix Released on launchpad
#
## Users don't release as above, only maintainers do.
## Users, all you need to do is: make
## Vendors, you may want to test your implementation with: make test l=sbcl