@@ -41,19 +41,14 @@ ifneq ($(strip $(findstring snap,$(MAKECMDGOALS))),)
41
41
SNAP_DEFINES=-DRUST_SNAPSHOT
42
42
endif
43
43
44
+
44
45
define DEF_RUNTIME_TARGETS
45
46
46
47
# #####################################################################
47
48
# Runtime (C++) library variables
48
49
# #####################################################################
49
50
50
- # $(1) is the target triple
51
- # $(2) is the stage number
52
-
53
- RUNTIME_CFLAGS_$(1 ) _$(2 ) = -D_RUST_STAGE$(2 )
54
- RUNTIME_CXXFLAGS_$(1 ) _$(2 ) = -D_RUST_STAGE$(2 )
55
-
56
- RUNTIME_CXXS_$(1 ) _$(2 ) := \
51
+ RUNTIME_CXXS_$(1 ) := \
57
52
rt/sync/timer.cpp \
58
53
rt/sync/lock_and_signal.cpp \
59
54
rt/sync/rust_thread.cpp \
@@ -88,70 +83,70 @@ RUNTIME_CXXS_$(1)_$(2) := \
88
83
rt/rust_android_dummy.cpp \
89
84
rt/rust_test_helpers.cpp
90
85
91
- RUNTIME_CS_$(1 ) _ $( 2 ) := rt/linenoise/linenoise.c rt/linenoise/utf8.c
86
+ RUNTIME_CS_$(1 ) := rt/linenoise/linenoise.c rt/linenoise/utf8.c
92
87
93
- RUNTIME_S_$(1 ) _ $( 2 ) := rt/arch/$$(HOST_$(1 ) ) /_context.S \
94
- rt/arch/$$(HOST_$(1 ) ) /ccall.S \
95
- rt/arch/$$(HOST_$(1 ) ) /record_sp.S
88
+ RUNTIME_S_$(1 ) := rt/arch/$$(HOST_$(1 ) ) /_context.S \
89
+ rt/arch/$$(HOST_$(1 ) ) /ccall.S \
90
+ rt/arch/$$(HOST_$(1 ) ) /record_sp.S
96
91
97
92
ifeq ($$(CFG_WINDOWSY_$(1 ) ) , 1)
98
- LIBUV_OSTYPE_$(1)_$(2) := win
99
- LIBUV_LIB_$(1)_$(2) := rt/$(1 ) /stage $( 2 ) /libuv/libuv.a
93
+ LIBUV_OSTYPE_$(1) := win
94
+ LIBUV_LIB_$(1) := rt/$(1 ) /libuv/libuv.a
100
95
else ifeq ($(OSTYPE_$(1)), apple-darwin)
101
- LIBUV_OSTYPE_$(1)_$(2) := mac
102
- LIBUV_LIB_$(1)_$(2) := rt/$(1 ) /stage $( 2 ) /libuv/libuv.a
96
+ LIBUV_OSTYPE_$(1) := mac
97
+ LIBUV_LIB_$(1) := rt/$(1 ) /libuv/libuv.a
103
98
else ifeq ($(OSTYPE_$(1)), unknown-freebsd)
104
- LIBUV_OSTYPE_$(1)_$(2) := unix/freebsd
105
- LIBUV_LIB_$(1)_$(2) := rt/$(1 ) /stage $( 2 ) /libuv/libuv.a
99
+ LIBUV_OSTYPE_$(1) := unix/freebsd
100
+ LIBUV_LIB_$(1) := rt/$(1 ) /libuv/libuv.a
106
101
else ifeq ($(OSTYPE_$(1)), linux-androideabi)
107
- LIBUV_OSTYPE_$(1)_$(2) := unix/android
108
- LIBUV_LIB_$(1)_$(2) := rt/$(1 ) /stage $( 2 ) /libuv/libuv.a
102
+ LIBUV_OSTYPE_$(1) := unix/android
103
+ LIBUV_LIB_$(1) := rt/$(1 ) /libuv/libuv.a
109
104
else
110
- LIBUV_OSTYPE_$(1)_$(2) := unix/linux
111
- LIBUV_LIB_$(1)_$(2) := rt/$(1 ) /stage $( 2 ) /libuv/libuv.a
105
+ LIBUV_OSTYPE_$(1) := unix/linux
106
+ LIBUV_LIB_$(1) := rt/$(1 ) /libuv/libuv.a
112
107
endif
113
108
114
- RUNTIME_DEF_$(1 ) _ $( 2 ) := rt/rustrt$(CFG_DEF_SUFFIX_$(1 ) )
115
- RUNTIME_INCS_$(1 ) _ $( 2 ) := -I $$(S ) src/rt -I $$(S ) src/rt/isaac -I $$(S ) src/rt/uthash \
109
+ RUNTIME_DEF_$(1 ) := rt/rustrt$(CFG_DEF_SUFFIX_$(1 ) )
110
+ RUNTIME_INCS_$(1 ) := -I $$(S ) src/rt -I $$(S ) src/rt/isaac -I $$(S ) src/rt/uthash \
116
111
-I $$(S ) src/rt/arch/$$(HOST_$(1 ) ) \
117
112
-I $$(S ) src/rt/linenoise \
118
113
-I $$(S ) src/libuv/include
119
- RUNTIME_OBJS_$(1 ) _ $( 2 ) := $$(RUNTIME_CXXS_$(1 ) _ $( 2 ) :rt/%.cpp=rt/$(1 ) /stage $( 2 ) /%.o ) \
120
- $$(RUNTIME_CS_$(1 ) _ $( 2 ) :rt/%.c=rt/$(1 ) /stage $( 2 ) /%.o ) \
121
- $$(RUNTIME_S_$(1 ) _ $( 2 ) :rt/%.S=rt/$(1 ) /stage $( 2 ) /%.o )
122
- ALL_OBJ_FILES += $$(RUNTIME_OBJS_$(1 ) _ $( 2 ) )
114
+ RUNTIME_OBJS_$(1 ) := $$(RUNTIME_CXXS_$(1 ) :rt/%.cpp=rt/$(1 ) /%.o ) \
115
+ $$(RUNTIME_CS_$(1 ) :rt/%.c=rt/$(1 ) /%.o ) \
116
+ $$(RUNTIME_S_$(1 ) :rt/%.S=rt/$(1 ) /%.o )
117
+ ALL_OBJ_FILES += $$(RUNTIME_OBJS_$(1 ) )
123
118
124
- MORESTACK_OBJ_$(1 ) _ $( 2 ) := rt/$(1 ) /stage $( 2 ) /arch/$$(HOST_$(1 ) ) /morestack.o
125
- ALL_OBJ_FILES += $$(MORESTACK_OBJS_$(1 ) _ $( 2 ) )
119
+ MORESTACK_OBJ_$(1 ) := rt/$(1 ) /arch/$$(HOST_$(1 ) ) /morestack.o
120
+ ALL_OBJ_FILES += $$(MORESTACK_OBJS_$(1 ) )
126
121
127
- RUNTIME_LIBS_$(1 ) _ $( 2 ) := $$(LIBUV_LIB_$(1 ) _ $( 2 ) )
122
+ RUNTIME_LIBS_$(1 ) := $$(LIBUV_LIB_$(1 ) )
128
123
129
- rt/$(1 ) /stage $( 2 ) / %.o: rt/%.cpp $$(MKFILE_DEPS )
124
+ rt/$(1 ) /%.o: rt/%.cpp $$(MKFILE_DEPS )
130
125
@$$(call E, compile: $$@ )
131
- $$(Q )$$(call CFG_COMPILE_CXX_$(1 ) , $$@ , $$(RUNTIME_INCS_$(1 ) _ $( 2 ) ) \
132
- $$(SNAP_DEFINES ) $$( RUNTIME_CXXFLAGS_ $( 1 ) _ $( 2 ) ) ) $$<
126
+ $$(Q )$$(call CFG_COMPILE_CXX_$(1 ) , $$@ , $$(RUNTIME_INCS_$(1 ) ) \
127
+ $$(SNAP_DEFINES ) ) $$<
133
128
134
- rt/$(1 ) /stage $( 2 ) / %.o: rt/%.c $$(MKFILE_DEPS )
129
+ rt/$(1 ) /%.o: rt/%.c $$(MKFILE_DEPS )
135
130
@$$(call E, compile: $$@ )
136
- $$(Q )$$(call CFG_COMPILE_C_$(1 ) , $$@ , $$(RUNTIME_INCS_$(1 ) _ $( 2 ) ) \
137
- $$(SNAP_DEFINES ) $$( RUNTIME_CFLAGS_ $( 1 ) _ $( 2 ) ) ) $$<
131
+ $$(Q )$$(call CFG_COMPILE_C_$(1 ) , $$@ , $$(RUNTIME_INCS_$(1 ) ) \
132
+ $$(SNAP_DEFINES ) ) $$<
138
133
139
- rt/$(1 ) /stage $( 2 ) / %.o: rt/%.S $$(MKFILE_DEPS ) \
134
+ rt/$(1 ) /%.o: rt/%.S $$(MKFILE_DEPS ) \
140
135
$$(LLVM_CONFIG_$$(CFG_BUILD_TRIPLE ) )
141
136
@$$(call E, compile: $$@ )
142
137
$$(Q )$$(call CFG_ASSEMBLE_$(1 ) ,$$@ ,$$< )
143
138
144
- rt/$(1 ) /stage $( 2 ) / arch/$$(HOST_$(1 ) ) /libmorestack.a: $$(MORESTACK_OBJ_$(1 ) _ $( 2 ) )
139
+ rt/$(1 ) /arch/$$(HOST_$(1 ) ) /libmorestack.a: $$(MORESTACK_OBJ_$(1 ) )
145
140
@$$(call E, link: $$@ )
146
141
$$(Q )$(AR_$(1 ) ) rcs $$@ $$<
147
142
148
- rt/$(1 ) /stage $( 2 ) / $( CFG_RUNTIME_$(1 ) ) : $$(RUNTIME_OBJS_$(1 ) _ $( 2 ) ) $$(MKFILE_DEPS ) \
149
- $$(RUNTIME_DEF_$(1 ) _ $( 2 ) ) \
150
- $$(RUNTIME_LIBS_$(1 ) _ $( 2 ) )
143
+ rt/$(1 ) /$( CFG_RUNTIME_$(1 ) ) : $$(RUNTIME_OBJS_$(1 ) ) $$(MKFILE_DEPS ) \
144
+ $$(RUNTIME_DEF_$(1 ) ) \
145
+ $$(RUNTIME_LIBS_$(1 ) )
151
146
@$$(call E, link: $$@ )
152
- $$(Q )$$(call CFG_LINK_CXX_$(1 ) ,$$@ , $$(RUNTIME_OBJS_$(1 ) _ $( 2 ) ) \
153
- $$(CFG_GCCISH_POST_LIB_FLAGS_$(1 ) ) $$(RUNTIME_LIBS_$(1 ) _ $( 2 ) ) \
154
- $$(CFG_LIBUV_LINK_FLAGS_$(1 ) ) ,$$(RUNTIME_DEF_$(1 ) _ $( 2 ) ) ,$$(CFG_RUNTIME_$(1 ) ) )
147
+ $$(Q )$$(call CFG_LINK_CXX_$(1 ) ,$$@ , $$(RUNTIME_OBJS_$(1 ) ) \
148
+ $$(CFG_GCCISH_POST_LIB_FLAGS_$(1 ) ) $$(RUNTIME_LIBS_$(1 ) ) \
149
+ $$(CFG_LIBUV_LINK_FLAGS_$(1 ) ) ,$$(RUNTIME_DEF_$(1 ) ) ,$$(CFG_RUNTIME_$(1 ) ) )
155
150
156
151
# FIXME: For some reason libuv's makefiles can't figure out the
157
152
# correct definition of CC on the mingw I'm using, so we are
@@ -170,32 +165,32 @@ endif
170
165
171
166
# XXX: Shouldn't need platform-specific conditions here
172
167
ifdef CFG_WINDOWSY_$(1)
173
- $$(LIBUV_LIB_$(1 ) _ $( 2 ) ) : $$(LIBUV_DEPS )
168
+ $$(LIBUV_LIB_$(1 ) ) : $$(LIBUV_DEPS )
174
169
$$(Q )$$(MAKE ) -C $$(S ) src/libuv/ \
175
- builddir_name=" $$ (CFG_BUILD_DIR)/rt/$( 1) /stage $( 2 ) / libuv" \
170
+ builddir_name=" $$ (CFG_BUILD_DIR)/rt/$( 1) /libuv" \
176
171
OS=mingw \
177
172
V=$$(VERBOSE )
178
173
else ifeq ($(OSTYPE_$(1)), linux-androideabi)
179
- $$(LIBUV_LIB_$(1 ) _ $( 2 ) ) : $$(LIBUV_DEPS )
174
+ $$(LIBUV_LIB_$(1 ) ) : $$(LIBUV_DEPS )
180
175
$$(Q )$$(MAKE ) -C $$(S ) src/libuv/ \
181
176
CFLAGS=" $$ (CFG_GCCISH_CFLAGS) $$ (LIBUV_FLAGS_$$ (HOST_$( 1) )) $$ (SNAP_DEFINES)" \
182
177
LDFLAGS=" $$ (CFG_GCCISH_LINK_FLAGS) $$ (LIBUV_FLAGS_$$ (HOST_$( 1) ))" \
183
178
CC=" $$ (CC_$( 1) )" \
184
179
CXX=" $$ (CXX_$( 1) )" \
185
180
AR=" $$ (AR_$( 1) )" \
186
181
BUILDTYPE=Release \
187
- builddir_name=" $$ (CFG_BUILD_DIR)/rt/$( 1) /stage $( 2 ) / libuv" \
182
+ builddir_name=" $$ (CFG_BUILD_DIR)/rt/$( 1) /libuv" \
188
183
host=android OS=linux \
189
184
V=$$(VERBOSE )
190
185
else
191
- $$(LIBUV_LIB_$(1 ) _ $( 2 ) ) : $$(LIBUV_DEPS )
186
+ $$(LIBUV_LIB_$(1 ) ) : $$(LIBUV_DEPS )
192
187
$$(Q )$$(MAKE ) -C $$(S ) src/libuv/ \
193
188
CFLAGS=" $$ (CFG_GCCISH_CFLAGS) $$ (LIBUV_FLAGS_$$ (HOST_$( 1) )) $$ (SNAP_DEFINES)" \
194
189
LDFLAGS=" $$ (CFG_GCCISH_LINK_FLAGS) $$ (LIBUV_FLAGS_$$ (HOST_$( 1) ))" \
195
190
CC=" $$ (CC_$( 1) )" \
196
191
CXX=" $$ (CXX_$( 1) )" \
197
192
AR=" $$ (AR_$( 1) )" \
198
- builddir_name=" $$ (CFG_BUILD_DIR)/rt/$( 1) /stage $( 2 ) / libuv" \
193
+ builddir_name=" $$ (CFG_BUILD_DIR)/rt/$( 1) /libuv" \
199
194
V=$$(VERBOSE )
200
195
endif
201
196
@@ -234,6 +229,5 @@ endif
234
229
endef
235
230
236
231
# Instantiate template for all stages
237
- $(foreach stage,$(STAGES), \
238
- $(foreach target,$(CFG_TARGET_TRIPLES), \
239
- $(eval $(call DEF_RUNTIME_TARGETS,$(target),$(stage)))))
232
+ $(foreach target,$(CFG_TARGET_TRIPLES), \
233
+ $(eval $(call DEF_RUNTIME_TARGETS,$(target))))
0 commit comments