4 ms·
Doesn’t mean you can’t maintain the database with Make :) Prototype: .FORCE: .PRECIOUS: .sha256/sum/% .sha256/tmp/%: % .sha256/tmp .FORCE sha25
by mananaysiempre 4y ago
Doesn’t mean you can’t maintain the database with Make :) Prototype:
.FORCE:
.PRECIOUS: .sha256/sum/%
.sha256/tmp/%: % .sha256/tmp .FORCE
sha256sum < $< > $@
.sha256/sum/%: .sha256/tmp/% .sha256/sum
cmp $< $@ >/dev/null 2>&1 || mv $< $@
.sha256/tmp .sha256/sum:
mkdir -p $@
.SUFFIXES:
%.o: .sha256/sum/%.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $*.c
I expect you could get rid of most of the non-POSIX features by using more complex recipes, probably exiling them into separate shell scripts. (The main limitation is that V7/POSIX/BSD-style suffix rules don’t let you specify a rule for producing ANYTHING.foo from ANYTHING, whereas V8/GNU-style pattern rules do.)