stabbish

:)
git clone https://git.sr.ht/~ashymad/stabbish
Log | Files | Refs | README | LICENSE

Makefile (533B)


      1 include ../Makefile
      2 
      3 TESTS=$(patsubst %.test, test.%, $(wildcard *.test))
      4 
      5 .SUFFIXES:
      6 .SECONDARY:
      7 .PHONY: clean all test.%
      8 .DEFAULT_GOAL := all
      9 
     10 all: $(TESTS)
     11 
     12 test.%: %.stab
     13 	$(info $()  TST $@)
     14 	@IN="$$($(<D)/$(<F) input)" || exit 1; \
     15 	 OUT="$$($(<D)/$(<F) output)" || exit 2; \
     16 	 [ "$$IN"  = "$$OUT" ] || exit 3
     17 
     18 %.stab: %.test $(STABBISH)
     19 	$(info $()  GEN $@)
     20 	@echo '"$$@"' | cat $< - | sh -c '. ./$<; process' | cat $(word 2, $^) - > $@
     21 	@chmod +x $@
     22 
     23 clean:
     24 	$(info $()  CLEAN $(shell basename $(shell pwd)))
     25 	@rm -rf *.stab