.PHONY: help tests PROJECT := Bg VERSION := 0.0.1 GIT_REPO := ssh://git@git.famcosi.duckdns.org:222/gcordova/bg.git GIT_REF := $(shell git symbolic-ref --short HEAD) GIT_HASH := $(shell git rev-parse --short HEAD) rwildcard = $(foreach d,$(wildcard $1*),$(call rwildcard,$d/$2) $(filter $2,$d)) help: @echo "Project: $(PROJECT) v$(VERSION)" @echo "Repository: $(GIT_REPO)" @echo "Branch: $(GIT_REF) [$(GIT_HASH)]" @echo "" @echo "Usage:" @echo " make [help] - Display this message" @echo " make tests - Run unit tests" tests: $(patsubst %.test,%.stdout,$(call rwildcard,,%.test)) %.stdout: %.test ./$< > $@ 2> $(patsubst %.stdout,%.stderr,$@) \ || (touch --date=@0 $@; false) git diff --exit-code --src-prefix=expected/ --dst-prefix=actual/ \ $@ $(patsubst %.stdout,%.stderr,$@) \ || (touch --date=@0 $@; false) # vim: ai noet ts=8 sw=8: