Skip to content

Commit 40fb0c7

Browse files
authored
Merge pull request #326 from d0u9/bug/makefile_fix
Reorder targets in Rust's Makefile to make second expansion clearly.
2 parents 6e51134 + 7b8967f commit 40fb0c7

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

rust/Makefile

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,21 +151,11 @@ RUST_LIB_SRC ?= $(rustc_sysroot)/lib/rustlib/src/rust/library
151151
rust-analyzer:
152152
$(Q)$(srctree)/scripts/generate_rust_analyzer.py $(srctree) $(objtree) $(RUST_LIB_SRC) $(objtree)/rust/bindings_generated.rs > $(objtree)/rust-project.json
153153

154-
.SECONDEXPANSION:
155-
$(objtree)/rust/core.o: private skip_clippy = 1
156-
$(objtree)/rust/core.o: $$(RUST_LIB_SRC)/core/src/lib.rs FORCE
157-
$(call if_changed_dep,rustc_library)
158-
159154
$(objtree)/rust/compiler_builtins.o: private rustc_objcopy = -w -W '__*'
160155
$(objtree)/rust/compiler_builtins.o: $(srctree)/rust/compiler_builtins.rs \
161156
$(objtree)/rust/core.o FORCE
162157
$(call if_changed_dep,rustc_library)
163158

164-
$(objtree)/rust/alloc.o: private skip_clippy = 1
165-
$(objtree)/rust/alloc.o: $$(RUST_LIB_SRC)/alloc/src/lib.rs \
166-
$(objtree)/rust/compiler_builtins.o FORCE
167-
$(call if_changed_dep,rustc_library)
168-
169159
$(objtree)/rust/build_error.o: $(srctree)/rust/build_error.rs \
170160
$(objtree)/rust/compiler_builtins.o FORCE
171161
$(call if_changed_dep,rustc_library)
@@ -178,3 +168,14 @@ $(objtree)/rust/kernel.o: $(srctree)/rust/kernel/lib.rs $(objtree)/rust/alloc.o
178168
$(objtree)/rust/build_error.o \
179169
$(objtree)/rust/libmacros.so $(objtree)/rust/bindings_generated.rs FORCE
180170
$(call if_changed_dep,rustc_library)
171+
172+
# Targets that need to expand twice
173+
.SECONDEXPANSION:
174+
$(objtree)/rust/core.o: private skip_clippy = 1
175+
$(objtree)/rust/core.o: $$(RUST_LIB_SRC)/core/src/lib.rs FORCE
176+
$(call if_changed_dep,rustc_library)
177+
178+
$(objtree)/rust/alloc.o: private skip_clippy = 1
179+
$(objtree)/rust/alloc.o: $$(RUST_LIB_SRC)/alloc/src/lib.rs \
180+
$(objtree)/rust/compiler_builtins.o FORCE
181+
$(call if_changed_dep,rustc_library)

0 commit comments

Comments
 (0)