From 02b18bd3ac8420afd821de9555dddc2a89adbf35 Mon Sep 17 00:00:00 2001 From: rexy712 Date: Tue, 20 Apr 2021 11:47:04 -0700 Subject: [PATCH] Combine rust's executable and depfile target. Thanks terrible rust docs for not properly explaining that you can have multiple targets generated on a single invocation --- makefile.basic_rust | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/makefile.basic_rust b/makefile.basic_rust index d5f9444..c4d31e9 100644 --- a/makefile.basic_rust +++ b/makefile.basic_rust @@ -120,14 +120,11 @@ endif flags-update: rustflags-update ldflags-update #Compile all the rust 'crates' -$(MAIN_EXECUTABLE): $(MAIN_SOURCE_FILE) $(LDFLAGS_TMPFILE) $(RUSTFLAGS_TMPFILE) $(MAIN_DEP_FILE) - $(COMPILER) $< $(COMPILE_FLAGS) -o $@ $(ALL_LDFLAGS) +$(MAIN_EXECUTABLE): $(MAIN_SOURCE_FILE) $(LDFLAGS_TMPFILE) $(RUSTFLAGS_TMPFILE) | $(DEPDIR) + $(COMPILER) $< $(COMPILE_FLAGS) $(ALL_LDFLAGS) --emit link=$@ --emit dep-info=$(MAIN_DEP_FILE) ifeq ($(RELEASE),1) $(STRIP) --strip-all "$(MAIN_EXECUTABLE)" endif -#create a dependency tracking file so that the project rebuilds when any dep is updated -$(MAIN_DEP_FILE): $(MAIN_SOURCE_FILE) $(RUSTFLAGS_TMPFILE) | $(DEPDIR) - $(COMPILER) $< --emit dep-info $(COMPILE_FLAGS) -o $@ $(DEPDIR): $(call mkdir,"$(DEPDIR)")