aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: dea46295aa10ea6c4db09601d0b8aa803db643cb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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))))