Skip to content

Commit

Permalink
2019: Rebuild executables whenever library changes
Browse files Browse the repository at this point in the history
With some utilities moving to the reusable library, ensure that the
executables get rebuilt whenever the library is changed.
  • Loading branch information
ericvw committed May 19, 2024
1 parent 81fbb26 commit 5a04238
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions 2019/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,17 @@ srcbindir := $(srcdir)/bin
srcs := $(wildcard $(srcbindir)/puzzle_*$(ext))
answers := $(subst puzzle,answer,$(patsubst %$(ext),%.txt, $(notdir $(srcs))))

intcode_deps := $(wildcard $(srcdir)/*.rs)
library_deps := $(wildcard $(srcdir)/*.rs)

include $(CURDIR)/../mk-common/common.mk

answer_%.txt: $(outputdir)/puzzle_% input_%.txt
$(CARGO) run --profile $(PROFILE) --bin $(basename $(notdir $<)) < $(filter-out $<, $^) | tee $@

.NOTINTERMEDIATE: $(outputdir)/puzzle_%
$(outputdir)/puzzle_%: $(srcbindir)/puzzle_%$(ext)
$(outputdir)/puzzle_%: $(srcbindir)/puzzle_%$(ext) $(library_deps)
$(CARGO) build --profile $(PROFILE) --bin $(basename $(notdir $<))

$(outputdir)/puzzle_02: $(intcode_deps)
$(outputdir)/puzzle_05: $(intcode_deps)
$(outputdir)/puzzle_07: $(intcode_deps)
$(outputdir)/puzzle_09: $(intcode_deps)

.PHONY: lint
lint: lint-code lint-format

Expand Down

0 comments on commit 5a04238

Please sign in to comment.