aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 5975973ce46445da6df42e1455ee7ead55ac4049 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Makefile to drive tests.  You don't need this if you just want to
# use pyzipper yourself.

SRC := $(wildcard demo[0-9])
BIN := $(addsuffix .zip,${SRC})

all: ${BIN}

%.zip: pyzipper Makefile
	${PYTHON} ./pyzipper $(if $(PYTHON),-e $(PYTHON)) -o $@ $*
	./$@

clean:
	git clean -dfx

.PHONY: all clean

GIT_LS_TREE := $(shell git ls-tree --name-only -r HEAD)

define DEPENDENCIES
$(1).zip : $$(filter $(1)/%,$${GIT_LS_TREE})
endef

$(foreach S,${SRC},$(eval $(call DEPENDENCIES,$(S))))