-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
105 lines (91 loc) · 4.46 KB
/
Copy pathMakefile
File metadata and controls
105 lines (91 loc) · 4.46 KB
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
# Makefile for objc.
#
# Targets:
# make test load #:objc/test and run the FiveAM suite (default)
# make test-clean the same, but with no ~/.sbclrc and no site init
# make deps restore ocicl-vendored dependencies
# make repl an SBCL with the library loaded
# make oracle print how to regenerate test/oracle/answers.lisp
# make bench run bench/bench.lisp on SBCL and ECL, merge into bench/RESULTS.md
# make bench-lispworks print how to run the same file in LispWorks
# make clean remove fasls, including the ASDF cache for this tree
#
# LISP overrides the Lisp used (default sbcl). This library is SBCL only: the
# dynamic dispatch in src/abi.lisp is built on sb-alien, for reasons documented
# at the top of that file.
LISP ?= sbcl
# ECL for the benchmark. Stock Homebrew ECL cannot resolve symbols through
# :default (see README, "ECL"); point this at one built from lispnik/ecl.
ECL ?= ecl
.PHONY: all test test-clean deps repl oracle clean \
bench bench-sbcl bench-ecl bench-lispworks bench-compare
all: test
# RUN-TESTS returns the status and the .asd signals on a NIL result; FIVEAM's
# RUN! alone would exit 0 on a failing suite.
test:
$(LISP) --non-interactive \
--eval '(asdf:load-system :objc/test)' \
--eval '(uiop:quit (if (objc/test:run-tests) 0 1))'
# The suite with nothing inherited from the developer's environment: no
# ~/.sbclrc, no site init, source registry built from this tree alone. This is
# what CI sees, and the difference is not academic -- the dump test spawns a
# subprocess that could only find the system because ~/.sbclrc happened to set
# up ocicl, so it passed here and failed on the first CI run.
test-clean:
$(LISP) --non-interactive --no-userinit --no-sysinit \
--eval '(require :asdf)' \
--eval '(asdf:initialize-source-registry `(:source-registry (:tree ,(truename "./")) :ignore-inherited-configuration))' \
--eval '(asdf:load-system :objc/test)' \
--eval '(uiop:quit (if (objc/test:run-tests) 0 1))'
deps:
ocicl install
repl:
$(LISP) --eval '(asdf:load-system :objc)'
# LispWorks Personal cannot be scripted -- -eval is ignored and the heap says
# "Initialization files are not available in the Personal Edition of
# LispWorks" -- so the differential answers are gathered by hand, once, and
# committed. See test/oracle/answers.lisp.
oracle:
@echo "Open the LispWorks IDE, paste test/oracle/probe.lisp into the"
@echo "Listener, and record the output in test/oracle/answers.lisp."
# The benchmark. One file compiled on each Lisp; each run writes
# bench/results/<lisp>.txt and bench-compare merges whatever files exist.
# LispWorks Personal cannot be scripted, so its column is produced by hand
# with the same file -- bench-lispworks prints the two forms to type.
#
# Like test-clean, nothing is inherited from ~/.sbclrc, and the bench fasl
# goes through ASDF's output translations rather than beside the source: so
# LISP=/opt/homebrew/bin/sbcl measures the stock build on a machine whose
# PATH sbcl is a safepoint one, and the two never load each other's fasls.
# A safepoint SBCL writes results/sbcl-safepoint.txt, its own column.
bench: bench-sbcl bench-ecl bench-compare
bench-sbcl:
$(LISP) --non-interactive --no-userinit --no-sysinit \
--eval '(require :asdf)' \
--eval '(asdf:initialize-source-registry `(:source-registry (:tree ,(truename "./")) :ignore-inherited-configuration))' \
--eval '(asdf:load-system :objc)' \
--eval '(load (uiop:compile-file* "bench/bench.lisp"))' \
--eval '(objc-bench:run)'
bench-ecl:
$(ECL) --norc \
--eval '(require :asdf)' \
--eval '(asdf:initialize-source-registry `(:source-registry (:tree ,(truename "./")) :ignore-inherited-configuration))' \
--eval '(asdf:load-system :objc)' \
--eval '(load (uiop:compile-file* "bench/bench.lisp"))' \
--eval '(objc-bench:run)' \
--eval '(ext:quit 0)'
bench-lispworks:
@echo "In a LispWorks Listener, evaluate:"
@echo ' (load (compile-file "$(CURDIR)/bench/bench.lisp"))'
@echo ' (objc-bench:run)'
@echo "then run 'make bench-compare' here."
bench-compare:
$(LISP) --non-interactive --no-userinit --no-sysinit \
--eval '(require :asdf)' \
--eval '(asdf:initialize-source-registry `(:source-registry (:tree ,(truename "./")) :ignore-inherited-configuration))' \
--eval '(asdf:load-system :objc)' \
--eval '(load (uiop:compile-file* "bench/bench.lisp"))' \
--eval '(objc-bench:compare)'
clean:
rm -rf *.fasl bench/*.fasl bench/*.fas bench/*.64yfasl
rm -rf $(HOME)/.cache/common-lisp/*/$(CURDIR)