@@ -126,7 +126,12 @@ $(BUILD_DIR)/$(RUST_RTS_SO): $(RUST_RTS_PATH)
126126 mkdir -p $(BUILD_DIR ) && \
127127 mv $^ $@
128128
129- $(RUST_RTS_PATH ) : $(RUST_SOURCES )
129+ # The Rust sources are not specified as prerequisites and a FORCE
130+ # prerequisite is used to force unconditional recompilation.
131+ # The reason is that otherwise we're missing recompilations
132+ # due to changes in the Make variables.
133+ # See https://github.com/iu-parfunc/gibbon/issues/244.
134+ $(RUST_RTS_PATH ) : FORCE
130135 cd $(RUST_RTS_DIR ) && \
131136 $(RSC ) build -p gibbon-rts-ng $(RSFLAGS )
132137
@@ -137,8 +142,11 @@ $(BUILD_DIR)/%.o: $(C_RTS_DIR)/%.o
137142 mkdir -p $(BUILD_DIR ) && \
138143 mv $^ $@
139144
140- $(C_RTS_DIR ) /% .o : $(C_RTS_DIR ) /% .c
141- $(CC ) $(CFLAGS ) -c -o $@ $^
145+ # Same as with the Rust part (see above),
146+ # the C sources are not specified as prerequisites and a FORCE
147+ # prerequisite is used to force unconditional recompilation.
148+ $(C_RTS_DIR ) /$(NAME ) .o : FORCE
149+ $(CC ) $(CFLAGS ) -c -o $@ $(C_RTS_DIR ) /$(NAME ) .c
142150
143151$(BUILD_DIR ) /% .h : $(C_RTS_DIR ) /% .h
144152 mkdir -p $(BUILD_DIR ) && \
@@ -150,4 +158,7 @@ $(BUILD_DIR):
150158clean :
151159 rm -rf $(BUILD_DIR ) $(RUST_RTS_DIR ) /target
152160
161+ # See https://www.gnu.org/software/make/manual/make.html#Force-Targets
162+ FORCE :
163+
153164.PHONY : clean
0 commit comments