-
Notifications
You must be signed in to change notification settings - Fork 92
/
Makefile
65 lines (53 loc) · 1.78 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
61
62
63
64
EMACS ?= emacs
DISTRIB_FILES = twittering-mode.el \
README README.ja \
NEWS NEWS.ja \
INSTALL INSTALL.ja \
win-curl \
url-emacs21 \
emacs21
.PHONY: all check clean update-po release release-upload upload
all:
update-po:
$(MAKE) -C doc update-po
check:
./test/run-test.sh -y
clean :
rm -f twittering-mode.elc README *.zip *.tar.gz
VERSION = $$(cat VERSION)
DISTRIB_DIR = twittering-mode-$(VERSION)
README: README.markdown
cp $< $@
release: $(DISTRIB_FILES)
@(! [ -z "$${SF_USERNAME}" ] || (echo "Environmental variable 'SF_USERNAME', which is a username of sf.net, is required."; false))
@echo -n "wrote NEWS file? [y or n]: "; read ans; [ "$${ans}" = "y" ]
@echo -n "What is next version number?: " && \
read version && \
(if [ "$${version}" != "$$(cat VERSION)" ]; then \
mv VERSION LAST-VERSION; \
echo $${version} > VERSION; \
fi) && \
ruby misc/vernum-updater.rb \
--prev-version=$$(cat LAST-VERSION) --next-version=$$(cat VERSION) \
doc/web/index.text
ruby misc/vernum-updater.rb \
--prev-version=HEAD --next-version=$$(cat VERSION) \
twittering-mode.el NEWS NEWS.ja
@([ -d $(DISTRIB_DIR) ] && rm -rf $(DISTRIB_DIR)) || true
mkdir $(DISTRIB_DIR)
cp -r -t $(DISTRIB_DIR)/ $(DISTRIB_FILES)
zip -r $(DISTRIB_DIR).zip $(addprefix $(DISTRIB_DIR)/,$(DISTRIB_FILES))
tar czvf $(DISTRIB_DIR).tar.gz $(addprefix $(DISTRIB_DIR)/,$(DISTRIB_FILES))
rm -rf $(DISTRIB_DIR)
release-upload: release
make upload
upload:
(echo "cd /home/frs/project/t/tw/twmode/"; \
echo "-rm $(DISTRIB_DIR)/*"; \
echo "-rmdir $(DISTRIB_DIR)"; \
echo "mkdir $(DISTRIB_DIR)"; \
echo "cd $(DISTRIB_DIR)"; \
echo "put $(DISTRIB_DIR).zip"; \
echo "put $(DISTRIB_DIR).tar.gz") > upload.bat
sftp -b upload.bat $${SF_USERNAME},[email protected]
rm -f upload.bat