forked from clasp-developers/clasp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
184 lines (134 loc) · 5.17 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
include local.config
export GIT_COMMIT := $(shell cat 'minor-version-id.txt')
export BOOST_BUILD_V2_SOURCE_DIR = boost_build_v2
export BOOST_BUILD_V2_INSTALL = $(CLASP_BUILD_TARGET_DIR)/Contents/boost_build_v2
export BJAM = $(BOOST_BUILD_V2_INSTALL)/bin/bjam --ignore-site-config --user-config= -q
export CLASP_APP_RESOURCES_DIR = $(CLASP_BUILD_TARGET_DIR)/Contents/Resources
export PS1 := $(shell printf 'CLASP-ENV>>[\\u@\\h \\W]$ ')
ifeq ($(TARGET_OS),linux)
export DEVEMACS = emacs -nw ./
else
export DEVEMACS = open -a emacs ./
endif
#
# If the local.config doesn't define PYTHON2 then provide a default
#
ifeq ($(PYTHON2),)
export PYTHON2 = /usr/bin/python
endif
ifeq ($(TARGET_OS),linux)
export EXECUTABLE_DIR=bin
endif
ifeq ($(TARGET_OS),darwin)
export EXECUTABLE_DIR=MacOS
endif
ifneq ($(EXTERNALS_BUILD_TARGET_DIR),)
PATH := $(EXTERNALS_BUILD_TARGET_DIR)/release/bin:$(EXTERNALS_BUILD_TARGET_DIR)/common/bin:$(PATH)
export PATH
endif
export PATH := $(BOOST_BUILD_V2_INSTALL)/bin:$(PATH)
export PATH := $(CLASP_BUILD_TARGET_DIR)/$(EXECUTABLE_DIR):$(PATH)
ifneq ($(CXXFLAGS),)
export USE_CXXFLAGS := cxxflags=$(CXXFLAGS)
endif
ifeq ($(WHAT),)
WHAT = bundle debug release boehm mps
endif
all:
@echo Dumping local.config
cat local.config
git submodule update --init # ensure that the src/mps submodule is updated
-make temporary-fix-for-sicl
make asdf
make boostbuildv2-build
make clasp-boehm
make clasp-mps
# This is a temporary fix until beach fixes some dead links in SICL
temporary-fix-for-sicl:
-rm src/lisp/kernel/contrib/sicl/Code/Boot/Phase2/environment-classes.lisp
-rm src/lisp/kernel/contrib/sicl/Code/Boot/Phase2/environment-constructors.lisp
-rm src/lisp/kernel/contrib/sicl/Code/Boot/Phase2/environment-query.lisp
-rm src/lisp/kernel/contrib/sicl/Code/Boot/Phase2/environment-classes.lisp
-rm src/lisp/kernel/contrib/sicl/Code/Boot/Phase3/environment-classes.lisp
asdf:
(cd src/lisp/kernel/asdf; make)
only-boehm:
git submodule update --init # ensure that the src/mps submodule is updated
make boostbuildv2-build
make clasp-boehm
boehm-build-mps-interface:
git submodule update --init # ensure that the src/mps submodule is updated
make boostbuildv2-build
make clasp-boehm
(cd src/main; make mps-interface)
#
# Tell ASDF where to find the SICL/Code/Cleavir systems - the final // means search subdirs
#
export CL_SOURCE_REGISTRY = $(shell echo `pwd`/src/lisp/kernel/contrib/sicl/Code/Cleavir//)
#
# When developing, set the CLASP_LISP_SOURCE_DIR environment variable
# to tell clasp to use the development source directly rather than the
# stuff in the clasp build target directory. This saves us the trouble of
# constantly having to copy the lisp sources to the target directory.
export DEV_CLASP_LISP_SOURCE_DIR := $(shell echo `pwd`/src/lisp)
devemacs:
@echo This shell sets up environment variables like BJAM
@echo as they are defined when commands execute within the makefile
@echo EXTERNALS_BUILD_TARGET_DIR = $(EXTERNALS_BUILD_TARGET_DIR)
(CLASP_LISP_SOURCE_DIR=$(DEV_CLASP_LISP_SOURCE_DIR) $(DEVEMACS))
devshell:
@echo This shell sets up environment variables like BJAM
@echo as they are defined when commands execute within the makefile
@echo EXTERNALS_BUILD_TARGET_DIR = $(EXTERNALS_BUILD_TARGET_DIR)
(CLASP_LISP_SOURCE_DIR=$(DEV_CLASP_LISP_SOURCE_DIR) bash)
testing:
which clang++
clasp-mps:
(cd src/main; $(BJAM) -j$(PJOBS) $(USE_CXXFLAGS) link=$(LINK) bundle release mps)
(cd src/main; make mps)
# Compile the CL sources for min-mps: and full-mps
cl-mps:
(cd src/main; make mps)
# Compile the CL sources for min-mps: using the existing min-mps: - FAST
cl-min-mps-recompile:
(cd src/main; make min-mps-recompile)
# Compile the CL sources for full-mps:
cl-full-mps:
(cd src/main; make full-mps)
clasp-boehm:
(cd src/main; $(BJAM) -j$(PJOBS) $(USE_CXXFLAGS) link=$(LINK) bundle release boehm)
(cd src/main; make boehm)
# Compile the CL sources for min-boehm: and full-boehm
cl-boehm:
(cd src/main; make boehm)
# Compile the CL sources for min-boehm: using the existing min-boehm: - FAST
cl-min-boehm-recompile:
(cd src/main; make min-boehm-recompile)
# Compile the CL sources for full-boehm:
cl-full-boehm:
(cd src/main; make full-boehm)
boostbuildv2-build:
(cd $(BOOST_BUILD_V2_SOURCE_DIR); ./bootstrap.sh; ./b2 toolset=clang install --prefix=$(BOOST_BUILD_V2_INSTALL) --ignore-site-config)
compile-commands:
(cd src/main; make compile-commands)
clean:
(cd src/main; rm -rf bin bundle)
(cd src/core; rm -rf bin bundle)
(cd src/gctools; rm -rf bin bundle)
(cd src/llvmo; rm -rf bin bundle)
(cd src/asttooling; rm -rf bin bundle)
(cd src/cffi; rm -rf bin bundle)
(cd src/clbind; rm -rf bin bundle)
(cd src/sockets; rm -rf bin bundle)
(cd src/serveEvent; rm -rf bin bundle)
ifneq ($(CLASP_BUILD_TARGET_DIR),)
install -d $(CLASP_BUILD_TARGET_DIR)
-(find $(CLASP_BUILD_TARGET_DIR) -type f -print0 | xargs -0 rm -f)
endif
mps-submodule:
git submodule add -b dev/2014-08-18/non-incremental https://github.com/Ravenbrook/mps-temporary ./src/mps
asdf-submodule:
git submodule add --name updatedAsdf https://github.com/drmeister/asdf.git ./src/lisp/kernel/asdf
git-push-master:
git rev-parse HEAD > minor-version-id.txt
git push origin master