forked from siliu-tacc/sanitytool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (36 loc) · 2.29 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
VERSION_SRC := Version.py
VDATE := $(shell date +'%F %H:%M')
all:
@echo "done!"
dist:
git archive --prefix=sanityTool-`cat .version`/ master | bzip2 > sanityTool-`cat .version`.tar.bz2
gittag:
ifneq ($(TAG),)
@git status -s > /tmp/gittag$$$$; \
if [ -s /tmp/gittag$$$$ ]; then \
echo "All files not checked in => try again"; \
else \
echo $(TAG) > .version; \
echo 'class Version(object):' >> $(VERSION_SRC); \
echo ' def __init__(self):' >> $(VERSION_SRC); \
echo ' pass' >> $(VERSION_SRC); \
echo ' def tag(self):' >> $(VERSION_SRC); \
echo ' return "$(TAG)"' >> $(VERSION_SRC); \
echo ' def git(self):' >> $(VERSION_SRC); \
echo ' return "@git@"' >> $(VERSION_SRC); \
echo ' def date(self):' >> $(VERSION_SRC); \
echo ' return "$(VDATE)"' >> $(VERSION_SRC); \
echo ' def name(self):' >> $(VERSION_SRC); \
echo ' sA = []' >> $(VERSION_SRC); \
echo ' sA.append(self.tag())' >> $(VERSION_SRC); \
echo ' sA.append(self.git())' >> $(VERSION_SRC); \
echo ' sA.append(self.date())' >> $(VERSION_SRC); \
echo ' return " ".join(sA)' >> $(VERSION_SRC); \
git commit -m "moving to TAG_VERSION $(TAG)" .version $(VERSION_SRC); \
git tag -a $(TAG) -m 'Setting TAG_VERSION to $(TAG)' ; \
git push --tags ; \
fi; \
rm -f /tmp/gittag$$$$
else
@echo "To git tag do: make gittag TAG=?"
endif