author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Fri, 13 Jan 2012 23:29:39 +0200 | |
changeset 120 | cb5ab06a72a7 |
parent 119 | 20f1d1080886 |
child 121 | 38e8a1063673 |
permissions | -rw-r--r-- |
85
0ff3715e6176
To build dictionary you need to install...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
68
diff
changeset
|
1 |
# To build dictionary you need to install: |
0ff3715e6176
To build dictionary you need to install...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
68
diff
changeset
|
2 |
# |
0ff3715e6176
To build dictionary you need to install...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
68
diff
changeset
|
3 |
# $ sudo apt-get install dictfmt |
0ff3715e6176
To build dictionary you need to install...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
68
diff
changeset
|
4 |
# |
22
0616adf6e983
Describe available build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
5 |
# Available target: |
0616adf6e983
Describe available build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
6 |
# |
0616adf6e983
Describe available build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
7 |
# all build dictionaries |
0616adf6e983
Describe available build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
8 |
# install install dictionaries, so they been available in stardict, may require root permission |
0616adf6e983
Describe available build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
9 |
# uninstall remove dictionaries, they been unavailable in stardict, may require root permission |
0616adf6e983
Describe available build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
10 |
# install-local install dictionaries in user HOME dir, so they been available in stardict for that user |
0616adf6e983
Describe available build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
11 |
# uninstall-local remove dictionaries from user HOME directory |
26
6dfc4ac2dc80
Back targets that allow make symlink to dictionaries install dir from user HOME dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
23
diff
changeset
|
12 |
# install-local-symlink create symlink from installed dir to user HOME dir, so dictionaries been available in stardict |
6dfc4ac2dc80
Back targets that allow make symlink to dictionaries install dir from user HOME dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
23
diff
changeset
|
13 |
# uninstall-local-symlink remove symlink from user HOME directory |
118
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
14 |
# |
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
15 |
# You can override such variables in Makefile.config: |
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
16 |
# |
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
17 |
# SF_USER SourceForge user name |
22
0616adf6e983
Describe available build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
18 |
|
36
6fee90eb2d85
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
19 |
SHELL = /bin/sh |
6fee90eb2d85
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
20 |
export PATH := /bin:/usr/bin:${PATH} |
6fee90eb2d85
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
21 |
|
6fee90eb2d85
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
22 |
# Disable built in pattern rules. |
6fee90eb2d85
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
23 |
MAKEFLAGS += -r |
6fee90eb2d85
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
24 |
# Disable built in variables. |
6fee90eb2d85
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
25 |
MAKEFLAGS += -R |
6fee90eb2d85
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
26 |
# Disable built in suffix rules. |
6fee90eb2d85
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
27 |
.SUFFIXES: |
6fee90eb2d85
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
28 |
# Default target. |
106
092b25d032af
Set 'help' as default target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
105
diff
changeset
|
29 |
.DEFAULT_GOAL = help |
36
6fee90eb2d85
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
30 |
|
54 | 31 |
################################################################ |
118
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
32 |
# Build script definitions. |
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
33 |
|
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
34 |
BUILD_SCRIPT := $(firstword $(MAKEFILE_LIST)) |
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
35 |
|
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
36 |
ifneq '' '$(wildcard Makefile.config)' |
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
37 |
include Makefile.config |
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
38 |
BUILD_SCRIPT += Makefile.config |
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
39 |
endif |
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
40 |
|
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
41 |
################################################################ |
103 | 42 |
# Version extracting/generation. |
43 |
||
44 |
# Prevent from deploying and distributing with wrong version. |
|
45 |
ifneq '' '$(filter deploy%,$(MAKECMDGOALS))' |
|
46 |
ifeq '' '$(MAKE_RESTARTS)' |
|
47 |
$(info $(shell rm VERSION)) |
|
48 |
endif |
|
49 |
endif |
|
50 |
||
51 |
# Here are vmajor and vminor. Look README section "Versioning rules." |
|
52 |
-include VERSION |
|
53 |
||
54 |
VERSION: |
|
55 |
ver=$$(hg log -r . --template '{latesttag}'); \ |
|
56 |
ver=$${ver#t}; \ |
|
57 |
major=$${ver%.*}; \ |
|
58 |
minor=$${ver#*.}; \ |
|
59 |
printf "vmajor=%s\nvminor=%s\n" $$major $$minor >VERSION |
|
60 |
# is_release=`hg log --template '{latesttagdistance}'` |
|
61 |
||
62 |
################################################################ |
|
106
092b25d032af
Set 'help' as default target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
105
diff
changeset
|
63 |
# Determine platform/environment. |
66 | 64 |
|
65 |
host_os = unix |
|
66 |
ifneq '' '$(COMSPEC)' |
|
67 |
ifneq '' '$(WINDIR)' |
|
68 |
# Probably under Windows. |
|
69 |
host_os = windows |
|
107
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
70 |
ifneq '' '$(wildcard /etc/setup/*cygwin*)' |
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
71 |
# Probably under Cygwin. |
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
72 |
host_os = cygwin |
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
73 |
endif |
66 | 74 |
endif |
75 |
endif |
|
76 |
||
77 |
################################################################ |
|
107
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
78 |
# Build tools definition/switches. |
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
79 |
|
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
80 |
RST_WARNING_FLAGS := --halt warning |
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
81 |
RST_FLAGS := --strip-comments |
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
82 |
RST_FLAGS += $(RST_WARNING_FLAGS) |
66 | 83 |
|
107
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
84 |
RST2HTML := rst2html |
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
85 |
ifeq '$(host_os)' 'cygwin' |
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
86 |
RST2HTML := rst2html.py |
66 | 87 |
endif |
107
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
88 |
RST2HTML_FLAGS := $(RST_FLAGS) |
66 | 89 |
|
90 |
################################################################ |
|
54 | 91 |
# Install paths. |
0 | 92 |
|
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
93 |
ifeq '$(origin prefix)' 'undefined' |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
94 |
ifeq '$(shell id -u)' '0' |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
95 |
prefix = /usr/local |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
96 |
else |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
97 |
prefix = $(HOME)/usr |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
98 |
endif |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
99 |
endif |
0 | 100 |
datarootdir = $(prefix)/share |
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
101 |
datadir = $(datarootdir)/dictd |
0 | 102 |
|
54 | 103 |
################################################################ |
66 | 104 |
# Project dirs/files. |
21
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
105 |
|
50
37931fbb857f
Switch from ambiguous extension to unambiguous.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
46
diff
changeset
|
106 |
C5_FILES := $(wildcard *.dict-c5) |
37931fbb857f
Switch from ambiguous extension to unambiguous.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
46
diff
changeset
|
107 |
DICT_FILES := $(C5_FILES:.dict-c5=.dict) |
37931fbb857f
Switch from ambiguous extension to unambiguous.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
46
diff
changeset
|
108 |
DICTDZ_FILES := $(C5_FILES:.dict-c5=.dict.dz) |
37931fbb857f
Switch from ambiguous extension to unambiguous.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
46
diff
changeset
|
109 |
INDEX_FILES := $(C5_FILES:.dict-c5=.index) |
1
b23e948de24a
Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
110 |
|
66 | 111 |
RST_FILES := $(wildcard *.rst) |
112 |
HTML_FILES := $(RST_FILES:.rst=.html) |
|
113 |
||
119
20f1d1080886
Rename 'name' ==> 'pkgname'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
118
diff
changeset
|
114 |
pkgname = gadict |
20f1d1080886
Rename 'name' ==> 'pkgname'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
118
diff
changeset
|
115 |
fullpkgname = $(pkgname)-$(vmajor).$(vminor) |
103 | 116 |
|
117 |
DIST_DIR = $(fullpkgname) |
|
118 |
DISTSRC_DIR = $(fullpkgname)_src |
|
119 |
||
120 |
DIST_FILES = $(DICTDZ_FILES) $(INDEX_FILES) $(HTML_FILES) $(RST_FILES) VERSION |
|
121 |
||
122 |
DISTSRC_HELPER_FILES = VERSION Makefile rst.css .dir-locals.el |
|
123 |
DISTSRC_FILES = $(HTML_FILES) $(RST_FILES) $(DISTSRC_HELPER_FILES) |
|
124 |
||
111
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
125 |
DIST_TARBALLS = $(DIST_DIR).tar.gz $(DIST_DIR).tar.bz2 |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
126 |
DISTSRC_TARBALLS = $(DISTSRC_DIR).tar.gz $(DISTSRC_DIR).tar.bz2 |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
127 |
|
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
128 |
################################################################ |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
129 |
# Deploy targets. |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
130 |
|
118
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
131 |
ifeq '' '$(SF_USER)' |
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
132 |
SF_USER := gavenkoa |
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
133 |
endif |
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
134 |
|
111
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
135 |
.PHONY: deploy |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
136 |
deploy: deploy2sf |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
137 |
|
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
138 |
# First time you deploy to SourceForge (sf) you need manually login to: |
120
cb5ab06a72a7
Inline URL to make code more verbose.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
119
diff
changeset
|
139 |
# $ sftp $(SF_USER),$(pkgname)@web.sourceforge.net |
111
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
140 |
# as it may require interactive input for accepting server public key. |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
141 |
# Next time any action fully automated. |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
142 |
|
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
143 |
.PHONY: deploy2sf |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
144 |
deploy2sf: deploy2sf-doc deploy2sf-release deploy2sf-src |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
145 |
|
119
20f1d1080886
Rename 'name' ==> 'pkgname'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
118
diff
changeset
|
146 |
# Will be accessed via http://$(pkgname).sourceforge.net |
111
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
147 |
.PHONY: deploy2sf-doc |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
148 |
deploy2sf-doc: $(HTML_FILES) |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
149 |
( echo 'cd htdocs'; \ |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
150 |
for f in $(HTML_FILES); do \ |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
151 |
echo "put $$f"; \ |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
152 |
echo "chmod 644 $$f"; \ |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
153 |
done; \ |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
154 |
echo 'quit'; \ |
120
cb5ab06a72a7
Inline URL to make code more verbose.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
119
diff
changeset
|
155 |
) | sftp -b - $(SF_USER),$(pkgname)@web.sourceforge.net |
111
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
156 |
|
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
157 |
.PHONY: deploy2sf-release |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
158 |
deploy2sf-release: $(DIST_TARBALLS) $(DISTSRC_TARBALLS) |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
159 |
( echo 'cd /home/frs/project/g/ga/gadict'; \ |
115
1c6ffaecdf50
Fix sftp command usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
112
diff
changeset
|
160 |
echo "put CHANGES.rst"; \ |
1c6ffaecdf50
Fix sftp command usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
112
diff
changeset
|
161 |
echo "chmod 644 CHANGES.rst"; \ |
1c6ffaecdf50
Fix sftp command usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
112
diff
changeset
|
162 |
echo "put README.rst"; \ |
1c6ffaecdf50
Fix sftp command usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
112
diff
changeset
|
163 |
echo "chmod 644 README.rst"; \ |
111
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
164 |
echo "mkdir v$(vmajor).$(vminor)"; \ |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
165 |
echo "cd v$(vmajor).$(vminor)"; \ |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
166 |
for f in $^; do \ |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
167 |
echo "put $$f"; \ |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
168 |
echo "chmod 644 $$f"; \ |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
169 |
done; \ |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
170 |
echo 'quit'; \ |
120
cb5ab06a72a7
Inline URL to make code more verbose.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
119
diff
changeset
|
171 |
) | sftp -b - $(SF_USER),$(pkgname)@frs.sourceforge.net |
111
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
172 |
|
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
173 |
.PHONY: deploy2sf-src |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
174 |
deploy2sf-src: |
119
20f1d1080886
Rename 'name' ==> 'pkgname'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
118
diff
changeset
|
175 |
hg push ssh://gavenkoa@hg.code.sf.net/p/$(pkgname)/code |
111
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
176 |
|
103 | 177 |
################################################################ |
178 |
# Dist targets. |
|
179 |
||
180 |
.PHONY: dist |
|
181 |
dist: dist-dictd dist-src |
|
182 |
||
183 |
.PHONY: dist-dictd |
|
105
35cc545ec03d
'clean'-like targets delete artefacts after 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
103
diff
changeset
|
184 |
dist-dictd: $(DIST_TARBALLS) |
103 | 185 |
|
186 |
.PHONY: dist-src |
|
105
35cc545ec03d
'clean'-like targets delete artefacts after 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
103
diff
changeset
|
187 |
dist-src: $(DISTSRC_TARBALLS) |
103 | 188 |
|
189 |
%.tar.gz: % |
|
190 |
tar zcf $*.tar.gz $* |
|
191 |
||
192 |
%.tar.bz2: % |
|
193 |
tar jcf $*.tar.bz2 $* |
|
194 |
||
195 |
$(DIST_DIR): $(DIST_FILES) |
|
196 |
rm -rf $@ |
|
197 |
mkdir $@ |
|
198 |
cp $(DIST_FILES) $@ |
|
199 |
||
200 |
$(DISTSRC_DIR): $(DISTSRC_FILES) |
|
201 |
rm -rf $@ |
|
202 |
mkdir $@ |
|
203 |
cp $(DISTSRC_FILES) $@ |
|
204 |
||
54 | 205 |
################################################################ |
206 |
# Build targets. |
|
0 | 207 |
|
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
208 |
.PHONY: all |
0 | 209 |
all: dist |
210 |
||
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
211 |
.PHONY: dist |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
212 |
dist: $(DICTDZ_FILES) $(INDEX_FILES) |
0 | 213 |
|
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
214 |
# --case-sensitive |
50
37931fbb857f
Switch from ambiguous extension to unambiguous.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
46
diff
changeset
|
215 |
%.dict %.index: %.dict-c5 |
46
86c0184efac7
Comment syntax convention.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
41
diff
changeset
|
216 |
sed '/^#/d' $< | dictfmt -c5 \ |
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
217 |
--headword-separator '; ' --break-headwords \ |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
218 |
--utf8 --allchars \ |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
219 |
-u "`sed -n '\|http://[[:print:]]\+/|{s=^.*\(http://\)=\1=;p;q;}' $<`" \ |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
220 |
-s "`sed -n '/^ABOUT: /{s=ABOUT: ==;p;q;}' $<`" \ |
46
86c0184efac7
Comment syntax convention.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
41
diff
changeset
|
221 |
$* |
0 | 222 |
|
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
223 |
%.dict.dz: %.dict |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
224 |
dictzip -c $< >$@ |
1
b23e948de24a
Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
225 |
|
54 | 226 |
################################################################ |
227 |
# Install/uninstall targets. |
|
0 | 228 |
|
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
229 |
.PHONY: install |
0 | 230 |
install: dist |
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
231 |
mkdir -p $(datadir) |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
232 |
for f in $(DICTDZ_FILES) $(INDEX_FILES); do \ |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
233 |
install -m 644 $$f $(datadir); \ |
0 | 234 |
done |
235 |
||
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
236 |
.PHONY: uninstall |
0 | 237 |
uninstall: |
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
238 |
for f in $(DICTDZ_FILES) $(INDEX_FILES); do \ |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
239 |
rm -f $(datadir)/$$f; \ |
21
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
240 |
done |
13
d0e948499faf
Added targets [un]install-user to proper install dict for current user.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
9
diff
changeset
|
241 |
|
54 | 242 |
################################################################ |
66 | 243 |
# Documentation targets. |
244 |
||
245 |
.PHONY: html |
|
246 |
html: $(HTML_FILES) |
|
247 |
||
109
5bb58b8d87a7
Add version info into documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
108
diff
changeset
|
248 |
$(HTML_FILES): %.html: %.rst rst.css VERSION.rst $(BUILD_SCRIPT) |
107
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
249 |
$(RST2HTML) $(RST2HTML_FLAGS) --stylesheet=rst.css $*.rst $@ |
66 | 250 |
|
109
5bb58b8d87a7
Add version info into documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
108
diff
changeset
|
251 |
VERSION.rst: VERSION $(BUILD_SCRIPT) |
5bb58b8d87a7
Add version info into documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
108
diff
changeset
|
252 |
{ \ |
5bb58b8d87a7
Add version info into documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
108
diff
changeset
|
253 |
echo 'Version: '$(vmajor).$(vminor); \ |
5bb58b8d87a7
Add version info into documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
108
diff
changeset
|
254 |
echo; \ |
5bb58b8d87a7
Add version info into documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
108
diff
changeset
|
255 |
echo 'Date: '`date +%F`; \ |
5bb58b8d87a7
Add version info into documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
108
diff
changeset
|
256 |
} >$@ |
5bb58b8d87a7
Add version info into documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
108
diff
changeset
|
257 |
|
66 | 258 |
################################################################ |
108
1f1363141da7
Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
107
diff
changeset
|
259 |
# Helpers targets. |
1f1363141da7
Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
107
diff
changeset
|
260 |
|
1f1363141da7
Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
107
diff
changeset
|
261 |
.PHONY: help |
1f1363141da7
Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
107
diff
changeset
|
262 |
help: |
1f1363141da7
Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
107
diff
changeset
|
263 |
@echo |
1f1363141da7
Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
107
diff
changeset
|
264 |
@echo vmajor=$(vmajor) |
1f1363141da7
Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
107
diff
changeset
|
265 |
@echo vminor=$(vminor) |
1f1363141da7
Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
107
diff
changeset
|
266 |
@echo |
1f1363141da7
Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
107
diff
changeset
|
267 |
@echo Supported targets: |
1f1363141da7
Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
107
diff
changeset
|
268 |
@sed -n -e '/^[[:alnum:]_-]*:/{s=^\(.*\):.*= \1=;p;}' $(BUILD_SCRIPT) |
94
1b2cf5b2b46c
Add target that print statistics about word count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
85
diff
changeset
|
269 |
|
1b2cf5b2b46c
Add target that print statistics about word count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
85
diff
changeset
|
270 |
.PHONY: stat |
1b2cf5b2b46c
Add target that print statistics about word count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
85
diff
changeset
|
271 |
stat: |
1b2cf5b2b46c
Add target that print statistics about word count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
85
diff
changeset
|
272 |
total=0; \ |
1b2cf5b2b46c
Add target that print statistics about word count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
85
diff
changeset
|
273 |
for dic in *.dict-c5; do \ |
1b2cf5b2b46c
Add target that print statistics about word count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
85
diff
changeset
|
274 |
cnt=`grep '^_____' $$dic | wc -l`; \ |
1b2cf5b2b46c
Add target that print statistics about word count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
85
diff
changeset
|
275 |
echo $$dic 'has ' $$cnt words.; \ |
1b2cf5b2b46c
Add target that print statistics about word count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
85
diff
changeset
|
276 |
total=$$(($$total + $$cnt)); \ |
1b2cf5b2b46c
Add target that print statistics about word count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
85
diff
changeset
|
277 |
done; \ |
1b2cf5b2b46c
Add target that print statistics about word count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
85
diff
changeset
|
278 |
echo Total words count is $$total. |
1b2cf5b2b46c
Add target that print statistics about word count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
85
diff
changeset
|
279 |
|
1b2cf5b2b46c
Add target that print statistics about word count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
85
diff
changeset
|
280 |
################################################################ |
54 | 281 |
# Clean targets. |
282 |
||
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
283 |
.PHONY: distclean |
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
284 |
distclean: clean |
105
35cc545ec03d
'clean'-like targets delete artefacts after 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
103
diff
changeset
|
285 |
rm -f VERSION |
13
d0e948499faf
Added targets [un]install-user to proper install dict for current user.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
9
diff
changeset
|
286 |
|
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
287 |
.PHONY: clean |
0 | 288 |
clean: |
68 | 289 |
rm -f $(DICTDZ_FILES) $(INDEX_FILES) $(HTML_FILES) |
110
bf134608773d
Merge with Makefile from 'jdone' project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
109
diff
changeset
|
290 |
rm -rf $(DIST_DIR) $(DIST_TARBALLS) |
bf134608773d
Merge with Makefile from 'jdone' project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
109
diff
changeset
|
291 |
rm -rf $(DISTSRC_DIR) $(DISTSRC_TARBALLS) |
63 | 292 |