fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1include ../tools.mk 2 3# ignore-cross-compile 4# ignore-msvc FIXME(bjorn3) can't figure out how to link with the MSVC toolchain 5 6TARGET_LIBDIR = $$($(RUSTC) --print target-libdir) 7 8all: 9 $(RUSTC) foo.rs --crate-type bin --emit obj -Cpanic=abort 10ifdef IS_MSVC 11 $(CC) $(CFLAGS) $(TMPDIR)/foo.o $(call OUT_EXE,foo) /link $(TARGET_LIBDIR)/liballoc-*.rlib $(TARGET_LIBDIR)/libcore-*.rlib $(TARGET_LIBDIR)/libcompiler_builtins-*.rlib 12 $(call OUT_EXE,foo) 13else 14 $(CC) $(CFLAGS) $(TMPDIR)/foo.o $(TARGET_LIBDIR)/liballoc-*.rlib $(TARGET_LIBDIR)/libcore-*.rlib $(TARGET_LIBDIR)/libcompiler_builtins-*.rlib -o $(call RUN_BINFILE,foo) 15 $(call RUN_BINFILE,foo) 16endif 17 18 # Check that linking without __rust_no_alloc_shim_is_unstable defined fails 19 $(RUSTC) foo.rs --crate-type bin --emit obj -Cpanic=abort --cfg check_feature_gate 20ifdef IS_MSVC 21 $(CC) $(CFLAGS) $(TMPDIR)/foo.o $(call OUT_EXE,foo) /link $(TARGET_LIBDIR)/liballoc-*.rlib $(TARGET_LIBDIR)/libcore-*.rlib $(TARGET_LIBDIR)/libcompiler_builtins-*.rlib || exit 0 && exit 1 22else 23 $(CC) $(CFLAGS) $(TMPDIR)/foo.o $(TARGET_LIBDIR)/liballoc-*.rlib $(TARGET_LIBDIR)/libcore-*.rlib $(TARGET_LIBDIR)/libcompiler_builtins-*.rlib -o $(call RUN_BINFILE,foo) || exit 0 && exit 1 24endif