@@ -10,8 +10,8 @@ DEBUG_COMP = # --debug
10
10
# Controls whether Rumble is built as unsafe:
11
11
RUMBLE_UNSAFE_COMP = --unsafe
12
12
13
- COMPILE_FILE = $(SCHEME ) --script compile-file.ss $(UNSAFE_COMP ) $(DEBUG_COMP )
14
- COMPILE_FILE_DEPS = compile-file.ss
13
+ COMPILE_FILE = $(SCHEME ) --script compile-file.ss $(UNSAFE_COMP ) $(DEBUG_COMP ) --dest " $( BUILDDIR ) "
14
+ COMPILE_FILE_DEPS = compile-file.ss include.ss
15
15
16
16
RACKET_SETUP_ARGS = ../../bin/racket ../collects ../etc 0 false
17
17
@@ -20,46 +20,51 @@ PRIMITIVES_TABLES = primitive/kernel.ss primitive/unsafe.ss primitive/flfxnum.ss
20
20
primitive/futures.ss primitive/foreign.ss primitive/place.ss \
21
21
primitive/linklet.ss primitive/internal.ss
22
22
23
+ # Set by the makefile in the "c" directory when driving this one
24
+ BUILDDIR =
25
+
23
26
CONVERT_DEPS = convert.rkt $(PRIMITIVES_TABLES )
24
27
25
- CONVERT = $(RACKET ) -l- raco make convert.rkt && $(RACKET ) convert.rkt $(UNSAFE_COMP )
28
+ CONVERT_RACKET = $(RACKET ) -l- raco make convert.rkt && $(RACKET )
29
+ CONVERT = $(CONVERT_RACKET ) convert.rkt $(UNSAFE_COMP )
26
30
27
- THREAD_DEPS = chezpart.so rumble.so
28
- IO_DEPS = $(THREAD_DEPS ) thread.so
29
- REGEXP_DEPS = $(IO_DEPS ) io.so
30
- SCHEMIFY_DEPS = $(REGEXP_DEPS ) regexp.so
31
- LINKLET_DEPS = $(SCHEMIFY_DEPS ) schemify.so
32
- EXPANDER_DEPS = $(LINKLET_DEPS ) linklet.so
33
- MAIN_DEPS = $(EXPANDER_DEPS ) expander.so
31
+ RUMBLE_DEPS = $(BUILDDIR ) chezpart.so
32
+ THREAD_DEPS = $(RUMBLE_DEPS ) $(BUILDDIR ) rumble.so
33
+ IO_DEPS = $(THREAD_DEPS ) $(BUILDDIR ) thread.so
34
+ REGEXP_DEPS = $(IO_DEPS ) $(BUILDDIR ) io.so
35
+ SCHEMIFY_DEPS = $(REGEXP_DEPS ) $(BUILDDIR ) regexp.so
36
+ LINKLET_DEPS = $(SCHEMIFY_DEPS ) $(BUILDDIR ) schemify.so
37
+ EXPANDER_DEPS = $(LINKLET_DEPS ) $(BUILDDIR ) linklet.so
38
+ MAIN_DEPS = $(EXPANDER_DEPS ) $(BUILDDIR ) expander.so
34
39
35
40
all :
36
41
$(MAKE ) rktio
37
42
$(MAKE ) rktl
38
- $(MAKE ) racket.so
43
+ $(MAKE ) $( BUILDDIR ) racket.so
39
44
40
- expander-demo : expander.so demo/expander.ss
41
- $(SCHEME ) $(EXPANDER_DEPS ) expander.so demo/expander.ss
45
+ expander-demo : $( BUILDDIR ) expander.so demo/expander.ss
46
+ $(SCHEME ) $(EXPANDER_DEPS ) $( BUILDDIR ) expander.so demo/expander.ss
42
47
43
- run : main.so ../../bin/racket
44
- $(SCHEME ) --script main.so $(RACKET_SETUP_ARGS ) $(ARGS )
48
+ run : $( BUILDDIR ) main.so ../../bin/racket
49
+ $(SCHEME ) --script $( BUILDDIR ) main.so $(RACKET_SETUP_ARGS ) $(ARGS )
45
50
46
51
setup :
47
52
$(MAKE ) run ARGS=" -l- setup $( ARGS) "
48
53
49
54
setup-v :
50
55
$(MAKE ) run ARGS=" -W 'info@compiler/cm info@linklet debug@GC:major error' -l- setup $( ARGS) "
51
56
52
- run-wpo : racket.so ../../bin/racket
53
- $(SCHEME ) --script racket.so $(RACKET_SETUP_ARGS ) $(ARGS )
57
+ run-wpo : $( BUILDDIR ) racket.so ../../bin/racket
58
+ $(SCHEME ) --script $( BUILDDIR ) racket.so $(RACKET_SETUP_ARGS ) $(ARGS )
54
59
55
- racket.so : main.so $(COMPILE_FILE_DEPS )
56
- $(COMPILE_FILE ) --whole-program racket.so main.wpo
60
+ $( BUILDDIR ) racket.so : $( BUILDDIR ) main.so $(COMPILE_FILE_DEPS )
61
+ $(COMPILE_FILE ) --whole-program $( BUILDDIR ) racket.so $( BUILDDIR ) main.wpo
57
62
58
- main.so : $(MAIN_DEPS ) main.sps $(COMPILE_FILE_DEPS )
63
+ $( BUILDDIR ) main.so : $(MAIN_DEPS ) main.sps $(COMPILE_FILE_DEPS )
59
64
$(COMPILE_FILE ) main.sps $(MAIN_DEPS )
60
65
61
66
strip :
62
- ${SCHEME} --script strip.ss $(MAIN_DEPS ) racket.so
67
+ ${SCHEME} --script strip.ss $(MAIN_DEPS ) $( BUILDDIR ) racket.so
63
68
64
69
rktl :
65
70
$(MAKE ) thread-rktl
@@ -73,106 +78,101 @@ rktl:
73
78
mkdir -p ../../bin
74
79
touch ../../bin/racket
75
80
76
- expander.so : expander.sls compiled/expander.scm $(PRIMITIVES_TABLES ) $(EXPANDER_DEPS ) $(COMPILE_FILE_DEPS )
81
+ $( BUILDDIR ) expander.so : expander.sls $( BUILDDIR ) compiled/expander.scm $(PRIMITIVES_TABLES ) $(EXPANDER_DEPS ) $(COMPILE_FILE_DEPS )
77
82
$(COMPILE_FILE ) expander.sls $(EXPANDER_DEPS )
78
83
79
- compiled/expander.scm : ../expander/ compiled/expander.rktl $(CONVERT_DEPS )
80
- $(CONVERT ) ../expander/ compiled/expander.rktl compiled/expander.scm
84
+ $( BUILDDIR ) compiled/expander.scm : $( BUILDDIR ) compiled/expander.rktl $(CONVERT_DEPS )
85
+ $(CONVERT ) $( BUILDDIR ) compiled/expander.rktl $( BUILDDIR ) compiled/expander.scm
81
86
82
- ..expander/ compiled/expander.rktl :
83
- $(MAKE ) expander-rktl
87
+ $( BUILDDIR ) compiled/expander.rktl :
88
+ $(MAKE ) expander-rktl BUILDDIR= " ../cs/ "
84
89
85
90
expander-rktl :
86
91
$(MAKE ) bounce BOUNCE_DIR=../expander BOUNCE_TARGET=expander-src
87
92
88
- linklet-demo : linklet.so
89
- $(SCHEME ) $(LINKLET_DEPS ) linklet.so demo/linklet.ss
93
+ linklet-demo : $( BUILDDIR ) linklet.so
94
+ $(SCHEME ) $(LINKLET_DEPS ) $( BUILDDIR ) linklet.so demo/linklet.ss
90
95
91
- linklet.so : linklet.sls $(LINKLET_DEPS ) $(COMPILE_FILE_DEPS )
96
+ $( BUILDDIR ) linklet.so : linklet.sls $(LINKLET_DEPS ) $(COMPILE_FILE_DEPS )
92
97
$(COMPILE_FILE ) linklet.sls $(LINKLET_DEPS )
93
98
94
99
95
- schemify.so : schemify.sls compiled/schemify.scm compiled/known.scm $(SCHEMIFY_DEPS ) $(COMPILE_FILE_DEPS )
100
+ $( BUILDDIR ) schemify.so : schemify.sls $( BUILDDIR ) compiled/schemify.scm $( BUILDDIR ) compiled/known.scm $(SCHEMIFY_DEPS ) $(COMPILE_FILE_DEPS )
96
101
$(COMPILE_FILE ) schemify.sls $(SCHEMIFY_DEPS )
97
102
98
- compiled/schemify.scm : compiled/schemify.rktl $(CONVERT_DEPS )
99
- $(CONVERT ) --skip-export compiled/schemify.rktl compiled/schemify.scm
103
+ $( BUILDDIR ) compiled/schemify.scm : $( BUILDDIR ) compiled/schemify.rktl $(CONVERT_DEPS )
104
+ $(CONVERT ) --skip-export $( BUILDDIR ) compiled/schemify.rktl $( BUILDDIR ) compiled/schemify.scm
100
105
101
- # Ignoring functions from `#%read` works beause they won't appear in
102
- # the simplified expansion. Make annotation references direct to
103
- # improve performance. Declaring "collect.rkt" pure works around a
104
- # limitation of the flattener.
105
- IGNORE = ++knot read - ++direct kernel ++pure ../../collects/racket/private/collect.rkt
106
-
107
- compiled/schemify.rktl :
106
+ $(BUILDDIR ) compiled/schemify.rktl :
108
107
$(MAKE ) schemify-rktl
109
108
110
109
schemify-rktl :
111
- $(RACKET ) -N raco -l- raco make ../expander/bootstrap-run.rkt
112
- $(RACKET ) ../expander/bootstrap-run.rkt -t ../schemify/main.rkt -c compiled/cache-src -k ../.. $(IGNORE ) -s -x -o compiled/schemify.rktl
110
+ $(MAKE ) bounce BOUNCE_DIR=../schemify BOUNCE_TARGET=schemify-src BUILDDIR=" ../cs/"
113
111
114
112
115
113
# Used by schemify.sls at compile time
116
- compiled/known.scm : compiled/known.rktl $(CONVERT_DEPS )
117
- $(CONVERT ) --skip-export compiled/known.rktl compiled/known.scm
114
+ $(BUILDDIR ) compiled/known.scm : $(BUILDDIR ) compiled/known.rktl $(CONVERT_DEPS )
115
+ $(CONVERT ) --skip-export $(BUILDDIR ) compiled/known.rktl $(BUILDDIR ) compiled/known.scm
116
+
117
+ $(BUILDDIR ) compiled/known.rktl :
118
+ $(MAKE ) known-rktl
118
119
119
- compiled/known.rktl : ../schemify/known.rkt
120
- $(RACKET ) -N raco -l- raco make ../expander/bootstrap-run.rkt
121
- $(RACKET ) ../expander/bootstrap-run.rkt -t ../schemify/known.rkt -c compiled/cache-src -k ../.. $(IGNORE ) -s -x -o compiled/known.rktl
120
+ known-rktl :
121
+ $(MAKE ) bounce BOUNCE_DIR=../schemify BOUNCE_TARGET=known-src BUILDDIR=" ../cs/"
122
122
123
123
124
- regexp-demo : regexp.so
125
- $(SCHEME ) $(REGEXP_DEPS ) regexp.so demo/regexp.ss
124
+ regexp-demo : $( BUILDDIR ) regexp.so
125
+ $(SCHEME ) $(REGEXP_DEPS ) $( BUILDDIR ) regexp.so demo/regexp.ss
126
126
127
- regexp.so : compiled/regexp.scm regexp.sls $(REGEXP_DEPS ) $(COMPILE_FILE_DEPS )
127
+ $( BUILDDIR ) regexp.so : $( BUILDDIR ) compiled/regexp.scm regexp.sls $(REGEXP_DEPS ) $(COMPILE_FILE_DEPS )
128
128
$(COMPILE_FILE ) regexp.sls $(REGEXP_DEPS )
129
129
130
- compiled/regexp.scm : ../regexp/ compiled/regexp.rktl $(CONVERT_DEPS )
131
- $(CONVERT ) ../regexp/ compiled/regexp.rktl compiled/regexp.scm
130
+ $( BUILDDIR ) compiled/regexp.scm : $( BUILDDIR ) compiled/regexp.rktl $(CONVERT_DEPS )
131
+ $(CONVERT ) $( BUILDDIR ) compiled/regexp.rktl $( BUILDDIR ) compiled/regexp.scm
132
132
133
- ../regexp/ compiled/regexp.rktl :
133
+ $( BUILDDIR ) compiled/regexp.rktl :
134
134
$(MAKE ) regexp-rktl
135
135
136
136
regexp-rktl :
137
- $(MAKE ) bounce BOUNCE_DIR=../regexp BOUNCE_TARGET=regexp-src
137
+ $(MAKE ) bounce BOUNCE_DIR=../regexp BOUNCE_TARGET=regexp-src BUILDDIR= " ../cs/ "
138
138
139
139
140
- io-demo : io.so
141
- $(SCHEME ) $(IO_DEPS ) io.so demo/io.ss
140
+ io-demo : $( BUILDDIR ) io.so
141
+ $(SCHEME ) $(IO_DEPS ) $( BUILDDIR ) io.so demo/io.ss
142
142
143
- io.so : compiled/io.scm io.sls $(IO_DEPS ) ../io/ compiled/rktio.rktl $(COMPILE_FILE_DEPS )
143
+ $( BUILDDIR ) io.so : $( BUILDDIR ) compiled/io.scm io.sls $(IO_DEPS ) $( BUILDDIR ) compiled/rktio.rktl $(COMPILE_FILE_DEPS )
144
144
$(COMPILE_FILE ) io.sls $(IO_DEPS )
145
145
146
- compiled/io.scm : ../io/ compiled/io.rktl $(CONVERT_DEPS )
147
- $(CONVERT ) ../io/ compiled/io.rktl compiled/io.scm
146
+ $( BUILDDIR ) compiled/io.scm : $( BUILDDIR ) compiled/io.rktl $(CONVERT_DEPS )
147
+ $(CONVERT ) $( BUILDDIR ) compiled/io.rktl $( BUILDDIR ) compiled/io.scm
148
148
149
- ../io/ compiled/io.rktl :
149
+ $( BUILDDIR ) compiled/io.rktl :
150
150
$(MAKE ) io-rktl
151
151
152
- ../io/ compiled/rktio.rktl :
152
+ $( BUILDDIR ) compiled/rktio.rktl :
153
153
$(MAKE ) io-rktl
154
154
155
155
io-rktl :
156
- $(MAKE ) bounce BOUNCE_DIR=../io BOUNCE_TARGET=io-src
156
+ $(MAKE ) bounce BOUNCE_DIR=../io BOUNCE_TARGET=io-src BUILDDIR= " ../cs/ "
157
157
158
158
rktio :
159
159
$(MAKE ) bounce BOUNCE_DIR=../io BOUNCE_TARGET=rktio
160
160
161
161
162
- thread-demo : thread.so
163
- $(SCHEME ) $(THREAD_DEPS ) thread.so demo/thread.ss
162
+ thread-demo : $( BUILDDIR ) thread.so
163
+ $(SCHEME ) $(THREAD_DEPS ) $( BUILDDIR ) thread.so demo/thread.ss
164
164
165
- thread.so : compiled/thread.scm thread.sls $(THREAD_DEPS ) $(COMPILE_FILE_DEPS )
165
+ $( BUILDDIR ) thread.so : $( BUILDDIR ) compiled/thread.scm thread.sls $(THREAD_DEPS ) $(COMPILE_FILE_DEPS )
166
166
$(COMPILE_FILE ) thread.sls $(THREAD_DEPS )
167
167
168
- compiled/thread.scm : ../thread/ compiled/thread.rktl $(CONVERT_DEPS )
169
- $(CONVERT ) ../thread/ compiled/thread.rktl compiled/thread.scm
168
+ $( BUILDDIR ) compiled/thread.scm : $( BUILDDIR ) compiled/thread.rktl $(CONVERT_DEPS )
169
+ $(CONVERT ) $( BUILDDIR ) compiled/thread.rktl $( BUILDDIR ) compiled/thread.scm
170
170
171
- ../thread/ compiled/thread.rktl :
171
+ $( BUILDDIR ) compiled/thread.rktl :
172
172
$(MAKE ) thread-rktl
173
173
174
174
thread-rktl :
175
- $(MAKE ) bounce BOUNCE_DIR=../thread BOUNCE_TARGET=thread-src
175
+ $(MAKE ) bounce BOUNCE_DIR=../thread BOUNCE_TARGET=thread-src BUILDDIR= " ../cs/ "
176
176
177
177
178
178
bounce :
@@ -182,29 +182,29 @@ bounce-go:
182
182
cd $(BOUNCE_DIR ) ; $(MAKE ) RACO=" $( RACKET) -N raco -l- raco" $(BOUNCE_TARGET )
183
183
184
184
185
- chaperone-demo : rumble.so
186
- $(SCHEME ) chezpart.so rumble.so demo/chaperone.ss
185
+ chaperone-demo : $( BUILDDIR ) rumble.so
186
+ $(SCHEME ) $( BUILDDIR ) chezpart.so $( BUILDDIR ) rumble.so demo/chaperone.ss
187
187
188
- hash-demo : rumble.so
189
- $(SCHEME ) chezpart.so rumble.so demo/hash.ss
188
+ hash-demo : $( BUILDDIR ) rumble.so
189
+ $(SCHEME ) $( BUILDDIR ) chezpart.so $( BUILDDIR ) rumble.so demo/hash.ss
190
190
191
- struct-demo : rumble.so
192
- $(SCHEME ) chezpart.so rumble.so demo/struct.ss
191
+ struct-demo : $( BUILDDIR ) rumble.so
192
+ $(SCHEME ) $( BUILDDIR ) chezpart.so $( BUILDDIR ) rumble.so demo/struct.ss
193
193
194
- control-demo : rumble.so
195
- $(SCHEME ) chezpart.so rumble.so demo/control.ss
194
+ control-demo : $( BUILDDIR ) rumble.so
195
+ $(SCHEME ) $( BUILDDIR ) chezpart.so $( BUILDDIR ) rumble.so demo/control.ss
196
196
197
- foreign-demo : rumble.so
198
- $(SCHEME ) chezpart.so rumble.so demo/foreign.ss
197
+ foreign-demo : $( BUILDDIR ) rumble.so
198
+ $(SCHEME ) $( BUILDDIR ) chezpart.so $( BUILDDIR ) rumble.so demo/foreign.ss
199
199
200
- will-demo : rumble.so
201
- $(SCHEME ) chezpart.so rumble.so demo/will.ss
200
+ will-demo : $( BUILDDIR ) rumble.so
201
+ $(SCHEME ) $( BUILDDIR ) chezpart.so $( BUILDDIR ) rumble.so demo/will.ss
202
202
203
- future-demo : rumble.so
204
- $(SCHEME ) chezpart.so rumble.so demo/future.ss
203
+ future-demo : $( BUILDDIR ) rumble.so
204
+ $(SCHEME ) $( BUILDDIR ) chezpart.so $( BUILDDIR ) rumble.so demo/future.ss
205
205
206
- future2-demo : rumble.so
207
- $(SCHEME ) chezpart.so rumble.so demo/future2.ss
206
+ future2-demo : $( BUILDDIR ) rumble.so
207
+ $(SCHEME ) $( BUILDDIR ) chezpart.so $( BUILDDIR ) rumble.so demo/future2.ss
208
208
209
209
RUMBLE_SRCS = rumble/define.ss \
210
210
rumble/virtual-register.ss \
@@ -262,10 +262,10 @@ RUMBLE_SRCS = rumble/define.ss \
262
262
rumble/inline.ss \
263
263
../racket/src/schvers.h
264
264
265
- rumble.so : chezpart.so rumble.sls $(RUMBLE_SRCS ) $(COMPILE_FILE_DEPS )
266
- $(COMPILE_FILE ) $(RUMBLE_UNSAFE_COMP ) rumble.sls
265
+ $( BUILDDIR ) rumble.so : $( RUMBLE_DEPS ) rumble.sls $(RUMBLE_SRCS ) $(COMPILE_FILE_DEPS )
266
+ $(COMPILE_FILE ) $(RUMBLE_UNSAFE_COMP ) rumble.sls $( RUMBLE_DEPS )
267
267
268
- chezpart.so : chezpart.sls $(COMPILE_FILE_DEPS )
268
+ $( BUILDDIR ) chezpart.so : chezpart.sls $(COMPILE_FILE_DEPS )
269
269
$(COMPILE_FILE ) chezpart.sls
270
270
271
271
clean :
0 commit comments