fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
813 B32 linesraw
1# ignore-cross-compile
2# needs-unwind
3include ../tools.mk
4
5all: archive
6	# Compile `main.rs`, which will link into our library, and run it.
7	$(RUSTC) main.rs
8	$(call RUN,main)
9
10ifdef IS_MSVC
11archive: add.o panic.o
12	# Now, create an archive using these two objects.
13	$(AR) crus $(TMPDIR)/add.lib $(TMPDIR)/add.o $(TMPDIR)/panic.o
14else
15archive: add.o panic.o
16	# Now, create an archive using these two objects.
17	$(AR) crus $(TMPDIR)/libadd.a $(TMPDIR)/add.o $(TMPDIR)/panic.o
18endif
19
20# Compile `panic.rs` into an object file.
21#
22# Note that we invoke `rustc` directly, so we may emit an object rather
23# than an archive. We'll do that later.
24panic.o:
25	$(BARE_RUSTC) $(RUSTFLAGS)  \
26		--out-dir $(TMPDIR) \
27		--emit=obj panic.rs
28
29# Compile `add.c` into an object file.
30add.o:
31	$(call COMPILE_OBJ,$(TMPDIR)/add.o,add.c)
32