diff --git a/Makefile b/Makefile index 92899c8..e28ebaa 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,12 @@ SHELL = /bin/bash TARGET = jumpforth SOURCES = $(TARGET).S +EXTRA_DEPS = startup.4th all: $(TARGET) -$(TARGET): $(SOURCES) startup.4th - gcc -m32 -nostdlib -static -o $@ $< +$(TARGET): $(SOURCES) $(EXTRA_DEPS) + gcc -m32 -nostdlib -static -o $@ $(filter-out $(EXTRA_DEPS),$^) clean: test-clean $(RM) $(TARGET) @@ -18,6 +19,14 @@ test: $(TEST_RESULTS) test-clean: $(RM) $(TEST_RESULTS) +test-refresh: $(TEST_RESULTS) + @for act in $^; do \ + exp="$${act%.act}.exp"; \ + if ! diff -q "$$exp" "$$act" >/dev/null; then \ + echo "Refreshing $$exp"; cp -- "$$act" "$$exp"; \ + fi; \ + done + .PHONY: $(TEST_RESULTS) $(TEST_RESULTS): %.act: %.4th $(TARGET) @printf '%s … ' $(notdir $<) && \