-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (46 loc) · 1.12 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
60
#
# Makefile
#
# code: lang=makefile tabsize=4
#
UNOCONV = /usr/bin/unoconv -vf
CP = /bin/cp
TOUCH = /usr/bin/touch
GIT = /usr/bin/git
SRC_PT = alexei.odt
SRC_EN = alexei-english.odt
SRC = $(SRC_PT) $(SRC_EN)
OUT_PT = alexei.pdf alexei.doc
OUT_EN = alexei-english.pdf alexei-english.doc
OUT = $(OUT_PT) $(OUT_EN)
DBOX_DIR = $(HOME)/Dropbox/Public/CV
DBOX_OUT = $(DBOX_DIR)/alexei.odt \
$(DBOX_DIR)/alexei.doc \
$(DBOX_DIR)/alexei.pdf \
$(DBOX_DIR)/alexei-english.odt \
$(DBOX_DIR)/alexei-english.pdf \
$(DBOX_DIR)/alexei-english.doc
all: cv git
cv: cv_pt cv_en
cv_pt: $(OUT_PT)
$(OUT_PT): $(SRC_PT)
$(UNOCONV) doc $(SRC_PT)
$(UNOCONV) pdf $(SRC_PT)
cv_en: $(OUT_EN)
$(OUT_EN): $(SRC_EN)
$(UNOCONV) doc $(SRC_EN)
$(UNOCONV) pdf $(SRC_EN)
git:
@if [ -n "`$(GIT) status -s`" ]; then \
$(GIT) pull; \
$(GIT) add $(SRC) $(OUT); \
$(GIT) commit $(SRC) $(OUT) \
-m "Semi-automatic commit at `date +%Y.%m.%d-%H.%M.%S`"; \
$(GIT) push; \
fi
dropbox: $(DBOX_OUT)
$(DBOX_OUT): $(OUT_PT) $(OUT_EN)
$(CP) $(SRC_PT) $(OUT_PT) $(SRC_EN) $(OUT_EN) $(DBOX_DIR)
force:
$(TOUCH) $(SRC)
$(MAKE)