-repo_shell: repo_shell.c inih/ini.c
+MAIN := repo_shell
+# Git derives its version "prefix" from tags
+
+# Add TMI's mkversion to render files xxx.in -> xxx, updating __appVersion__
+# Massage the version coming back because setup.py build to exe only wants
+# versions of the form a.b.c.d. We'll use this to our advantage to cause
+# setup.py to error if the VERSION is either dirty, or if git, not a tag.
+include mkversion.mk
+#$(warning VERSION $(VERSION))
+INFILES := $(shell ls *.in 2>/dev/null)
+INFILES := $(INFILES:%.in=%)
+#$(warning INFILES $(INFILES))
+
+PROGRAMS = $(MAIN) mystrtok_test acl_test
+
+all: $(MAIN)
+
+repo_shell: repo_shell.c inih/ini.c git_acl.c mystrtok.c stra.c utility.c match.c version.c
$(CC) -I inih $^ -o $@
+
+mystrtok_test: mystrtok_test.c mystrtok.c utility.c
+ $(CC) -g $^ -o $@
+
+acl_test: acl_test.c git_acl.c inih/ini.c mystrtok.c stra.c utility.c match.c
+ $(CC) -I inih $^ -o $@
+
+$(INFILES):%: %.in
+ @sed -e 's|__appVersion__|$(VERSION)|g' < $^ > $@-tmp
+ @diff -q $@-tmp $@ >/dev/null 2>&1 && rm -f $@-tmp || mv $@-tmp $@
+
+clean:
+ @rm -rf $(PROGRAMS) $(INFILES)
+
+.PHONY: all clean $(INFILES)