Makefile 487 B

123456789101112131415161718192021222324
  1. # Makefile to drive tests. You don't need this if you just want to
  2. # use pyzipper yourself.
  3. SRC := $(wildcard demo[0-9])
  4. BIN := $(addsuffix .zip,${SRC})
  5. all: ${BIN}
  6. %.zip: pyzipper Makefile
  7. ${PYTHON} ./pyzipper $(if $(PYTHON),-e $(PYTHON)) -o $@ $*
  8. ./$@
  9. clean:
  10. git clean -dfx
  11. .PHONY: all clean
  12. GIT_LS_TREE := $(shell git ls-tree --name-only -r HEAD)
  13. define DEPENDENCIES
  14. $(1).zip : $$(filter $(1)/%,$${GIT_LS_TREE})
  15. endef
  16. $(foreach S,${SRC},$(eval $(call DEPENDENCIES,$(S))))