aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@baylibre.com>2024-02-28 22:51:24 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2024-08-01 12:47:19 +0200
commit2340894554334a310b891a1d9e9d5e3f502357ac (patch)
treea1fbe0b2ab48722432d7ff98e2f237ddb33119ed /gcc
parent6fef4d6ffcab0fec8518adcb05458cba5dbeac25 (diff)
downloadgcc-2340894554334a310b891a1d9e9d5e3f502357ac.zip
gcc-2340894554334a310b891a1d9e9d5e3f502357ac.tar.gz
gcc-2340894554334a310b891a1d9e9d5e3f502357ac.tar.bz2
gccrs: Add 'gcc/rust/Make-lang.in:LIBFORMAT_PARSER'
... to avoid verbatim repetition. gcc/rust/ * Make-lang.in (LIBPROC_MACRO_INTERNAL): New. (RUST_LIBDEPS, crab1$(exeext), rust/libformat_parser.a): Use it.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/Make-lang.in12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in
index 8ac0d1d1..bcf424e 100644
--- a/gcc/rust/Make-lang.in
+++ b/gcc/rust/Make-lang.in
@@ -212,6 +212,9 @@ RUST_ALL_OBJS = $(GRS_OBJS) $(RUST_TARGET_OBJS)
rust_OBJS = $(RUST_ALL_OBJS) rust/rustspec.o
LIBPROC_MACRO_INTERNAL = ../libgrust/libproc_macro_internal/libproc_macro_internal.a
+LIBFORMAT_PARSER = rust/libformat_parser.a
+
+RUST_LIBDEPS = $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER)
RUST_LIBDEPS = $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL)
@@ -220,7 +223,7 @@ RUST_LIBDEPS = $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL)
crab1$(exeext): $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(RUST_LIBDEPS) $(rust.prev)
@$(call LINK_PROGRESS,$(INDEX.rust),start)
+$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
- $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBS) $(LIBPROC_MACRO_INTERNAL) rust/libformat_parser.a $(BACKENDLIBS)
+ $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBS) $(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER) $(BACKENDLIBS)
@$(call LINK_PROGRESS,$(INDEX.rust),end)
# Build hooks.
@@ -411,9 +414,10 @@ rust/%.o: rust/lex/%.cc
%.toml:
echo $@
-rust/libformat_parser.a: $(srcdir)/../libgrust/libformat_parser/Cargo.toml $(wildcard $(srcdir)/../libgrust/libformat_parser/src/*.rs)
- cargo build --manifest-path $(srcdir)/../libgrust/libformat_parser/Cargo.toml --release # FIXME: Not always release, right?
- cp $(srcdir)/../libgrust/libformat_parser/target/release/liblibformat_parser.a $@
+# TODO: Improve `cargo` invocation with host specific flags, possibly creating a $(CARGO) variable?
+$(LIBFORMAT_PARSER): $(srcdir)/../libgrust/libformat_parser/Cargo.toml $(wildcard $(srcdir)/../libgrust/libformat_parser/src/*.rs)
+ cd $(srcdir)/../libgrust/libformat_parser && cargo build --offline # FIXME: Not always release, right?
+ cp $(srcdir)/../libgrust/libformat_parser/target/debug/liblibformat_parser.a $@
# build all rust/parse files in rust folder, add cross-folder includes
rust/%.o: rust/parse/%.cc