Makefile
author Oleksandr Gavenko <gavenkoa@gmail.com>
Tue, 13 Oct 2015 17:50:46 +0300
changeset 311 47ae3d88a59d
parent 308 7a5f4265a581
child 312 951827960e91
permissions -rw-r--r--
Use more conventional tag naming schema.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
    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
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    45
# Version extracting/generation.
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    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
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    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
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    51
  endif
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    52
endif
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    53
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    54
# Here are vmajor and vminor. Look README section "Versioning rules."
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    55
-include VERSION
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    56
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    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}'); \
311
47ae3d88a59d Use more conventional tag naming schema.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 308
diff changeset
    62
vmajor=$${vtag#v}; \
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
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    77
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    78
################################################################
106
092b25d032af Set 'help' as default target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 105
diff changeset
    79
# Determine platform/environment.
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
    80
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
    81
host_os = unix
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
    82
ifneq '' '$(COMSPEC)'
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
    83
  ifneq '' '$(WINDIR)'
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
    84
    # Probably under Windows.
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
    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
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
    90
  endif
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
    91
endif
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
    92
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
    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
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   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
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   107
endif
107
4cfb94e11b5d Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
   108
RST2HTML_FLAGS := $(RST_FLAGS)
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   109
308
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   110
LATEX2PDF := pdflatex
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   111
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   112
################################################################
54
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   113
# Install paths.
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   114
41
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   115
ifeq '$(origin prefix)' 'undefined'
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   116
  ifeq '$(shell id -u)' '0'
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   117
    prefix = /usr/local
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   118
  else
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   119
    prefix = $(HOME)/usr
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   120
  endif
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   121
endif
121
38e8a1063673 Add 'DESTDIR' - prefix to 'prefix' variable value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 120
diff changeset
   122
datarootdir := $(DESTDIR)$(prefix)/share
41
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   123
datadir = $(datarootdir)/dictd
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   124
54
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   125
################################################################
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   126
# Project dirs/files.
21
d4b27e5b7a4b Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 20
diff changeset
   127
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   128
pkgname = gadict
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   129
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
   130
50
37931fbb857f Switch from ambiguous extension to unambiguous.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 46
diff changeset
   131
C5_FILES := $(wildcard *.dict-c5)
37931fbb857f Switch from ambiguous extension to unambiguous.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 46
diff changeset
   132
DICT_FILES := $(C5_FILES:.dict-c5=.dict)
37931fbb857f Switch from ambiguous extension to unambiguous.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 46
diff changeset
   133
DICTDZ_FILES := $(C5_FILES:.dict-c5=.dict.dz)
37931fbb857f Switch from ambiguous extension to unambiguous.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 46
diff changeset
   134
INDEX_FILES := $(C5_FILES:.dict-c5=.index)
1
b23e948de24a Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 0
diff changeset
   135
276
66db1bbebe45 Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 275
diff changeset
   136
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
   137
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
   138
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
   139
RST_HTML_FILES := $(RST_FILES:.rst=.html)
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   140
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   141
LOGO_NAME := logo
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   142
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
   143
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
   144
LOGO_PNG_FILES := $(patsubst %,$(LOGO_NAME)-%.png,$(LOGO_DIM))
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   145
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   146
DIST_DIR = $(fullpkgname)
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   147
DISTSRC_DIR = $(fullpkgname)_src
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   148
276
66db1bbebe45 Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 275
diff changeset
   149
DIST_FILES = $(DICTDZ_FILES) $(INDEX_FILES) $(RST_HTML_FILES) $(RST_FILES) VERSION
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   150
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   151
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
   152
DISTSRC_FILES = $(C5_FILES) $(RST_FILES) $(DISTSRC_HELPER_FILES)
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   153
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   154
DIST_TARBALLS = $(DIST_DIR).tar.gz $(DIST_DIR).tar.bz2
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   155
DISTSRC_TARBALLS = $(DISTSRC_DIR).tar.gz $(DISTSRC_DIR).tar.bz2
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
################################################################
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   158
# Deploy targets.
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   159
118
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
   160
ifeq '' '$(SF_USER)'
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
   161
  SF_USER := gavenkoa
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
   162
endif
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
   163
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   164
.PHONY: deploy
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   165
deploy: deploy2sf
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   166
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   167
# 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
   168
#   $ sftp $(SF_USER),$(pkgname)@web.sourceforge.net
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   169
# as it may require interactive input for accepting server public key.
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   170
# Next time any action fully automated.
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   171
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   172
.PHONY: deploy2sf
308
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   173
deploy2sf: deploy2sf-src deploy2sf-doc deploy2sf-voa deploy2sf-release
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   174
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   175
.PHONY: deploy2sf-src
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   176
deploy2sf-src:
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   177
	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
   178
119
20f1d1080886 Rename 'name' ==> 'pkgname'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 118
diff changeset
   179
# Will be accessed via http://$(pkgname).sourceforge.net
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   180
.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
   181
deploy2sf-doc: deploy-check $(RST_HTML_FILES)
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   182
	( 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
   183
for f in $(RST_HTML_FILES); do \
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   184
  echo "put $$f"; \
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   185
  echo "chmod 644 $$f"; \
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   186
done; \
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   187
echo 'quit'; \
120
cb5ab06a72a7 Inline URL to make code more verbose.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 119
diff changeset
   188
) | sftp -b - $(SF_USER),$(pkgname)@web.sourceforge.net
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   189
308
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   190
.PHONY: deploy2sf-voa
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   191
deploy2sf-voa: voa
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   192
	( echo 'cd htdocs'; \
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   193
  echo "put voa-special.pdf"; \
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   194
  echo "chmod 644 voa-special.pdf"; \
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   195
done; \
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   196
echo 'quit'; \
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   197
) | sftp -b - $(SF_USER),$(pkgname)@web.sourceforge.net
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   198
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   199
.PHONY: deploy2sf-release
125
63b391bee058 Add dependency to 'deploy*' targets on 'deploy-check' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 124
diff changeset
   200
deploy2sf-release: deploy-check $(DIST_TARBALLS) $(DISTSRC_TARBALLS)
287
d01045b55e04 Avoid names inlining.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 276
diff changeset
   201
	( 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
   202
echo "put  README.rst"; \
1c6ffaecdf50 Fix sftp command usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 112
diff changeset
   203
echo "chmod 644 README.rst"; \
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   204
echo "mkdir v$(vmajor).$(vminor)"; \
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   205
echo "cd v$(vmajor).$(vminor)"; \
142
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 141
diff changeset
   206
for f in $(DIST_TARBALLS) $(DISTSRC_TARBALLS); do \
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   207
	echo "put $$f"; \
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   208
	echo "chmod 644 $$f"; \
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   209
done; \
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   210
echo 'quit'; \
120
cb5ab06a72a7 Inline URL to make code more verbose.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 119
diff changeset
   211
) | sftp -b - $(SF_USER),$(pkgname)@frs.sourceforge.net
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   212
124
7d9f38580ed9 Add 'deploy-check' target to check source sanity before release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 123
diff changeset
   213
.PHONY: deploy-check
7d9f38580ed9 Add 'deploy-check' target to check source sanity before release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 123
diff changeset
   214
deploy-check:
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   215
	\
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   216
case ${visclean} in \
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   217
  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
   218
    exit 1;; \
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   219
esac
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   220
	\
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   221
case $(vatrelease) in \
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   222
  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
   223
    exit 1;; \
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   224
esac
124
7d9f38580ed9 Add 'deploy-check' target to check source sanity before release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 123
diff changeset
   225
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   226
################################################################
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   227
# Dist targets.
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   228
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   229
.PHONY: dist
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   230
dist: dist-dictd dist-src
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   231
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   232
.PHONY: dist-dictd
105
35cc545ec03d 'clean'-like targets delete artefacts after 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 103
diff changeset
   233
dist-dictd: $(DIST_TARBALLS)
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   234
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   235
.PHONY: dist-src
105
35cc545ec03d 'clean'-like targets delete artefacts after 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 103
diff changeset
   236
dist-src: $(DISTSRC_TARBALLS)
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   237
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   238
%.tar.gz: %
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   239
	tar zcf $*.tar.gz $*
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   240
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   241
%.tar.bz2: %
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   242
	tar jcf $*.tar.bz2 $*
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   243
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   244
$(DIST_DIR): $(DIST_FILES)
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   245
	rm -rf $@
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   246
	mkdir $@
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   247
	cp $(DIST_FILES) $@
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   248
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   249
$(DISTSRC_DIR): $(DISTSRC_FILES)
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   250
	rm -rf $@
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   251
	mkdir $@
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   252
	cp $(DISTSRC_FILES) $@
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   253
54
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   254
################################################################
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   255
# Build targets.
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   256
23
946ae4b96419 Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 22
diff changeset
   257
.PHONY: all
245
5b9fac360762 Rename target to avoid disambiguate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 241
diff changeset
   258
all: dict
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   259
245
5b9fac360762 Rename target to avoid disambiguate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 241
diff changeset
   260
.PHONY: dict
5b9fac360762 Rename target to avoid disambiguate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 241
diff changeset
   261
dict: $(DICTDZ_FILES) $(INDEX_FILES)
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   262
41
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   263
#  --case-sensitive
50
37931fbb857f Switch from ambiguous extension to unambiguous.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 46
diff changeset
   264
%.dict %.index: %.dict-c5
46
86c0184efac7 Comment syntax convention.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 41
diff changeset
   265
	sed '/^#/d' $< | dictfmt  -c5 \
41
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   266
	--headword-separator '; ' --break-headwords \
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   267
	--utf8 --allchars \
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   268
	-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
   269
	-s "`sed -n '/^ABOUT: /{s=ABOUT: ==;p;q;}' $<`" \
46
86c0184efac7 Comment syntax convention.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 41
diff changeset
   270
	$*
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   271
41
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   272
%.dict.dz: %.dict
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   273
	dictzip -c $< >$@
1
b23e948de24a Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 0
diff changeset
   274
54
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   275
################################################################
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   276
# Install/uninstall targets.
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   277
23
946ae4b96419 Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 22
diff changeset
   278
.PHONY: install
148
b0142666eeba Fix dependency for 'install' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 146
diff changeset
   279
install: $(DICTDZ_FILES) $(INDEX_FILES)
41
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   280
	mkdir -p $(datadir)
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   281
	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
   282
		$(INSTALL_DATA) $$f $(datadir); \
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   283
	done
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   284
23
946ae4b96419 Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 22
diff changeset
   285
.PHONY: uninstall
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   286
uninstall:
41
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   287
	for f in $(DICTDZ_FILES) $(INDEX_FILES); do \
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   288
		rm -f $(datadir)/$$f; \
21
d4b27e5b7a4b Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 20
diff changeset
   289
	done
13
d0e948499faf Added targets [un]install-user to proper install dict for current user.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 9
diff changeset
   290
54
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   291
################################################################
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   292
# Documentation targets.
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   293
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   294
.PHONY: docs
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   295
docs: html
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   296
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   297
.PHONY: html
276
66db1bbebe45 Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 275
diff changeset
   298
html: $(RST_HTML_FILES)
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   299
276
66db1bbebe45 Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 275
diff changeset
   300
$(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
   301
	$(RST2HTML) $(RST2HTML_FLAGS) --stylesheet=rst.css $*.rst $@
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   302
150
28cd06b06bb8 Rename BUILD_SCRIPT ==> BUILD_SCRIPTS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 148
diff changeset
   303
VERSION.rst: VERSION $(BUILD_SCRIPTS)
109
5bb58b8d87a7 Add version info into documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 108
diff changeset
   304
	{ \
127
2fc0561f80ca Include source state info in documentation build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 125
diff changeset
   305
	echo 'For ``$(pkgname)`` version: ``$(vmajor).$(vminor)``.'; \
2fc0561f80ca Include source state info in documentation build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 125
diff changeset
   306
	echo; \
2fc0561f80ca Include source state info in documentation build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 125
diff changeset
   307
	case ${visclean} in \
2fc0561f80ca Include source state info in documentation build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 125
diff changeset
   308
		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
   309
		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
   310
	esac; \
109
5bb58b8d87a7 Add version info into documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 108
diff changeset
   311
	echo; \
127
2fc0561f80ca Include source state info in documentation build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 125
diff changeset
   312
	case ${vatrelease} in \
2fc0561f80ca Include source state info in documentation build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 125
diff changeset
   313
		yes) echo 'Package is at release state.';; \
2fc0561f80ca Include source state info in documentation build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 125
diff changeset
   314
		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
   315
	esac; \
2fc0561f80ca Include source state info in documentation build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 125
diff changeset
   316
	echo; \
2fc0561f80ca Include source state info in documentation build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 125
diff changeset
   317
	echo 'Build date: ``'$$(date +%F)'``.'; \
109
5bb58b8d87a7 Add version info into documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 108
diff changeset
   318
	} >$@
5bb58b8d87a7 Add version info into documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 108
diff changeset
   319
276
66db1bbebe45 Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 275
diff changeset
   320
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
   321
	cp $< $@
66db1bbebe45 Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 275
diff changeset
   322
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   323
################################################################
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   324
# Misc targets.
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
.PHONY: logo
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   327
logo: logo-png
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   328
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   329
.PHONY: logo-png
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   330
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
   331
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   332
# Require:
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   333
#   $ 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
   334
$(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
   335
	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
   336
308
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   337
.PHONY: voa
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   338
voa: voa-special.pdf
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   339
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   340
voa-special.pdf: contrib/voa-special.tex
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   341
	$(LATEX2PDF) -output-directory . $<
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   342
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   343
################################################################
108
1f1363141da7 Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 107
diff changeset
   344
# Helpers targets.
1f1363141da7 Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 107
diff changeset
   345
1f1363141da7 Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 107
diff changeset
   346
.PHONY: help
1f1363141da7 Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 107
diff changeset
   347
help:
122
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   348
	@\
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   349
echo; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   350
echo Current configuration:; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   351
echo; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   352
sed 's=^=  =' <VERSION
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   353
	@if [ -f Makefile.config ]; then \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   354
		echo; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   355
		echo User configuration:; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   356
		echo; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   357
		sed 's=^=  =' <Makefile.config; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   358
	fi
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   359
	@\
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   360
echo; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   361
echo Supported targets:; \
123
49f373dba523 Fix output sanity.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 122
diff changeset
   362
echo; \
150
28cd06b06bb8 Rename BUILD_SCRIPT ==> BUILD_SCRIPTS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 148
diff changeset
   363
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
   364
249
5ad075a475f2 TODO convention.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 245
diff changeset
   365
.PHONY: todo
5ad075a475f2 TODO convention.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 245
diff changeset
   366
todo:
5ad075a475f2 TODO convention.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 245
diff changeset
   367
	grep -nH 'TODO\|XXX' $(RST_FILES) $(C5_FILES)
5ad075a475f2 TODO convention.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 245
diff changeset
   368
94
1b2cf5b2b46c Add target that print statistics about word count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 85
diff changeset
   369
.PHONY: stat
128
ca6ceff4941c Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 127
diff changeset
   370
stat: STAT.rst
ca6ceff4941c Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 127
diff changeset
   371
206
407f2a82ef26 Include common header for quick links. Exclude unnecessary .html files from build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 204
diff changeset
   372
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
   373
	{ \
206
407f2a82ef26 Include common header for quick links. Exclude unnecessary .html files from build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 204
diff changeset
   374
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
   375
echo; \
128
ca6ceff4941c Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 127
diff changeset
   376
echo '============================'; \
ca6ceff4941c Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 127
diff changeset
   377
echo ' gadict project statistics.'; \
ca6ceff4941c Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 127
diff changeset
   378
echo '============================'; \
ca6ceff4941c Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 127
diff changeset
   379
echo '.. contents::'; \
ca6ceff4941c Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 127
diff changeset
   380
echo; \
146
6be7851b9650 Inlcude version info in 'STAT.rst'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 142
diff changeset
   381
echo 'Document version.'; \
6be7851b9650 Inlcude version info in 'STAT.rst'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 142
diff changeset
   382
echo '================='; \
6be7851b9650 Inlcude version info in 'STAT.rst'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 142
diff changeset
   383
echo; \
6be7851b9650 Inlcude version info in 'STAT.rst'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 142
diff changeset
   384
echo '.. include:: VERSION.rst'; \
6be7851b9650 Inlcude version info in 'STAT.rst'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 142
diff changeset
   385
echo; \
222
242db5c0f8ce Add description what table are.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 207
diff changeset
   386
echo 'Statistics on count of articles in gadict dictionaries.'; \
242db5c0f8ce Add description what table are.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 207
diff changeset
   387
echo '======================================================='; \
242db5c0f8ce Add description what table are.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 207
diff changeset
   388
echo; \
242db5c0f8ce Add description what table are.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 207
diff changeset
   389
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
   390
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
   391
echo; \
ca6ceff4941c Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 127
diff changeset
   392
echo '======================================== ====='; \
ca6ceff4941c Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 127
diff changeset
   393
echo '             Dictionary                  Count'; \
ca6ceff4941c Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 127
diff changeset
   394
echo '======================================== ====='; \
ca6ceff4941c Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 127
diff changeset
   395
total=0; \
ca6ceff4941c Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 127
diff changeset
   396
for dic in $(C5_FILES); do \
ca6ceff4941c Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 127
diff changeset
   397
  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
   398
  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
   399
  total=$$(($$total + $$cnt)); \
ca6ceff4941c Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 127
diff changeset
   400
done; \
ca6ceff4941c Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 127
diff changeset
   401
printf '%40s %5s\n' '**Total**' $$total; \
ca6ceff4941c Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 127
diff changeset
   402
echo '======================================== ====='; \
ca6ceff4941c Generate "gadict article count" statistic in RST format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 127
diff changeset
   403
} >$@
94
1b2cf5b2b46c Add target that print statistics about word count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 85
diff changeset
   404
241
13fcad0b3a84 Add project logo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 240
diff changeset
   405
.PHONY: logo-png
13fcad0b3a84 Add project logo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 240
diff changeset
   406
logo-png: logo-64x64.png
13fcad0b3a84 Add project logo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 240
diff changeset
   407
13fcad0b3a84 Add project logo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 240
diff changeset
   408
# Require:
13fcad0b3a84 Add project logo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 240
diff changeset
   409
#   $ sudo apt-get install imagemagick librsvg2-bin
13fcad0b3a84 Add project logo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 240
diff changeset
   410
%.png: %.svg
274
f0b6d4c0ee97 Set transparent background for PNG logo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 261
diff changeset
   411
	convert +antialias -background transparent $< $@
241
13fcad0b3a84 Add project logo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 240
diff changeset
   412
94
1b2cf5b2b46c Add target that print statistics about word count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 85
diff changeset
   413
################################################################
54
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   414
# Clean targets.
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   415
23
946ae4b96419 Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 22
diff changeset
   416
.PHONY: distclean
946ae4b96419 Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 22
diff changeset
   417
distclean: clean
105
35cc545ec03d 'clean'-like targets delete artefacts after 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 103
diff changeset
   418
	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
   419
23
946ae4b96419 Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 22
diff changeset
   420
.PHONY: clean
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   421
clean:
276
66db1bbebe45 Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 275
diff changeset
   422
	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
   423
	rm -rf $(DIST_DIR) $(DIST_TARBALLS)
bf134608773d Merge with Makefile from 'jdone' project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 109
diff changeset
   424
	rm -rf $(DISTSRC_DIR) $(DISTSRC_TARBALLS)
308
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   425
	rm -f $(patsubst %, voa-special%, .pdf .log .out .aux)
63
f1bd82604661 Add help target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 56
diff changeset
   426