2023-03-30 07:58:50 -05:00
|
|
|
include ../tools.mk
|
2021-08-12 15:30:40 -05:00
|
|
|
|
|
|
|
INCR=$(TMPDIR)/incr
|
|
|
|
FIRST_SRC=$(TMPDIR)/first_src
|
|
|
|
SECOND_SRC=$(TMPDIR)/second_src
|
|
|
|
|
2021-08-15 15:19:41 -05:00
|
|
|
# ignore-none no-std is not supported
|
|
|
|
# ignore-nvptx64-nvidia-cuda FIXME: can't find crate for 'std'
|
|
|
|
|
2021-08-12 15:30:40 -05:00
|
|
|
# Tests that we don't get an ICE when the working directory
|
|
|
|
# (but not the build directory!) changes between compilation
|
|
|
|
# sessions
|
|
|
|
|
|
|
|
all:
|
|
|
|
mkdir $(INCR)
|
|
|
|
# Build from 'FIRST_SRC'
|
|
|
|
mkdir $(FIRST_SRC)
|
|
|
|
cp my_lib.rs $(FIRST_SRC)/my_lib.rs
|
|
|
|
cp main.rs $(FIRST_SRC)/main.rs
|
|
|
|
cd $(FIRST_SRC) && \
|
2021-08-15 17:37:26 -05:00
|
|
|
$(RUSTC) -C incremental=$(INCR) --crate-type lib my_lib.rs --target $(TARGET) && \
|
|
|
|
$(RUSTC) -C incremental=$(INCR) --extern my_lib=$(TMPDIR)/libmy_lib.rlib main.rs --target $(TARGET)
|
2021-08-12 15:30:40 -05:00
|
|
|
# Build from 'SECOND_SRC', keeping the output directory and incremental directory
|
|
|
|
# the same
|
|
|
|
mv $(FIRST_SRC) $(SECOND_SRC)
|
|
|
|
cd $(SECOND_SRC) && \
|
2021-08-15 17:37:26 -05:00
|
|
|
$(RUSTC) -C incremental=$(INCR) --crate-type lib my_lib.rs --target $(TARGET) && \
|
|
|
|
$(RUSTC) -C incremental=$(INCR) --extern my_lib=$(TMPDIR)/libmy_lib.rlib main.rs --target $(TARGET)
|