<commit_before>RES = build/res/b

all: $(RES)

build/aux/build/res/a.cmd: | $(DIRECTORY)
> echo 'echo A; echo I am a > $(call GET_TARGET_PATH,$@)' > $@

build/aux/build/res/b.cmd: build/aux/build/res/a.did_update | $(DIRECTORY)
> echo 'echo B; cat $< > $(call GET_TARGET_PATH,$@);
> echo And I am b >> $(call GET_TARGET_PATH,$@)' > $@

build/res/%: \
  $$(call GET_CMD_PATH,$$@) \
| $(DIRECTORY)
> eval $$(cat $<)

define GET_TARGET_PATH
$(patsubst build/aux/%.cmd,%,$1)
endef

define GET_CMD_PATH
$(patsubst %,build/aux/%.cmd,$1)
endef


build/aux/build/res/a.did_update: \
build/aux/build/res/a.hash.new
>  if [ -f $(<:.hash.new=.hash.old) ];\
   then \
     if ! diff -q $< $(<:.hash.new=.hash.old) > /dev/null; \
     then \
         touch $@; \
     fi; \
   else \
     touch $@; \
   fi; \
   cp $< $(<:.hash.new=.hash.old)


build/aux/%.did_update: \<commit_msg>Command tracking still rebuilds too much<commit_after>RES = build/res/b

all: $(RES)

.PHONY: build/aux/build/res/a.cmd.new
build/aux/build/res/a.cmd.new: | $(DIRECTORY)
> echo 'echo A; echo I am a > $(call GET_TARGET_PATH,$@)' > $@

build/aux/%.cmd.did_update: \
  build/aux/%.cmd.new \
| $(DIRECTORY)
>  if [ -f $(<:.cmd.new=.cmd.old) ];\
   then \
     if ! diff -q $< $(<:.cmd.new=.cmd.old) > /dev/null; \
     then \
         touch $@; \
     fi; \
   else \
     touch $@; \
   fi; \
   cp $< $(<:.cmd.new=.cmd.old)


build/aux/build/res/b.cmd.new: build/aux/build/res/a.did_update | $(DIRECTORY)
> echo 'echo B; cat $< > $(call GET_TARGET_PATH,$@);
> echo And I am b >> $(call GET_TARGET_PATH,$@)' > $@

build/res/%: \
  $$(call GET_CMD_DID_UPDATE,$$@) \
| $$(call GET_CMD_PATH,$$@) \
  $(DIRECTORY)
> eval $$(cat $(firstword $|))

define GET_TARGET_PATH
$(patsubst build/aux/%.cmd.new,%,$1)
endef

define GET_CMD_PATH
$(patsubst %,build/aux/%.cmd.new,$1)
endef

define GET_CMD_DID_UPDATE
$(patsubst %,build/aux/%.cmd.did_update,$1)
endef

build/aux/build/res/a.did_update: \
build/aux/build/res/a.hash.new
>  if [ -f $(<:.hash.new=.hash.old) ];\
   then \
     if ! diff -q $< $(<:.hash.new=.hash.old) > /dev/null; \
     then \
         touch $@; \
     fi; \
   else \
     touch $@; \
   fi; \
   cp $< $(<:.hash.new=.hash.old)


build/aux/%.did_update: \
{'fraction_non_alphanumeric': 0.23300536672629696, 'fraction_numerical': 0.0022361359570661895, 'mean_word_length': 2.679276315789474, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '188184', 'n_tokens_mistral': 991, 'n_tokens_neox': 944, 'n_words': 169}