-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
76 lines (57 loc) · 2.1 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
APP_NAME = icl
VERSION = 0.1
CL = sbcl
LISP_SRC = $(wildcard src/*lisp) \
icl.asd
BUILDDIR = build
LIBS = $(BUILDDIR)/libs.stamp
QLDIR = $(BUILDDIR)/quicklisp
MANIFEST = $(BUILDDIR)/manifest.ql
BUILDAPP = $(BUILDDIR)/bin/buildapp.sbcl
CL_OPTS = --no-sysinit --no-userinit
BUILDAPP_OPTS = --require sb-posix \
--require sb-bsd-sockets \
--require sb-rotate-byte
ICL = $(BUILDDIR)/bin/$(APP_NAME)
all: $(ICL)
clean:
rm -rf $(LIBS) $(QLDIR) $(MANIFEST) $(BUILDAPP) $(ICL)
$(QLDIR)/setup.lisp:
mkdir -p $(BUILDDIR)
curl -o $(BUILDDIR)/quicklisp.lisp https://beta.quicklisp.org/quicklisp.lisp
$(CL) $(CL_OPTS) --load $(BUILDDIR)/quicklisp.lisp \
--eval '(quicklisp-quickstart:install :path "$(BUILDDIR)/quicklisp")' \
--eval '(quit)'
quicklisp: $(QLDIR)/setup.lisp ;
$(LIBS): $(QLDIR)/setup.lisp
$(CL) $(CL_OPTS) --load $(QLDIR)/setup.lisp \
--eval '(push "$(PWD)/" asdf:*central-registry*)' \
--eval '(ql:quickload "icl")' \
--eval '(quit)'
touch $@
libs: $(LIBS) ;
$(MANIFEST): $(LIBS)
$(CL) $(CL_OPTS) --load $(QLDIR)/setup.lisp \
--eval '(ql:write-asdf-manifest-file "$(MANIFEST)")' \
--eval '(quit)'
manifest: $(MANIFEST) ;
$(BUILDAPP): $(QLDIR)/setup.lisp
mkdir -p $(BUILDDIR)/bin
$(CL) $(CL_OPTS) --load $(QLDIR)/setup.lisp \
--eval '(ql:quickload "buildapp")' \
--eval '(buildapp:build-buildapp "$@")' \
--eval '(quit)'
buildapp: $(BUILDAPP) ;
$(ICL): $(MANIFEST) $(BUILDAPP) $(LISP_SRC)
mkdir -p $(BUILDDIR)/bin
$(BUILDAPP) --logfile /tmp/build.log \
$(BUILDAPP_OPTS) \
--sbcl $(CL) \
--asdf-path . \
--manifest-file $(MANIFEST) \
--asdf-tree $(QLDIR)/dists \
--asdf-path . \
--load-system $(APP_NAME) \
--entry icl:main \
--output $@
icl: $(ICL) ;