fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1include ../tools.mk 2 3# ignore-cross-compile 4 5# Make sure -Zpacked_bundled_libs is compatible with verbatim. 6 7# We're using the llvm-nm instead of the system nm to ensure it is compatible 8# with the LLVM bitcode generated by rustc. 9# Except on Windows where piping/IO redirection under MSYS2 is wonky with llvm-nm. 10ifndef IS_WINDOWS 11NM = "$(LLVM_BIN_DIR)"/llvm-nm 12else 13NM = nm 14endif 15 16all: 17 # Build strange-named dep. 18 $(RUSTC) native_dep.rs --crate-type=staticlib -o $(TMPDIR)/native_dep.ext 19 20 $(RUSTC) rust_dep.rs --crate-type=rlib -Zpacked_bundled_libs 21 $(NM) $(TMPDIR)/librust_dep.rlib | $(CGREP) -e "U.*native_f1" 22 $(AR) t $(TMPDIR)/librust_dep.rlib | $(CGREP) "native_dep.ext" 23 24 # Make sure compiler doesn't use files, that it shouldn't know about. 25 rm $(TMPDIR)/native_dep.ext 26 27 $(RUSTC) main.rs --extern rust_dep=$(TMPDIR)/librust_dep.rlib -Zpacked_bundled_libs