author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Thu, 11 Sep 2014 03:53:43 +0300 | |
changeset 287 | d01045b55e04 |
parent 276 | 66db1bbebe45 |
child 308 | 7a5f4265a581 |
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 |
118
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
10 |
# |
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
11 |
# 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
|
12 |
# |
121
38e8a1063673
Add 'DESTDIR' - prefix to 'prefix' variable value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
120
diff
changeset
|
13 |
# SF_USER SourceForge user name. |
38e8a1063673
Add 'DESTDIR' - prefix to 'prefix' variable value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
120
diff
changeset
|
14 |
# prefix Prefix to install path. |
38e8a1063673
Add 'DESTDIR' - prefix to 'prefix' variable value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
120
diff
changeset
|
15 |
# DESTDIR Prefix to 'prefix' variable value. |
22
0616adf6e983
Describe available build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
16 |
|
260
5f6befed263c
Delete target file if command fails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
249
diff
changeset
|
17 |
################################################################ |
5f6befed263c
Delete target file if command fails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
249
diff
changeset
|
18 |
# Standard GNU Makefile settings. |
5f6befed263c
Delete target file if command fails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
249
diff
changeset
|
19 |
|
287
d01045b55e04
Avoid names inlining.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
276
diff
changeset
|
20 |
SHELL = /bin/bash |
36
6fee90eb2d85
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
21 |
export PATH := /bin:/usr/bin:${PATH} |
6fee90eb2d85
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
22 |
|
6fee90eb2d85
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
23 |
# Disable built in pattern rules. |
6fee90eb2d85
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
24 |
MAKEFLAGS += -r |
6fee90eb2d85
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
25 |
# Disable built in variables. |
6fee90eb2d85
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
26 |
MAKEFLAGS += -R |
6fee90eb2d85
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
27 |
# Disable built in suffix rules. |
6fee90eb2d85
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
28 |
.SUFFIXES: |
260
5f6befed263c
Delete target file if command fails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
249
diff
changeset
|
29 |
# Delete target file if command fails. |
5f6befed263c
Delete target file if command fails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
249
diff
changeset
|
30 |
.DELETE_ON_ERROR: |
36
6fee90eb2d85
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
31 |
# Default target. |
106
092b25d032af
Set 'help' as default target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
105
diff
changeset
|
32 |
.DEFAULT_GOAL = help |
36
6fee90eb2d85
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
33 |
|
54 | 34 |
################################################################ |
118
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
35 |
# Build script definitions. |
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
36 |
|
150
28cd06b06bb8
Rename BUILD_SCRIPT ==> BUILD_SCRIPTS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
148
diff
changeset
|
37 |
BUILD_SCRIPTS := $(firstword $(MAKEFILE_LIST)) |
118
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
38 |
|
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
39 |
ifneq '' '$(wildcard Makefile.config)' |
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
40 |
include Makefile.config |
150
28cd06b06bb8
Rename BUILD_SCRIPT ==> BUILD_SCRIPTS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
148
diff
changeset
|
41 |
BUILD_SCRIPTS += Makefile.config |
118
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
42 |
endif |
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
43 |
|
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
44 |
################################################################ |
103 | 45 |
# Version extracting/generation. |
46 |
||
275
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
47 |
# Prevent making distribution with wrong version. |
133
60e2090b7462
Rebuild VERSION file for 'dist' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
132
diff
changeset
|
48 |
ifneq '' '$(filter deploy% dist%,$(MAKECMDGOALS))' |
103 | 49 |
ifeq '' '$(MAKE_RESTARTS)' |
261
30c6f0eb02db
Fix: rm: cannot remove `VERSION': No such file or directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
260
diff
changeset
|
50 |
$(info $(shell rm -f VERSION)) |
103 | 51 |
endif |
52 |
endif |
|
53 |
||
54 |
# Here are vmajor and vminor. Look README section "Versioning rules." |
|
55 |
-include VERSION |
|
56 |
||
57 |
VERSION: |
|
122
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
58 |
\ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
59 |
vtagdist=$$(hg log -r . --template '{latesttagdistance}'); \ |
141
4b799e3f9a70
Allow release from commit that tag release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
137
diff
changeset
|
60 |
vatrelease=$$([ $$vtagdist -le 1 ] && echo yes || echo no); \ |
122
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
61 |
vtag=$$(hg log -r . --template '{latesttag}'); \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
62 |
vmajor=$${vtag#t}; \ |
151
206fb46e793d
Make code more genetic.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
150
diff
changeset
|
63 |
vmajor=$${vmajor%%.*}; \ |
122
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
64 |
vminor=$${vtag#*.}; \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
65 |
vrev=$$(hg id -i); \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
66 |
visclean=$$(case $$vrev in *+) echo no;; *) echo yes;; esac); \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
67 |
vrev=$${vrev%+}; \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
68 |
{ \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
69 |
echo "vrev=$$vrev"; \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
70 |
echo "vtag=$$vtag"; \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
71 |
echo "vtagdist=$$vtagdist"; \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
72 |
echo "visclean=$$visclean"; \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
73 |
echo "vatrelease=$$vatrelease"; \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
74 |
echo "vmajor=$$vmajor"; \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
75 |
echo "vminor=$$vminor"; \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
76 |
} >VERSION |
103 | 77 |
|
78 |
################################################################ |
|
106
092b25d032af
Set 'help' as default target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
105
diff
changeset
|
79 |
# Determine platform/environment. |
66 | 80 |
|
81 |
host_os = unix |
|
82 |
ifneq '' '$(COMSPEC)' |
|
83 |
ifneq '' '$(WINDIR)' |
|
84 |
# Probably under Windows. |
|
85 |
host_os = windows |
|
107
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
86 |
ifneq '' '$(wildcard /etc/setup/*cygwin*)' |
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
87 |
# Probably under Cygwin. |
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
88 |
host_os = cygwin |
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
89 |
endif |
66 | 90 |
endif |
91 |
endif |
|
92 |
||
93 |
################################################################ |
|
107
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
94 |
# Build tools definition/switches. |
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
95 |
|
121
38e8a1063673
Add 'DESTDIR' - prefix to 'prefix' variable value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
120
diff
changeset
|
96 |
INSTALL = install |
38e8a1063673
Add 'DESTDIR' - prefix to 'prefix' variable value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
120
diff
changeset
|
97 |
INSTALL_PROGRAM = $(INSTALL) |
38e8a1063673
Add 'DESTDIR' - prefix to 'prefix' variable value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
120
diff
changeset
|
98 |
INSTALL_DATA = $(INSTALL) -m 644 |
38e8a1063673
Add 'DESTDIR' - prefix to 'prefix' variable value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
120
diff
changeset
|
99 |
|
107
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
100 |
RST_WARNING_FLAGS := --halt warning |
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
101 |
RST_FLAGS := --strip-comments |
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
102 |
RST_FLAGS += $(RST_WARNING_FLAGS) |
66 | 103 |
|
107
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
104 |
RST2HTML := rst2html |
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
105 |
ifeq '$(host_os)' 'cygwin' |
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
106 |
RST2HTML := rst2html.py |
66 | 107 |
endif |
107
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
108 |
RST2HTML_FLAGS := $(RST_FLAGS) |
66 | 109 |
|
110 |
################################################################ |
|
54 | 111 |
# Install paths. |
0 | 112 |
|
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
113 |
ifeq '$(origin prefix)' 'undefined' |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
114 |
ifeq '$(shell id -u)' '0' |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
115 |
prefix = /usr/local |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
116 |
else |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
117 |
prefix = $(HOME)/usr |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
118 |
endif |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
119 |
endif |
121
38e8a1063673
Add 'DESTDIR' - prefix to 'prefix' variable value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
120
diff
changeset
|
120 |
datarootdir := $(DESTDIR)$(prefix)/share |
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
121 |
datadir = $(datarootdir)/dictd |
0 | 122 |
|
54 | 123 |
################################################################ |
66 | 124 |
# Project dirs/files. |
21
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
125 |
|
275
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
126 |
pkgname = gadict |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
127 |
fullpkgname = $(pkgname)-$(vmajor).$(vminor) |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
128 |
|
50
37931fbb857f
Switch from ambiguous extension to unambiguous.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
46
diff
changeset
|
129 |
C5_FILES := $(wildcard *.dict-c5) |
37931fbb857f
Switch from ambiguous extension to unambiguous.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
46
diff
changeset
|
130 |
DICT_FILES := $(C5_FILES:.dict-c5=.dict) |
37931fbb857f
Switch from ambiguous extension to unambiguous.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
46
diff
changeset
|
131 |
DICTDZ_FILES := $(C5_FILES:.dict-c5=.dict.dz) |
37931fbb857f
Switch from ambiguous extension to unambiguous.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
46
diff
changeset
|
132 |
INDEX_FILES := $(C5_FILES:.dict-c5=.index) |
1
b23e948de24a
Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
133 |
|
276
66db1bbebe45
Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
275
diff
changeset
|
134 |
RST_GEN_FILES := VERSION.rst STAT.rst index.rst |
66db1bbebe45
Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
275
diff
changeset
|
135 |
RST_COMMON_FILES := VERSION.rst header.rst |
66db1bbebe45
Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
275
diff
changeset
|
136 |
RST_FILES := $(filter-out $(RST_COMMON_FILES),$(sort $(wildcard *.rst) $(RST_GEN_FILES))) |
66db1bbebe45
Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
275
diff
changeset
|
137 |
RST_HTML_FILES := $(RST_FILES:.rst=.html) |
66 | 138 |
|
275
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
139 |
LOGO_NAME := logo |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
140 |
LOGO_SVG := $(LOGO_NAME).svg |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
141 |
LOGO_DIM := 32x32 48x48 64x64 |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
142 |
LOGO_PNG_FILES := $(patsubst %,$(LOGO_NAME)-%.png,$(LOGO_DIM)) |
103 | 143 |
|
144 |
DIST_DIR = $(fullpkgname) |
|
145 |
DISTSRC_DIR = $(fullpkgname)_src |
|
146 |
||
276
66db1bbebe45
Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
275
diff
changeset
|
147 |
DIST_FILES = $(DICTDZ_FILES) $(INDEX_FILES) $(RST_HTML_FILES) $(RST_FILES) VERSION |
103 | 148 |
|
149 |
DISTSRC_HELPER_FILES = VERSION Makefile rst.css .dir-locals.el |
|
204
f93358e8be5b
Exclude .html files from src bundle as they can be recreated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
152
diff
changeset
|
150 |
DISTSRC_FILES = $(C5_FILES) $(RST_FILES) $(DISTSRC_HELPER_FILES) |
103 | 151 |
|
111
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
152 |
DIST_TARBALLS = $(DIST_DIR).tar.gz $(DIST_DIR).tar.bz2 |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
153 |
DISTSRC_TARBALLS = $(DISTSRC_DIR).tar.gz $(DISTSRC_DIR).tar.bz2 |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
154 |
|
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
155 |
################################################################ |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
156 |
# Deploy targets. |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
157 |
|
118
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
158 |
ifeq '' '$(SF_USER)' |
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
159 |
SF_USER := gavenkoa |
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
160 |
endif |
c9ce7b6ae3bc
Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
115
diff
changeset
|
161 |
|
111
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
162 |
.PHONY: deploy |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
163 |
deploy: deploy2sf |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
164 |
|
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
165 |
# 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
|
166 |
# $ sftp $(SF_USER),$(pkgname)@web.sourceforge.net |
111
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
167 |
# as it may require interactive input for accepting server public key. |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
168 |
# Next time any action fully automated. |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
169 |
|
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
170 |
.PHONY: deploy2sf |
275
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
171 |
deploy2sf: deploy2sf-src deploy2sf-doc deploy2sf-release |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
172 |
|
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
173 |
.PHONY: deploy2sf-src |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
174 |
deploy2sf-src: |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
175 |
hg push ssh://$(SF_USER)@hg.code.sf.net/p/$(pkgname)/code || [ $$? = 1 ] |
111
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
176 |
|
119
20f1d1080886
Rename 'name' ==> 'pkgname'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
118
diff
changeset
|
177 |
# Will be accessed via http://$(pkgname).sourceforge.net |
111
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
178 |
.PHONY: deploy2sf-doc |
276
66db1bbebe45
Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
275
diff
changeset
|
179 |
deploy2sf-doc: deploy-check $(RST_HTML_FILES) |
111
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
180 |
( echo 'cd htdocs'; \ |
276
66db1bbebe45
Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
275
diff
changeset
|
181 |
for f in $(RST_HTML_FILES); do \ |
111
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
182 |
echo "put $$f"; \ |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
183 |
echo "chmod 644 $$f"; \ |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
184 |
done; \ |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
185 |
echo 'quit'; \ |
120
cb5ab06a72a7
Inline URL to make code more verbose.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
119
diff
changeset
|
186 |
) | sftp -b - $(SF_USER),$(pkgname)@web.sourceforge.net |
111
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
187 |
|
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
188 |
.PHONY: deploy2sf-release |
125
63b391bee058
Add dependency to 'deploy*' targets on 'deploy-check' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
124
diff
changeset
|
189 |
deploy2sf-release: deploy-check $(DIST_TARBALLS) $(DISTSRC_TARBALLS) |
287
d01045b55e04
Avoid names inlining.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
276
diff
changeset
|
190 |
( echo 'cd /home/frs/project/$(shell v=$(pkgname); echo $${v:0:1}/$${v:0:2})/$(pkgname)'; \ |
115
1c6ffaecdf50
Fix sftp command usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
112
diff
changeset
|
191 |
echo "put README.rst"; \ |
1c6ffaecdf50
Fix sftp command usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
112
diff
changeset
|
192 |
echo "chmod 644 README.rst"; \ |
111
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
193 |
echo "mkdir v$(vmajor).$(vminor)"; \ |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
194 |
echo "cd v$(vmajor).$(vminor)"; \ |
142 | 195 |
for f in $(DIST_TARBALLS) $(DISTSRC_TARBALLS); do \ |
111
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
196 |
echo "put $$f"; \ |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
197 |
echo "chmod 644 $$f"; \ |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
198 |
done; \ |
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
199 |
echo 'quit'; \ |
120
cb5ab06a72a7
Inline URL to make code more verbose.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
119
diff
changeset
|
200 |
) | sftp -b - $(SF_USER),$(pkgname)@frs.sourceforge.net |
111
84fe35f49224
Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
110
diff
changeset
|
201 |
|
124
7d9f38580ed9
Add 'deploy-check' target to check source sanity before release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
123
diff
changeset
|
202 |
.PHONY: deploy-check |
7d9f38580ed9
Add 'deploy-check' target to check source sanity before release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
123
diff
changeset
|
203 |
deploy-check: |
275
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
204 |
\ |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
205 |
case ${visclean} in \ |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
206 |
no) echo "Local changes found. Build stop."; \ |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
207 |
exit 1;; \ |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
208 |
esac |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
209 |
\ |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
210 |
case $(vatrelease) in \ |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
211 |
no) echo "We are not at release. Build stop."; \ |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
212 |
exit 1;; \ |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
213 |
esac |
124
7d9f38580ed9
Add 'deploy-check' target to check source sanity before release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
123
diff
changeset
|
214 |
|
103 | 215 |
################################################################ |
216 |
# Dist targets. |
|
217 |
||
218 |
.PHONY: dist |
|
219 |
dist: dist-dictd dist-src |
|
220 |
||
221 |
.PHONY: dist-dictd |
|
105
35cc545ec03d
'clean'-like targets delete artefacts after 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
103
diff
changeset
|
222 |
dist-dictd: $(DIST_TARBALLS) |
103 | 223 |
|
224 |
.PHONY: dist-src |
|
105
35cc545ec03d
'clean'-like targets delete artefacts after 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
103
diff
changeset
|
225 |
dist-src: $(DISTSRC_TARBALLS) |
103 | 226 |
|
227 |
%.tar.gz: % |
|
228 |
tar zcf $*.tar.gz $* |
|
229 |
||
230 |
%.tar.bz2: % |
|
231 |
tar jcf $*.tar.bz2 $* |
|
232 |
||
233 |
$(DIST_DIR): $(DIST_FILES) |
|
234 |
rm -rf $@ |
|
235 |
mkdir $@ |
|
236 |
cp $(DIST_FILES) $@ |
|
237 |
||
238 |
$(DISTSRC_DIR): $(DISTSRC_FILES) |
|
239 |
rm -rf $@ |
|
240 |
mkdir $@ |
|
241 |
cp $(DISTSRC_FILES) $@ |
|
242 |
||
54 | 243 |
################################################################ |
244 |
# Build targets. |
|
0 | 245 |
|
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
246 |
.PHONY: all |
245
5b9fac360762
Rename target to avoid disambiguate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
241
diff
changeset
|
247 |
all: dict |
0 | 248 |
|
245
5b9fac360762
Rename target to avoid disambiguate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
241
diff
changeset
|
249 |
.PHONY: dict |
5b9fac360762
Rename target to avoid disambiguate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
241
diff
changeset
|
250 |
dict: $(DICTDZ_FILES) $(INDEX_FILES) |
0 | 251 |
|
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
252 |
# --case-sensitive |
50
37931fbb857f
Switch from ambiguous extension to unambiguous.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
46
diff
changeset
|
253 |
%.dict %.index: %.dict-c5 |
46
86c0184efac7
Comment syntax convention.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
41
diff
changeset
|
254 |
sed '/^#/d' $< | dictfmt -c5 \ |
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
255 |
--headword-separator '; ' --break-headwords \ |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
256 |
--utf8 --allchars \ |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
257 |
-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
|
258 |
-s "`sed -n '/^ABOUT: /{s=ABOUT: ==;p;q;}' $<`" \ |
46
86c0184efac7
Comment syntax convention.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
41
diff
changeset
|
259 |
$* |
0 | 260 |
|
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
261 |
%.dict.dz: %.dict |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
262 |
dictzip -c $< >$@ |
1
b23e948de24a
Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
263 |
|
54 | 264 |
################################################################ |
265 |
# Install/uninstall targets. |
|
0 | 266 |
|
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
267 |
.PHONY: install |
148
b0142666eeba
Fix dependency for 'install' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
146
diff
changeset
|
268 |
install: $(DICTDZ_FILES) $(INDEX_FILES) |
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
269 |
mkdir -p $(datadir) |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
270 |
for f in $(DICTDZ_FILES) $(INDEX_FILES); do \ |
121
38e8a1063673
Add 'DESTDIR' - prefix to 'prefix' variable value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
120
diff
changeset
|
271 |
$(INSTALL_DATA) $$f $(datadir); \ |
0 | 272 |
done |
273 |
||
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
274 |
.PHONY: uninstall |
0 | 275 |
uninstall: |
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
276 |
for f in $(DICTDZ_FILES) $(INDEX_FILES); do \ |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
277 |
rm -f $(datadir)/$$f; \ |
21
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
278 |
done |
13
d0e948499faf
Added targets [un]install-user to proper install dict for current user.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
9
diff
changeset
|
279 |
|
54 | 280 |
################################################################ |
66 | 281 |
# Documentation targets. |
282 |
||
275
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
283 |
.PHONY: docs |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
284 |
docs: html |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
285 |
|
66 | 286 |
.PHONY: html |
276
66db1bbebe45
Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
275
diff
changeset
|
287 |
html: $(RST_HTML_FILES) |
66 | 288 |
|
276
66db1bbebe45
Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
275
diff
changeset
|
289 |
$(RST_HTML_FILES): %.html: %.rst $(RST_COMMON_FILES) rst.css $(BUILD_SCRIPTS) |
107
4cfb94e11b5d
Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
290 |
$(RST2HTML) $(RST2HTML_FLAGS) --stylesheet=rst.css $*.rst $@ |
66 | 291 |
|
150
28cd06b06bb8
Rename BUILD_SCRIPT ==> BUILD_SCRIPTS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
148
diff
changeset
|
292 |
VERSION.rst: VERSION $(BUILD_SCRIPTS) |
109
5bb58b8d87a7
Add version info into documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
108
diff
changeset
|
293 |
{ \ |
127
2fc0561f80ca
Include source state info in documentation build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
125
diff
changeset
|
294 |
echo 'For ``$(pkgname)`` version: ``$(vmajor).$(vminor)``.'; \ |
2fc0561f80ca
Include source state info in documentation build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
125
diff
changeset
|
295 |
echo; \ |
2fc0561f80ca
Include source state info in documentation build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
125
diff
changeset
|
296 |
case ${visclean} in \ |
2fc0561f80ca
Include source state info in documentation build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
125
diff
changeset
|
297 |
yes) echo 'Source files are at revision: ``$(vrev)``.';; \ |
2fc0561f80ca
Include source state info in documentation build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
125
diff
changeset
|
298 |
no) echo 'Some source files was modified from revision: ``$(vrev)``.';; \ |
2fc0561f80ca
Include source state info in documentation build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
125
diff
changeset
|
299 |
esac; \ |
109
5bb58b8d87a7
Add version info into documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
108
diff
changeset
|
300 |
echo; \ |
127
2fc0561f80ca
Include source state info in documentation build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
125
diff
changeset
|
301 |
case ${vatrelease} in \ |
2fc0561f80ca
Include source state info in documentation build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
125
diff
changeset
|
302 |
yes) echo 'Package is at release state.';; \ |
2fc0561f80ca
Include source state info in documentation build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
125
diff
changeset
|
303 |
no) echo 'Package is far from release state by $(vtagdist) changes.';; \ |
2fc0561f80ca
Include source state info in documentation build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
125
diff
changeset
|
304 |
esac; \ |
2fc0561f80ca
Include source state info in documentation build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
125
diff
changeset
|
305 |
echo; \ |
2fc0561f80ca
Include source state info in documentation build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
125
diff
changeset
|
306 |
echo 'Build date: ``'$$(date +%F)'``.'; \ |
109
5bb58b8d87a7
Add version info into documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
108
diff
changeset
|
307 |
} >$@ |
5bb58b8d87a7
Add version info into documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
108
diff
changeset
|
308 |
|
276
66db1bbebe45
Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
275
diff
changeset
|
309 |
index.rst: README.rst |
66db1bbebe45
Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
275
diff
changeset
|
310 |
cp $< $@ |
66db1bbebe45
Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
275
diff
changeset
|
311 |
|
66 | 312 |
################################################################ |
275
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
313 |
# Misc targets. |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
314 |
|
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
315 |
.PHONY: logo |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
316 |
logo: logo-png |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
317 |
|
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
318 |
.PHONY: logo-png |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
319 |
logo-png: $(LOGO_PNG_FILES) |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
320 |
|
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
321 |
# Require: |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
322 |
# $ sudo apt-get install imagemagick librsvg2-bin |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
323 |
$(LOGO_PNG_FILES): $(LOGO_NAME)-%.png: $(LOGO_SVG) |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
324 |
convert +antialias -background transparent $< -resize $* $@ |
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
325 |
|
9f70f66ee2a1
Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
274
diff
changeset
|
326 |
################################################################ |
108
1f1363141da7
Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
107
diff
changeset
|
327 |
# Helpers targets. |
1f1363141da7
Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
107
diff
changeset
|
328 |
|
1f1363141da7
Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
107
diff
changeset
|
329 |
.PHONY: help |
1f1363141da7
Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
107
diff
changeset
|
330 |
help: |
122
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
331 |
@\ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
332 |
echo; \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
333 |
echo Current configuration:; \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
334 |
echo; \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
335 |
sed 's=^= =' <VERSION |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
336 |
@if [ -f Makefile.config ]; then \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
337 |
echo; \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
338 |
echo User configuration:; \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
339 |
echo; \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
340 |
sed 's=^= =' <Makefile.config; \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
341 |
fi |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
342 |
@\ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
343 |
echo; \ |
003356f9e504
Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
121
diff
changeset
|
344 |
echo Supported targets:; \ |
123 | 345 |
echo; \ |
150
28cd06b06bb8
Rename BUILD_SCRIPT ==> BUILD_SCRIPTS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
148
diff
changeset
|
346 |
sed -n -e '/^[[:alnum:]_-]*:/{s=^\(.*\):.*= \1=;p;}' $(BUILD_SCRIPTS) |
94
1b2cf5b2b46c
Add target that print statistics about word count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
85
diff
changeset
|
347 |
|
249 | 348 |
.PHONY: todo |
349 |
todo: |
|
350 |
grep -nH 'TODO\|XXX' $(RST_FILES) $(C5_FILES) |
|
351 |
||
94
1b2cf5b2b46c
Add target that print statistics about word count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
85
diff
changeset
|
352 |
.PHONY: stat |
128
ca6ceff4941c
Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
127
diff
changeset
|
353 |
stat: STAT.rst |
ca6ceff4941c
Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
127
diff
changeset
|
354 |
|
206
407f2a82ef26
Include common header for quick links. Exclude unnecessary .html files from build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
204
diff
changeset
|
355 |
STAT.rst: $(C5_FILES) header.rst VERSION.rst $(BUILD_SCRIPTS) |
128
ca6ceff4941c
Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
127
diff
changeset
|
356 |
{ \ |
206
407f2a82ef26
Include common header for quick links. Exclude unnecessary .html files from build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
204
diff
changeset
|
357 |
echo '.. include:: header.rst'; \ |
407f2a82ef26
Include common header for quick links. Exclude unnecessary .html files from build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
204
diff
changeset
|
358 |
echo; \ |
128
ca6ceff4941c
Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
127
diff
changeset
|
359 |
echo '============================'; \ |
ca6ceff4941c
Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
127
diff
changeset
|
360 |
echo ' gadict project statistics.'; \ |
ca6ceff4941c
Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
127
diff
changeset
|
361 |
echo '============================'; \ |
ca6ceff4941c
Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
127
diff
changeset
|
362 |
echo '.. contents::'; \ |
ca6ceff4941c
Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
127
diff
changeset
|
363 |
echo; \ |
146
6be7851b9650
Inlcude version info in 'STAT.rst'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
142
diff
changeset
|
364 |
echo 'Document version.'; \ |
6be7851b9650
Inlcude version info in 'STAT.rst'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
142
diff
changeset
|
365 |
echo '================='; \ |
6be7851b9650
Inlcude version info in 'STAT.rst'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
142
diff
changeset
|
366 |
echo; \ |
6be7851b9650
Inlcude version info in 'STAT.rst'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
142
diff
changeset
|
367 |
echo '.. include:: VERSION.rst'; \ |
6be7851b9650
Inlcude version info in 'STAT.rst'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
142
diff
changeset
|
368 |
echo; \ |
222
242db5c0f8ce
Add description what table are.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
207
diff
changeset
|
369 |
echo 'Statistics on count of articles in gadict dictionaries.'; \ |
242db5c0f8ce
Add description what table are.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
207
diff
changeset
|
370 |
echo '======================================================='; \ |
242db5c0f8ce
Add description what table are.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
207
diff
changeset
|
371 |
echo; \ |
242db5c0f8ce
Add description what table are.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
207
diff
changeset
|
372 |
echo 'You must know that some words have articles (usually but not always same) in'; \ |
242db5c0f8ce
Add description what table are.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
207
diff
changeset
|
373 |
echo 'several dictionaries. So real count of words is less then total count.'; \ |
128
ca6ceff4941c
Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
127
diff
changeset
|
374 |
echo; \ |
ca6ceff4941c
Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
127
diff
changeset
|
375 |
echo '======================================== ====='; \ |
ca6ceff4941c
Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
127
diff
changeset
|
376 |
echo ' Dictionary Count'; \ |
ca6ceff4941c
Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
127
diff
changeset
|
377 |
echo '======================================== ====='; \ |
ca6ceff4941c
Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
127
diff
changeset
|
378 |
total=0; \ |
ca6ceff4941c
Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
127
diff
changeset
|
379 |
for dic in $(C5_FILES); do \ |
ca6ceff4941c
Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
127
diff
changeset
|
380 |
cnt=`grep '^_____' $$dic | wc -l`; \ |
207
3c96103ced32
Exclude file prefixes from output to dict names shorter (and so more readable).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
206
diff
changeset
|
381 |
printf '%40s %5s\n' $${dic%.dict-c5} $$cnt; \ |
128
ca6ceff4941c
Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
127
diff
changeset
|
382 |
total=$$(($$total + $$cnt)); \ |
ca6ceff4941c
Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
127
diff
changeset
|
383 |
done; \ |
ca6ceff4941c
Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
127
diff
changeset
|
384 |
printf '%40s %5s\n' '**Total**' $$total; \ |
ca6ceff4941c
Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
127
diff
changeset
|
385 |
echo '======================================== ====='; \ |
ca6ceff4941c
Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
127
diff
changeset
|
386 |
} >$@ |
94
1b2cf5b2b46c
Add target that print statistics about word count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
85
diff
changeset
|
387 |
|
241 | 388 |
.PHONY: logo-png |
389 |
logo-png: logo-64x64.png |
|
390 |
||
391 |
# Require: |
|
392 |
# $ sudo apt-get install imagemagick librsvg2-bin |
|
393 |
%.png: %.svg |
|
274
f0b6d4c0ee97
Set transparent background for PNG logo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
261
diff
changeset
|
394 |
convert +antialias -background transparent $< $@ |
241 | 395 |
|
94
1b2cf5b2b46c
Add target that print statistics about word count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
85
diff
changeset
|
396 |
################################################################ |
54 | 397 |
# Clean targets. |
398 |
||
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
399 |
.PHONY: distclean |
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
400 |
distclean: clean |
105
35cc545ec03d
'clean'-like targets delete artefacts after 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
103
diff
changeset
|
401 |
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
|
402 |
|
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
403 |
.PHONY: clean |
0 | 404 |
clean: |
276
66db1bbebe45
Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
275
diff
changeset
|
405 |
rm -f $(DICTDZ_FILES) $(INDEX_FILES) $(RST_GEN_FILES) $(RST_HTML_FILES) $(LOGO_PNG_FILES) |
110
bf134608773d
Merge with Makefile from 'jdone' project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
109
diff
changeset
|
406 |
rm -rf $(DIST_DIR) $(DIST_TARBALLS) |
bf134608773d
Merge with Makefile from 'jdone' project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
109
diff
changeset
|
407 |
rm -rf $(DISTSRC_DIR) $(DISTSRC_TARBALLS) |
63 | 408 |