-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (48 loc) · 1.14 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
SUBDIR=ex
INIT=init.sh
ANS=answer.sh
CHK=check.sh
TMP=.tmp
SLIDES=slides.pdf
SHELL=sh
FILES := 01-something-to-add/
FILES += 02-learning-to-commit/
FILES += 03-changing-the-past/
FILES += 04-branching-out/
FILES += 05-merging-the-feature/
FILES += 06-conflict-resolution/
ZIPS := $(patsubst %,$(SUBDIR)/%,$(FILES))
ZIPS += $(SUBDIR)/$(SLIDES)
ZIPS += $(SUBDIR)/$(INIT)
ZIPS += $(SUBDIR)/$(ANS)
ZIPS += $(SUBDIR)/$(CHK)
ZIPS += $(SUBDIR)/instructions.txt
CHECKS := $(patsubst %,%/c,$(FILES))
.PHONY: all solve test clean clean-local zip $(SLIDES) check
all: $(FILES) $(SLIDES)
make -C presentation all
$(SLIDES):
make -C presentation handout.pdf
cp presentation/handout.pdf $(SLIDES)
check: $(CHECKS)
clean-local:
rm -rf $(FILES)
rm -f git-in-git.zip
clean: clean-local
make -C presentation clean
zip: all
@echo
@echo == Zipping ==
@unlink $(SUBDIR) || true
@ln -s . $(SUBDIR)
zip -9r git-in-git $(ZIPS) --exclude $(SUBDIR)/$(SUBDIR)
@unlink $(SUBDIR)
%/: clean-local
mkdir $@
$(SHELL) ./$(INIT) $@
%/c: %/
chmod +x $(ANS)
$(SHELL) -c "./$(ANS) $< > $(TMP)"
$(SHELL) -c "cd $<; $(SHELL) ../$(TMP)"
$(SHELL) -c "./$(CHK) $<"
rm $(TMP)