This repository was archived by the owner on Mar 7, 2021. It is now read-only.
File tree 2 files changed +6
-0
lines changed
2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 1
1
obj-m := helloworld.o
2
2
helloworld-objs := hello_world.rust.o
3
3
4
+ # Don't define these if the kernel we're compiling against already has them.
5
+ ifndef CONFIG_RUST
4
6
CARGO ?= cargo
5
7
6
8
$(src ) /target/x86_64-linux-kernel/debug/libhello_world.a : $(src ) /Cargo.toml $(wildcard $(src ) /src/* .rs)
7
9
cd $(src ) ; env -u MAKE -u MAKEFLAGS $(CARGO ) build -Z build-std=core,alloc --target=x86_64-linux-kernel
8
10
9
11
% .rust.o : target/x86_64-linux-kernel/debug/lib% .a
10
12
$(LD ) -r -o $@ --whole-archive $<
13
+ endif
Original file line number Diff line number Diff line change 1
1
obj-m := testmodule.o
2
2
testmodule-objs := $(TEST_NAME ) .rust.o
3
3
4
+ # Don't define these if the kernel we're compiling against already has them.
5
+ ifndef CONFIG_RUST
4
6
CARGO ?= cargo
5
7
6
8
$(src ) /target/x86_64-linux-kernel/debug/lib% .a : $(src ) /$(TEST_PATH ) /Cargo.toml $(wildcard $(src ) /$(TEST_PATH ) /src/* .rs)
7
9
cd $(src ) /$(TEST_PATH ) ; env -u MAKE -u MAKEFLAGS CARGO_TARGET_DIR=../target $(CARGO ) build -Z build-std=core,alloc --target=x86_64-linux-kernel
8
10
9
11
% .rust.o : target/x86_64-linux-kernel/debug/lib% .a
10
12
$(LD ) -r -o $@ --whole-archive $<
13
+ endif
You can’t perform that action at this time.
0 commit comments