Makefile
author Oleksandr Gavenko <gavenkoa@gmail.com>
Fri, 21 Jul 2023 23:23:31 +0300
changeset 1347 272ec25b6f12
parent 1327 d2c3b60decaf
permissions -rw-r--r--
Mark word frequency based on Paul Nation BNC+COCA 25k wordfamily list.
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.
22
0616adf6e983 Describe available build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 21
diff changeset
    15
260
5f6befed263c Delete target file if command fails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 249
diff changeset
    16
################################################################
5f6befed263c Delete target file if command fails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 249
diff changeset
    17
# Standard GNU Makefile settings.
5f6befed263c Delete target file if command fails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 249
diff changeset
    18
287
d01045b55e04 Avoid names inlining.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 276
diff changeset
    19
SHELL = /bin/bash
36
6fee90eb2d85 Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
    20
export PATH := /bin:/usr/bin:${PATH}
6fee90eb2d85 Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
    21
6fee90eb2d85 Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
    22
# Disable built in pattern rules.
6fee90eb2d85 Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
    23
MAKEFLAGS += -r
6fee90eb2d85 Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
    24
# Disable built in variables.
6fee90eb2d85 Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
    25
MAKEFLAGS += -R
6fee90eb2d85 Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
    26
# Disable built in suffix rules.
6fee90eb2d85 Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
    27
.SUFFIXES:
260
5f6befed263c Delete target file if command fails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 249
diff changeset
    28
# Delete target file if command fails.
5f6befed263c Delete target file if command fails.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 249
diff changeset
    29
.DELETE_ON_ERROR:
36
6fee90eb2d85 Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
    30
# Default target.
106
092b25d032af Set 'help' as default target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 105
diff changeset
    31
.DEFAULT_GOAL = help
36
6fee90eb2d85 Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
    32
54
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
    33
################################################################
1314
3bd48b5e12c6 Detect platform before including Makefile.config to be able to use variable in the build config.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1309
diff changeset
    34
# Determine platform/environment.
3bd48b5e12c6 Detect platform before including Makefile.config to be able to use variable in the build config.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1309
diff changeset
    35
3bd48b5e12c6 Detect platform before including Makefile.config to be able to use variable in the build config.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1309
diff changeset
    36
host_os = unix
3bd48b5e12c6 Detect platform before including Makefile.config to be able to use variable in the build config.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1309
diff changeset
    37
ifneq '' '$(COMSPEC)'
3bd48b5e12c6 Detect platform before including Makefile.config to be able to use variable in the build config.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1309
diff changeset
    38
  ifneq '' '$(WINDIR)'
3bd48b5e12c6 Detect platform before including Makefile.config to be able to use variable in the build config.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1309
diff changeset
    39
    # Probably under Windows.
3bd48b5e12c6 Detect platform before including Makefile.config to be able to use variable in the build config.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1309
diff changeset
    40
    host_os = windows
3bd48b5e12c6 Detect platform before including Makefile.config to be able to use variable in the build config.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1309
diff changeset
    41
    ifneq '' '$(wildcard /etc/setup/*cygwin*)'
3bd48b5e12c6 Detect platform before including Makefile.config to be able to use variable in the build config.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1309
diff changeset
    42
      # Probably under Cygwin.
3bd48b5e12c6 Detect platform before including Makefile.config to be able to use variable in the build config.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1309
diff changeset
    43
      host_os = cygwin
3bd48b5e12c6 Detect platform before including Makefile.config to be able to use variable in the build config.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1309
diff changeset
    44
    endif
3bd48b5e12c6 Detect platform before including Makefile.config to be able to use variable in the build config.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1309
diff changeset
    45
  endif
3bd48b5e12c6 Detect platform before including Makefile.config to be able to use variable in the build config.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1309
diff changeset
    46
endif
3bd48b5e12c6 Detect platform before including Makefile.config to be able to use variable in the build config.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1309
diff changeset
    47
3bd48b5e12c6 Detect platform before including Makefile.config to be able to use variable in the build config.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1309
diff changeset
    48
ifneq '' '$(wildcard /etc/wsl.conf)'
3bd48b5e12c6 Detect platform before including Makefile.config to be able to use variable in the build config.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1309
diff changeset
    49
  is_wsl := yes
3bd48b5e12c6 Detect platform before including Makefile.config to be able to use variable in the build config.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1309
diff changeset
    50
endif
3bd48b5e12c6 Detect platform before including Makefile.config to be able to use variable in the build config.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1309
diff changeset
    51
3bd48b5e12c6 Detect platform before including Makefile.config to be able to use variable in the build config.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1309
diff changeset
    52
################################################################
118
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
    53
# Build script definitions.
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
    54
150
28cd06b06bb8 Rename BUILD_SCRIPT ==> BUILD_SCRIPTS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 148
diff changeset
    55
BUILD_SCRIPTS := $(firstword $(MAKEFILE_LIST))
118
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
    56
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
    57
ifneq '' '$(wildcard Makefile.config)'
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
    58
  include Makefile.config
150
28cd06b06bb8 Rename BUILD_SCRIPT ==> BUILD_SCRIPTS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 148
diff changeset
    59
  BUILD_SCRIPTS += Makefile.config
118
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
    60
endif
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
    61
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
    62
################################################################
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    63
# Version extracting/generation.
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    64
480
4413ccc9e216 Include VERSION file into source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 479
diff changeset
    65
VER_FILE := VERSION
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
    66
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
    67
# Prevent making distribution with wrong version.
588
63f430bda7f9 Release and deploy target should use fresh version info. Add alias to deploy sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 587
diff changeset
    68
ifneq '' '$(filter deploy% release% dist%,$(MAKECMDGOALS))'
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    69
  ifeq '' '$(MAKE_RESTARTS)'
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
    70
    $(shell rm -f $(VER_FILE))
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    71
  endif
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    72
endif
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    73
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    74
# Here are vmajor and vminor. Look README section "Versioning rules."
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
    75
-include $(VER_FILE)
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    76
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
    77
$(VER_FILE): | $(dir $(VER_FILE))
122
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    78
	\
482
fefea56726d2 Warn if build done without version file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 481
diff changeset
    79
[ -d .hg/ ] || { echo We miss VERSION file!!; exit 0; }; \
122
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    80
vtagdist=$$(hg log -r . --template '{latesttagdistance}'); \
141
4b799e3f9a70 Allow release from commit that tag release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 137
diff changeset
    81
vatrelease=$$([ $$vtagdist -le 1 ] && echo yes || echo no); \
122
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    82
vtag=$$(hg log -r . --template '{latesttag}'); \
311
47ae3d88a59d Use more conventional tag naming schema.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 308
diff changeset
    83
vmajor=$${vtag#v}; \
151
206fb46e793d Make code more genetic.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 150
diff changeset
    84
vmajor=$${vmajor%%.*}; \
122
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    85
vminor=$${vtag#*.}; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    86
vrev=$$(hg id -i); \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    87
visclean=$$(case $$vrev in *+) echo no;; *) echo yes;; esac); \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    88
vrev=$${vrev%+}; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    89
{ \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    90
echo "vrev=$$vrev"; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    91
echo "vtag=$$vtag"; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    92
echo "vtagdist=$$vtagdist"; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    93
echo "visclean=$$visclean"; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    94
echo "vatrelease=$$vatrelease"; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    95
echo "vmajor=$$vmajor"; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    96
echo "vminor=$$vminor"; \
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
    97
} >$@
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    98
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    99
################################################################
107
4cfb94e11b5d Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
   100
# Build tools definition/switches.
4cfb94e11b5d Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
   101
121
38e8a1063673 Add 'DESTDIR' - prefix to 'prefix' variable value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 120
diff changeset
   102
INSTALL = install
38e8a1063673 Add 'DESTDIR' - prefix to 'prefix' variable value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 120
diff changeset
   103
INSTALL_PROGRAM = $(INSTALL)
38e8a1063673 Add 'DESTDIR' - prefix to 'prefix' variable value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 120
diff changeset
   104
INSTALL_DATA = $(INSTALL) -m 644
38e8a1063673 Add 'DESTDIR' - prefix to 'prefix' variable value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 120
diff changeset
   105
107
4cfb94e11b5d Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
   106
RST_WARNING_FLAGS := --halt warning
4cfb94e11b5d Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
   107
RST_FLAGS := --strip-comments
4cfb94e11b5d Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
   108
RST_FLAGS += $(RST_WARNING_FLAGS)
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   109
107
4cfb94e11b5d Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
   110
RST2HTML := rst2html
4cfb94e11b5d Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
   111
ifeq '$(host_os)' 'cygwin'
4cfb94e11b5d Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
   112
  RST2HTML := rst2html.py
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   113
endif
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   114
RST2HTML_RENDER_FLAGS := --strip-comments --embed-stylesheet --no-xml-declaration --math-output=HTML --initial-header-level=2
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   115
RST2HTML_FLAGS := $(RST_FLAGS) $(RST2HTML_RENDER_FLAGS)
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   116
308
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   117
LATEX2PDF := pdflatex
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   118
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   119
PYTHON ?= python3
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   120
875
ebba66b977b6 Ported Anki decks build to Cygwin+Windows. Added corresponding docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 844
diff changeset
   121
ifeq '$(ANKI_PY_DIR)' ''
ebba66b977b6 Ported Anki decks build to Cygwin+Windows. Added corresponding docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 844
diff changeset
   122
  ANKI_PY_DIR := /usr/share/anki
ebba66b977b6 Ported Anki decks build to Cygwin+Windows. Added corresponding docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 844
diff changeset
   123
endif
ebba66b977b6 Ported Anki decks build to Cygwin+Windows. Added corresponding docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 844
diff changeset
   124
1309
5f52c9e8b9b0 Added build target to upload Anki files to Android phone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1259
diff changeset
   125
ADB := adb
5f52c9e8b9b0 Added build target to upload Anki files to Android phone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1259
diff changeset
   126
ifeq 'yes' '$(is_wsl)'
5f52c9e8b9b0 Added build target to upload Anki files to Android phone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1259
diff changeset
   127
  ADB := adb.exe
5f52c9e8b9b0 Added build target to upload Anki files to Android phone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1259
diff changeset
   128
endif
5f52c9e8b9b0 Added build target to upload Anki files to Android phone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1259
diff changeset
   129
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   130
################################################################
54
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   131
# Install paths.
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   132
41
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   133
ifeq '$(origin prefix)' 'undefined'
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   134
  ifeq '$(shell id -u)' '0'
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   135
    prefix = /usr/local
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   136
  else
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   137
    prefix = $(HOME)/usr
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   138
  endif
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   139
endif
388
d98d8f8cdef9 Eliminate "DESTDIR", "prefix" variable should be sufficient.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 387
diff changeset
   140
datarootdir := $(prefix)/share
389
10020d94a315 Install/uninstall "gadict.el".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
   141
datadir := $(datarootdir)/dictd
10020d94a315 Install/uninstall "gadict.el".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
   142
elispdir := $(datarootdir)/emacs/site-lisp
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   143
54
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   144
################################################################
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   145
# Project dirs/files.
21
d4b27e5b7a4b Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 20
diff changeset
   146
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   147
pkgname = gadict
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   148
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
   149
401
791994f95561 Add dependency on py files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 396
diff changeset
   150
PY_FILES := $(wildcard py/gadict*.py)
791994f95561 Add dependency on py files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 396
diff changeset
   151
830
9631386b2ec2 Preserve order of dictionary files in order to simplify comparing of reports
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 829
diff changeset
   152
GADICT_FILES := $(sort $(wildcard *.gadict))
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   153
624
934a2a6cbe27 Add dictionaries logo. Goldendict supports PNG format and by default display
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   154
C5_FILES := $(patsubst %.gadict,dist/dictd/%.c5,$(GADICT_FILES))
410
65b38ec04ea4 Include VOA in build. Make possible separate Ru/Uk build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 404
diff changeset
   155
ALL_C5_FILES := $(C5_FILES) dist/dictd/gadict_en-ru.c5 dist/dictd/gadict_en-uk.c5
624
934a2a6cbe27 Add dictionaries logo. Goldendict supports PNG format and by default display
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   156
PNG_FILES := $(patsubst %.gadict,dist/dictd/%.png,$(GADICT_FILES))
387
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   157
DICT_FILES := $(C5_FILES:.c5=.dict)
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   158
DICTDZ_FILES := $(C5_FILES:.c5=.dict.dz)
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   159
INDEX_FILES := $(C5_FILES:.c5=.index)
1
b23e948de24a Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 0
diff changeset
   160
1203
c767b62ec786 Added support for gaphrase format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1202
diff changeset
   161
GAPHRASE_FILES := $(wildcard *.gaphrase)
c767b62ec786 Added support for gaphrase format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1202
diff changeset
   162
GADIALOG_FILES := $(wildcard *.gadialog)
c767b62ec786 Added support for gaphrase format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1202
diff changeset
   163
536
c9f0064d8661 Generate import file for space repetition software in TAB format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 505
diff changeset
   164
SRS_TAB_FILES := $(patsubst %.gadict,dist/srs/%.tab.txt,$(GADICT_FILES))
1203
c767b62ec786 Added support for gaphrase format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1202
diff changeset
   165
SRS_ANKI_FILES := \
c767b62ec786 Added support for gaphrase format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1202
diff changeset
   166
  $(patsubst %.gadict,dist/anki/%.apkg,$(GADICT_FILES)) \
c767b62ec786 Added support for gaphrase format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1202
diff changeset
   167
  $(patsubst %.gaphrase,dist/anki/%.apkg,$(GAPHRASE_FILES)) \
c767b62ec786 Added support for gaphrase format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1202
diff changeset
   168
  $(patsubst %.gadialog,dist/anki/%.apkg,$(GADIALOG_FILES))
536
c9f0064d8661 Generate import file for space repetition software in TAB format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 505
diff changeset
   169
1224
23dc533e3dd3 Added HTML formatter for gadialog files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1214
diff changeset
   170
DICT_HTML_FILES := \
23dc533e3dd3 Added HTML formatter for gadialog files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1214
diff changeset
   171
  $(patsubst %.gadict,dist/html/%.html,$(GADICT_FILES)) \
23dc533e3dd3 Added HTML formatter for gadialog files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1214
diff changeset
   172
  dist/html/gadialog.html
776
d57c28843156 Generate HTML form of dictionary for online presents.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   173
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   174
RST_TMPL_FILE = dist/misc/rst.tmpl
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   175
RST_CSS_FILE = www/tmpl/rst.css
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   176
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   177
RST_FILES := $(wildcard www/*.rst)
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   178
RST_HTML_FILES := $(patsubst www/%.rst,dist/www/%.html,$(RST_FILES))
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   179
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   180
INDEX_HTML_FILE := dist/www/index.html
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   181
794
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   182
STAT_MISSING_FILE := dist/misc/MISSING.rst
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   183
STAT_RST_FILE := dist/misc/STAT.rst
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   184
STAT_HTML_FILE := dist/www/STAT.html
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   185
774
7e8a7ec72bb4 Avoid 'HTML_FILES' generic name usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 773
diff changeset
   186
WWW_HTML_FILES := $(RST_HTML_FILES) $(INDEX_HTML_FILE) $(STAT_HTML_FILE)
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   187
684
6ba6249fb194 Create new project logo. Add favicon to project sites.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 683
diff changeset
   188
LOGO_FILE := www/logo.svg
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   189
LOGO_DIM := 32x32 48x48 64x64
684
6ba6249fb194 Create new project logo. Add favicon to project sites.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 683
diff changeset
   190
LOGO_PNG_FILES := $(patsubst %,dist/misc/logo-%.png,$(LOGO_DIM))
1209
eacf1b282688 Switched to graphicsmagick to generate favicon. It doesn't support Microsoft ICO so generate PNG instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1207
diff changeset
   191
FAVICON := dist/www/favicon.png
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   192
1253
a4a1e57e8ad7 Renamed dir: contrib/ => misc/.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1226
diff changeset
   193
EL_FILES := $(wildcard misc/*.el)
1142
ce538f6b30b1 Added gaphrase.el to install build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1075
diff changeset
   194
1259
e15d2e210840 Stopped to generate releases in format .tar.gz to reduce duplication of release data. .zip is sufficient.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1253
diff changeset
   195
DISTREL_TARBALLS = dist/$(fullpkgname).zip # dist/$(fullpkgname).tar.gz
e15d2e210840 Stopped to generate releases in format .tar.gz to reduce duplication of release data. .zip is sufficient.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1253
diff changeset
   196
DISTSRC_TARBALLS = dist/$(fullpkgname)_src.zip # dist/$(fullpkgname)_src.tar.gz
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   197
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   198
################################################################
633
f622dfd21f2c Move install targets to top.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 632
diff changeset
   199
# Install/uninstall targets.
f622dfd21f2c Move install targets to top.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 632
diff changeset
   200
f622dfd21f2c Move install targets to top.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 632
diff changeset
   201
.PHONY: install
754
2c32c47e83a9 Split Emacs mode installation from dictionary files installation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 724
diff changeset
   202
install: install-dict install-emacs
2c32c47e83a9 Split Emacs mode installation from dictionary files installation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 724
diff changeset
   203
2c32c47e83a9 Split Emacs mode installation from dictionary files installation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 724
diff changeset
   204
.PHONY: install-dict
2c32c47e83a9 Split Emacs mode installation from dictionary files installation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 724
diff changeset
   205
install-dict: $(DICTDZ_FILES) $(INDEX_FILES) $(PNG_FILES)
2c32c47e83a9 Split Emacs mode installation from dictionary files installation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 724
diff changeset
   206
	mkdir -p $(datadir)
633
f622dfd21f2c Move install targets to top.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 632
diff changeset
   207
	for f in $(DICTDZ_FILES) $(INDEX_FILES) $(PNG_FILES); do \
f622dfd21f2c Move install targets to top.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 632
diff changeset
   208
		$(INSTALL_DATA) $$f $(datadir); \
f622dfd21f2c Move install targets to top.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 632
diff changeset
   209
	done
754
2c32c47e83a9 Split Emacs mode installation from dictionary files installation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 724
diff changeset
   210
947
d46d0a91ac48 Added alias for target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 942
diff changeset
   211
.PHONY: install-emacs install-el
d46d0a91ac48 Added alias for target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 942
diff changeset
   212
install-el: install-emacs
754
2c32c47e83a9 Split Emacs mode installation from dictionary files installation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 724
diff changeset
   213
install-emacs:
2c32c47e83a9 Split Emacs mode installation from dictionary files installation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 724
diff changeset
   214
	mkdir -p $(elispdir)
1142
ce538f6b30b1 Added gaphrase.el to install build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1075
diff changeset
   215
	$(INSTALL_DATA) $(EL_FILES) $(elispdir)
ce538f6b30b1 Added gaphrase.el to install build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1075
diff changeset
   216
	emacs -batch -f batch-byte-compile $(patsubst %,$(elispdir)/%,$(notdir $(EL_FILES)))
633
f622dfd21f2c Move install targets to top.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 632
diff changeset
   217
f622dfd21f2c Move install targets to top.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 632
diff changeset
   218
.PHONY: uninstall
f622dfd21f2c Move install targets to top.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 632
diff changeset
   219
uninstall:
770
71b9d7ea4885 Fix 'uninstall' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 768
diff changeset
   220
	for f in $(notdir $(DICTDZ_FILES) $(INDEX_FILES) $(PNG_FILES)); do \
633
f622dfd21f2c Move install targets to top.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 632
diff changeset
   221
		rm -f $(datadir)/$$f; \
f622dfd21f2c Move install targets to top.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 632
diff changeset
   222
	done
1142
ce538f6b30b1 Added gaphrase.el to install build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1075
diff changeset
   223
	rm -f $(patsubst %,$(elispdir)/%,$(notdir $(EL_FILES))) $(patsubst %.el,$(elispdir)/%.elc,$(notdir $(EL_FILES)))
633
f622dfd21f2c Move install targets to top.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 632
diff changeset
   224
1327
d2c3b60decaf Added target for uploading gadict dictd dictionary to Android GoldenDict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1322
diff changeset
   225
.PHONY: android-upload-anki
d2c3b60decaf Added target for uploading gadict dictd dictionary to Android GoldenDict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1322
diff changeset
   226
android-upload-anki: $(SRS_ANKI_FILES)
1309
5f52c9e8b9b0 Added build target to upload Anki files to Android phone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1259
diff changeset
   227
	\
5f52c9e8b9b0 Added build target to upload Anki files to Android phone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1259
diff changeset
   228
for f in $(SRS_ANKI_FILES); do \
5f52c9e8b9b0 Added build target to upload Anki files to Android phone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1259
diff changeset
   229
  $(ADB) push $$f /sdcard/AnkiDroid/; \
5f52c9e8b9b0 Added build target to upload Anki files to Android phone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1259
diff changeset
   230
done
5f52c9e8b9b0 Added build target to upload Anki files to Android phone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1259
diff changeset
   231
1327
d2c3b60decaf Added target for uploading gadict dictd dictionary to Android GoldenDict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1322
diff changeset
   232
goldendict_dir := /sdcard/GoldenDict/
d2c3b60decaf Added target for uploading gadict dictd dictionary to Android GoldenDict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1322
diff changeset
   233
d2c3b60decaf Added target for uploading gadict dictd dictionary to Android GoldenDict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1322
diff changeset
   234
.PHONY: android-upload-goldendict
d2c3b60decaf Added target for uploading gadict dictd dictionary to Android GoldenDict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1322
diff changeset
   235
android-upload-goldendict: dist/dictd/gadict.dict.dz dist/dictd/gadict.index
d2c3b60decaf Added target for uploading gadict dictd dictionary to Android GoldenDict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1322
diff changeset
   236
	\
d2c3b60decaf Added target for uploading gadict dictd dictionary to Android GoldenDict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1322
diff changeset
   237
$(ADB) shell mkdir $(goldendict_dir); \
d2c3b60decaf Added target for uploading gadict dictd dictionary to Android GoldenDict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1322
diff changeset
   238
for f in dist/dictd/gadict.dict.dz dist/dictd/gadict.index; do \
d2c3b60decaf Added target for uploading gadict dictd dictionary to Android GoldenDict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1322
diff changeset
   239
  $(ADB) push $$f $(goldendict_dir); \
d2c3b60decaf Added target for uploading gadict dictd dictionary to Android GoldenDict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1322
diff changeset
   240
done
d2c3b60decaf Added target for uploading gadict dictd dictionary to Android GoldenDict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1322
diff changeset
   241
633
f622dfd21f2c Move install targets to top.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 632
diff changeset
   242
################################################################
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   243
# Deploy/release targets.
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   244
1209
eacf1b282688 Switched to graphicsmagick to generate favicon. It doesn't support Microsoft ICO so generate PNG instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1207
diff changeset
   245
SF_USER ?= gavenkoa
eacf1b282688 Switched to graphicsmagick to generate favicon. It doesn't support Microsoft ICO so generate PNG instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1207
diff changeset
   246
eacf1b282688 Switched to graphicsmagick to generate favicon. It doesn't support Microsoft ICO so generate PNG instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1207
diff changeset
   247
# Release require Anki Python modules, dictd utilities and graphicsmagick (for icon):
eacf1b282688 Switched to graphicsmagick to generate favicon. It doesn't support Microsoft ICO so generate PNG instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1207
diff changeset
   248
#   $ sudo apt install anki dictfmt dictzip graphicsmagick
eacf1b282688 Switched to graphicsmagick to generate favicon. It doesn't support Microsoft ICO so generate PNG instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1207
diff changeset
   249
1214
8aecadfc6e8f Docs: installing GraphicsMagick on Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1211
diff changeset
   250
#   $ apt-cyg install GraphicsMagick
8aecadfc6e8f Docs: installing GraphicsMagick on Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1211
diff changeset
   251
1209
eacf1b282688 Switched to graphicsmagick to generate favicon. It doesn't support Microsoft ICO so generate PNG instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1207
diff changeset
   252
# First time you deploy to SourceForge (sf) you need manually login to:
eacf1b282688 Switched to graphicsmagick to generate favicon. It doesn't support Microsoft ICO so generate PNG instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1207
diff changeset
   253
#   $ sftp $(SF_USER),$(pkgname)@web.sourceforge.net
1211
275340c61150 Updated SF ssh key setup instructions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1209
diff changeset
   254
#   $ sftp $(SF_USER),$(pkgname)@frs.sourceforge.net
275340c61150 Updated SF ssh key setup instructions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1209
diff changeset
   255
#   $ hg push ssh://$(SF_USER)@hg.code.sf.net/p/gadict/code
1209
eacf1b282688 Switched to graphicsmagick to generate favicon. It doesn't support Microsoft ICO so generate PNG instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1207
diff changeset
   256
# as it asks for accepting server public key.
eacf1b282688 Switched to graphicsmagick to generate favicon. It doesn't support Microsoft ICO so generate PNG instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1207
diff changeset
   257
338
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   258
.PHONY: deploy
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   259
deploy: deploy2defun deploy2sf
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   260
588
63f430bda7f9 Release and deploy target should use fresh version info. Add alias to deploy sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 587
diff changeset
   261
.PHONY: deploy-src deploy-hg
63f430bda7f9 Release and deploy target should use fresh version info. Add alias to deploy sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 587
diff changeset
   262
deploy-src deploy-hg: deploy2defun-hg deploy2sf-hg
558
53fd793e345d Add shortcut to deploy to HG repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 557
diff changeset
   263
837
ed8a84d9566f No need to include VOA marked in VOA HTML.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 830
diff changeset
   264
.PHONY: deploy-html
ed8a84d9566f No need to include VOA marked in VOA HTML.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 830
diff changeset
   265
deploy-html: deploy2defun-html deploy2sf-html
ed8a84d9566f No need to include VOA marked in VOA HTML.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 830
diff changeset
   266
1226
c525aca6d8f8 Added build target 'deploy-www'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1224
diff changeset
   267
.PHONY: deploy-www
c525aca6d8f8 Added build target 'deploy-www'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1224
diff changeset
   268
deploy-www: deploy2defun-www deploy2sf-www
c525aca6d8f8 Added build target 'deploy-www'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1224
diff changeset
   269
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   270
.PHONY: release
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   271
release: release2defun release2sf
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   272
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   273
.PHONY: release2defun
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   274
release2defun: validate-release deploy2defun
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   275
505
4ce3ced9057e Fix dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 503
diff changeset
   276
.PHONY: release2sf
4ce3ced9057e Fix dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 503
diff changeset
   277
release2sf: validate-release deploy2sf
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   278
338
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   279
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   280
DEFUN_USER ?= user
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   281
DEFUN_HG_SRV ?= hg.defun.work
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   282
DEFUN_HG_DIR ?= /srv/hg/gadict
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   283
DEFUN_WWW_SRV ?= defun.work
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   284
DEFUN_WWW_DIR ?= /srv/www/gadict
493
8bfe8d4ad4a4 deploy2defun-distrel
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 482
diff changeset
   285
DEFUN_REL_DIR ?= /srv/www/gadict/download
338
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   286
956
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   287
.PHONY: deploy2defun-full
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   288
deploy2defun-full: deploy2defun deploy2defun-voa
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   289
338
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   290
.PHONY: deploy2defun
777
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   291
deploy2defun: deploy2defun-www deploy2defun-dist deploy2defun-hg deploy2defun-html
118
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
   292
558
53fd793e345d Add shortcut to deploy to HG repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 557
diff changeset
   293
.PHONY: deploy2defun-hg
53fd793e345d Add shortcut to deploy to HG repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 557
diff changeset
   294
deploy2defun-hg:
338
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   295
	hg push ssh://$(DEFUN_USER)@$(DEFUN_HG_SRV)/$(DEFUN_HG_DIR) || [ $$? = 1 ]
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   296
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   297
.PHONY: deploy2defun-www
774
7e8a7ec72bb4 Avoid 'HTML_FILES' generic name usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 773
diff changeset
   298
deploy2defun-www: $(WWW_HTML_FILES) $(FAVICON)
338
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   299
	( \
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   300
echo 'cd $(DEFUN_WWW_DIR)'; \
774
7e8a7ec72bb4 Avoid 'HTML_FILES' generic name usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 773
diff changeset
   301
for f in $(WWW_HTML_FILES) $(FAVICON); do \
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   302
  n=$${f##*/}; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   303
  echo "put $$f $$n"; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   304
  echo "chmod 644 $$n"; \
338
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   305
done; \
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   306
echo 'quit'; \
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   307
) | sftp -b - $(DEFUN_USER)@$(DEFUN_WWW_SRV)
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   308
494
f931ef10c1b0 Rename target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 493
diff changeset
   309
.PHONY: deploy2defun-dist
f931ef10c1b0 Rename target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 493
diff changeset
   310
deploy2defun-dist: $(DISTREL_TARBALLS) $(DISTSRC_TARBALLS)
493
8bfe8d4ad4a4 deploy2defun-distrel
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 482
diff changeset
   311
	( \
496
9ddd305404e6 Fix: sftp: Couldn't create directory: Failure
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 494
diff changeset
   312
echo "-mkdir $(DEFUN_REL_DIR)"; \
9ddd305404e6 Fix: sftp: Couldn't create directory: Failure
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 494
diff changeset
   313
echo "-mkdir $(DEFUN_REL_DIR)/v$(vmajor).$(vminor)"; \
493
8bfe8d4ad4a4 deploy2defun-distrel
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 482
diff changeset
   314
echo "cd $(DEFUN_REL_DIR)/v$(vmajor).$(vminor)"; \
8bfe8d4ad4a4 deploy2defun-distrel
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 482
diff changeset
   315
for f in $(DISTREL_TARBALLS) $(DISTSRC_TARBALLS); do \
8bfe8d4ad4a4 deploy2defun-distrel
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 482
diff changeset
   316
  n=$${f##*/}; \
8bfe8d4ad4a4 deploy2defun-distrel
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 482
diff changeset
   317
  echo "put $$f $$n"; \
8bfe8d4ad4a4 deploy2defun-distrel
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 482
diff changeset
   318
  echo "chmod 644 $$n"; \
8bfe8d4ad4a4 deploy2defun-distrel
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 482
diff changeset
   319
done; \
8bfe8d4ad4a4 deploy2defun-distrel
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 482
diff changeset
   320
) | sftp -b - $(DEFUN_USER)@$(DEFUN_WWW_SRV)
338
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   321
777
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   322
.PHONY: deploy2defun-html
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   323
deploy2defun-html: $(DICT_HTML_FILES)
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   324
	( \
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   325
echo 'cd $(DEFUN_WWW_DIR)'; \
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   326
for f in $(DICT_HTML_FILES); do \
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   327
  n=$${f##*/}; \
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   328
  echo "put $$f $$n"; \
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   329
  echo "chmod 644 $$n"; \
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   330
done; \
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   331
echo 'quit'; \
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   332
) | sftp -b - $(DEFUN_USER)@$(DEFUN_WWW_SRV)
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   333
956
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   334
.PHONY: deploy2sf-full
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   335
deploy2sf-full: deploy2sf deploy2sf-voa
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   336
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   337
.PHONY: deploy2sf
956
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   338
deploy2sf: deploy2sf-www deploy2sf-dist deploy2sf-hg deploy2sf-html
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   339
558
53fd793e345d Add shortcut to deploy to HG repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 557
diff changeset
   340
.PHONY: deploy2sf-hg
53fd793e345d Add shortcut to deploy to HG repos.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 557
diff changeset
   341
deploy2sf-hg:
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   342
	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
   343
119
20f1d1080886 Rename 'name' ==> 'pkgname'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 118
diff changeset
   344
# Will be accessed via http://$(pkgname).sourceforge.net
338
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   345
.PHONY: deploy2sf-www
774
7e8a7ec72bb4 Avoid 'HTML_FILES' generic name usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 773
diff changeset
   346
deploy2sf-www: $(WWW_HTML_FILES) $(FAVICON)
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   347
	( echo 'cd htdocs'; \
774
7e8a7ec72bb4 Avoid 'HTML_FILES' generic name usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 773
diff changeset
   348
for f in $(WWW_HTML_FILES) $(FAVICON); do \
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   349
  n=$${f##*/}; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   350
  echo "put $$f $$n"; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   351
  echo "chmod 644 $$n"; \
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   352
done; \
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   353
echo 'quit'; \
120
cb5ab06a72a7 Inline URL to make code more verbose.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 119
diff changeset
   354
) | sftp -b - $(SF_USER),$(pkgname)@web.sourceforge.net
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   355
501
3ebfd12fc276 Enable release to SF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 499
diff changeset
   356
.PHONY: deploy2sf-dist
3ebfd12fc276 Enable release to SF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 499
diff changeset
   357
deploy2sf-dist: $(DISTREL_TARBALLS) $(DISTSRC_TARBALLS)
287
d01045b55e04 Avoid names inlining.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 276
diff changeset
   358
	( echo 'cd /home/frs/project/$(shell v=$(pkgname); echo $${v:0:1}/$${v:0:2})/$(pkgname)'; \
503
6a32a94eeab2 Fix dist release to SF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 501
diff changeset
   359
echo "put  www/README.rst"; \
115
1c6ffaecdf50 Fix sftp command usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 112
diff changeset
   360
echo "chmod 644 README.rst"; \
496
9ddd305404e6 Fix: sftp: Couldn't create directory: Failure
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 494
diff changeset
   361
echo "-mkdir v$(vmajor).$(vminor)"; \
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   362
echo "cd v$(vmajor).$(vminor)"; \
478
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   363
for f in $(DISTREL_TARBALLS) $(DISTSRC_TARBALLS); do \
503
6a32a94eeab2 Fix dist release to SF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 501
diff changeset
   364
  n=$${f##*/}; \
6a32a94eeab2 Fix dist release to SF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 501
diff changeset
   365
  echo "put $$f $$n"; \
6a32a94eeab2 Fix dist release to SF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 501
diff changeset
   366
  echo "chmod 644 $$n"; \
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   367
done; \
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   368
echo 'quit'; \
120
cb5ab06a72a7 Inline URL to make code more verbose.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 119
diff changeset
   369
) | sftp -b - $(SF_USER),$(pkgname)@frs.sourceforge.net
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   370
779
c2520fea743b Fix typo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 777
diff changeset
   371
.PHONY: deploy2sf-html
c2520fea743b Fix typo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 777
diff changeset
   372
deploy2sf-html: $(DICT_HTML_FILES)
777
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   373
	( echo 'cd htdocs'; \
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   374
for f in $(DICT_HTML_FILES); do \
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   375
  n=$${f##*/}; \
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   376
  echo "put $$f $$n"; \
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   377
  echo "chmod 644 $$n"; \
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   378
done; \
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   379
echo 'quit'; \
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   380
) | sftp -b - $(SF_USER),$(pkgname)@web.sourceforge.net
6c191fc06fce Deploy dictionaries in HTML format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 776
diff changeset
   381
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   382
.PHONY: validate-release
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   383
validate-release:
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   384
	\
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   385
case ${visclean} in \
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   386
  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
   387
    exit 1;; \
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   388
esac
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   389
	\
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   390
case $(vatrelease) in \
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   391
  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
   392
    exit 1;; \
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   393
esac
124
7d9f38580ed9 Add 'deploy-check' target to check source sanity before release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 123
diff changeset
   394
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   395
################################################################
956
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   396
# Printed VOA dictionary isn't going to change so there is no need to require
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   397
# LaTeX in built environment to make releases.
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   398
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   399
.PHONY: deploy-voa
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   400
deploy-voa: deploy2defun-voa deploy2sf-voa
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   401
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   402
.PHONY: deploy2defun-voa
957
793cfb68fb1e Fixed typo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 956
diff changeset
   403
deploy2defun-voa: voa
956
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   404
	( \
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   405
echo 'cd $(DEFUN_WWW_DIR)'; \
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   406
echo "put dist/pdf/voa-special.pdf"; \
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   407
echo "chmod 644 voa-special.pdf"; \
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   408
echo 'quit'; \
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   409
) | sftp -b - $(DEFUN_USER)@$(DEFUN_WWW_SRV)
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   410
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   411
.PHONY: deploy2sf-voa
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   412
deploy2sf-voa: voa
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   413
	( \
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   414
echo 'cd htdocs'; \
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   415
echo "put dist/pdf/voa-special.pdf"; \
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   416
echo "chmod 644 voa-special.pdf"; \
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   417
echo 'quit'; \
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   418
) | sftp -b - $(SF_USER),$(pkgname)@web.sourceforge.net
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   419
36454643fec6 Printed VOA dictionary isn't going to change so there is no need to require
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 947
diff changeset
   420
################################################################
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   421
# Dist targets.
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   422
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   423
.PHONY: dist
478
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   424
dist: dist-rel dist-src
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   425
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   426
.PHONY: dist-rel
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   427
dist-rel: $(DISTREL_TARBALLS)
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   428
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   429
DISTREL_DICTDZ_FILES := $(patsubst %,dist/$(fullpkgname)/dictd/%,$(notdir $(DICTDZ_FILES)))
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   430
DISTREL_INDEX_FILES := $(patsubst %,dist/$(fullpkgname)/dictd/%,$(notdir $(INDEX_FILES)))
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   431
DISTREL_RST_FILES := $(patsubst %,dist/$(fullpkgname)/doc/txt/%,$(notdir $(RST_FILES)))
774
7e8a7ec72bb4 Avoid 'HTML_FILES' generic name usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 773
diff changeset
   432
DISTREL_WWW_HTML_FILES := $(patsubst %,dist/$(fullpkgname)/doc/html/%,$(notdir $(RST_HTML_FILES)))
545
15e5f62b2f6f Include import files in tab format for SRS to release bundle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 536
diff changeset
   433
DISTREL_SRS_TAB_FILES := $(patsubst %,dist/$(fullpkgname)/srs/%,$(notdir $(SRS_TAB_FILES)))
666
ef697459f88e Store Anki files in separate directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 665
diff changeset
   434
DISTREL_SRS_ANKI_FILES := $(patsubst %,dist/$(fullpkgname)/anki/%,$(notdir $(SRS_ANKI_FILES)))
478
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   435
1322
59b94ff17754 Fixed: Anki decks were not included into .zip release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1316
diff changeset
   436
DISTREL_DEP := $(DISTREL_DICTDZ_FILES) $(DISTREL_INDEX_FILES) $(DISTREL_SRS_ANKI_FILES) $(DISTREL_RST_FILES) $(DISTREL_WWW_HTML_FILES) $(BUILD_SCRIPTS)
59b94ff17754 Fixed: Anki decks were not included into .zip release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1316
diff changeset
   437
59b94ff17754 Fixed: Anki decks were not included into .zip release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1316
diff changeset
   438
dist/$(fullpkgname).tar.gz: $(DISTREL_DEP)
478
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   439
	rm -rf $@
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   440
	tar zcf $@ -C dist/ $(fullpkgname)
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   441
1322
59b94ff17754 Fixed: Anki decks were not included into .zip release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1316
diff changeset
   442
dist/$(fullpkgname).zip: $(DISTREL_DEP)
478
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   443
	rm -rf $@
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   444
	cd $(dir $@) && zip -r $(notdir $@) $(fullpkgname)
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   445
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   446
$(DISTREL_DICTDZ_FILES) $(DISTREL_INDEX_FILES): dist/$(fullpkgname)/dictd/%: dist/dictd/% | dist/$(fullpkgname)/dictd/
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   447
	cp $< $@
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   448
545
15e5f62b2f6f Include import files in tab format for SRS to release bundle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 536
diff changeset
   449
$(DISTREL_SRS_TAB_FILES): dist/$(fullpkgname)/srs/%: dist/srs/% | dist/$(fullpkgname)/srs/
15e5f62b2f6f Include import files in tab format for SRS to release bundle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 536
diff changeset
   450
	cp $< $@
15e5f62b2f6f Include import files in tab format for SRS to release bundle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 536
diff changeset
   451
666
ef697459f88e Store Anki files in separate directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 665
diff changeset
   452
$(DISTREL_SRS_ANKI_FILES): dist/$(fullpkgname)/anki/%: dist/anki/% | dist/$(fullpkgname)/anki/
557
d7a42a700255 Package Anki files to binary release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 555
diff changeset
   453
	cp $< $@
d7a42a700255 Package Anki files to binary release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 555
diff changeset
   454
478
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   455
$(DISTREL_RST_FILES): dist/$(fullpkgname)/doc/txt/%: www/% | dist/$(fullpkgname)/doc/txt/
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   456
	cp $< $@
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   457
774
7e8a7ec72bb4 Avoid 'HTML_FILES' generic name usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 773
diff changeset
   458
$(DISTREL_WWW_HTML_FILES): dist/$(fullpkgname)/doc/html/%: dist/www/% | dist/$(fullpkgname)/doc/html/
478
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   459
	cp $< $@
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   460
666
ef697459f88e Store Anki files in separate directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 665
diff changeset
   461
$(patsubst %,dist/$(fullpkgname)/%, dictd/ srs/ anki/ doc/txt/ doc/html/):
478
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   462
	mkdir -p $@
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   463
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   464
.PHONY: dist-src
105
35cc545ec03d 'clean'-like targets delete artefacts after 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 103
diff changeset
   465
dist-src: $(DISTSRC_TARBALLS)
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   466
478
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   467
DISTSRC_GADICT_FILES := $(patsubst %,dist/$(fullpkgname)_src/%,$(GADICT_FILES))
1207
e4f601df93b1 Included gaphrase & gadialog files to distsrc target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1203
diff changeset
   468
DISTSRC_GAPHRASE_FILES := $(patsubst %,dist/$(fullpkgname)_src/%,$(GAPHRASE_FILES))
e4f601df93b1 Included gaphrase & gadialog files to distsrc target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1203
diff changeset
   469
DISTSRC_GADIALOG_FILES := $(patsubst %,dist/$(fullpkgname)_src/%,$(GADIALOG_FILES))
478
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   470
DISTSRC_PY_FILES := $(patsubst %,dist/$(fullpkgname)_src/py/%,$(notdir $(PY_FILES)))
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   471
DISTSRC_RST_FILES := $(patsubst %,dist/$(fullpkgname)_src/www/%,$(notdir $(RST_FILES)))
481
f2b8c358716d Include HTML template to allow full build from distribution tarball.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 480
diff changeset
   472
DISTSRC_TMPL_FILES := $(patsubst %,dist/$(fullpkgname)_src/www/tmpl/%, rst.css rst.tmpl.in)
480
4413ccc9e216 Include VERSION file into source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 479
diff changeset
   473
DISTSRC_BUILD_SCRIPTS := $(patsubst %,dist/$(fullpkgname)_src/%, Makefile VERSION)
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   474
1207
e4f601df93b1 Included gaphrase & gadialog files to distsrc target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1203
diff changeset
   475
dist/$(fullpkgname)_src.tar.gz: $(DISTSRC_GADICT_FILES) $(DISTSRC_GAPHRASE_FILES) $(DISTSRC_GADIALOG_FILES) \
e4f601df93b1 Included gaphrase & gadialog files to distsrc target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1203
diff changeset
   476
  $(DISTSRC_PY_FILES) $(DISTSRC_RST_FILES) $(DISTSRC_TMPL_FILES) $(DISTSRC_BUILD_SCRIPTS) $(BUILD_SCRIPTS)
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   477
	rm -rf $@
478
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   478
	tar zcf $@ -C dist/ $(fullpkgname)_src
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   479
1259
e15d2e210840 Stopped to generate releases in format .tar.gz to reduce duplication of release data. .zip is sufficient.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1253
diff changeset
   480
dist/$(fullpkgname)_src.zip: $(DISTSRC_GADICT_FILES) $(DISTSRC_GAPHRASE_FILES) $(DISTSRC_GADIALOG_FILES) \
e15d2e210840 Stopped to generate releases in format .tar.gz to reduce duplication of release data. .zip is sufficient.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1253
diff changeset
   481
  $(DISTSRC_PY_FILES) $(DISTSRC_RST_FILES) $(DISTSRC_TMPL_FILES) $(DISTSRC_BUILD_SCRIPTS) $(BUILD_SCRIPTS)
e15d2e210840 Stopped to generate releases in format .tar.gz to reduce duplication of release data. .zip is sufficient.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1253
diff changeset
   482
	rm -rf $@
e15d2e210840 Stopped to generate releases in format .tar.gz to reduce duplication of release data. .zip is sufficient.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1253
diff changeset
   483
	cd $(dir $@) && zip -r $(notdir $@) $(fullpkgname)_src
e15d2e210840 Stopped to generate releases in format .tar.gz to reduce duplication of release data. .zip is sufficient.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1253
diff changeset
   484
1207
e4f601df93b1 Included gaphrase & gadialog files to distsrc target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1203
diff changeset
   485
$(DISTSRC_GADICT_FILES) $(DISTSRC_GAPHRASE_FILES) $(DISTSRC_GADIALOG_FILES): dist/$(fullpkgname)_src/%: % | dist/$(fullpkgname)_src/
478
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   486
	cp $< $@
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   487
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   488
$(DISTSRC_PY_FILES): dist/$(fullpkgname)_src/py/%: py/% | dist/$(fullpkgname)_src/py/
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   489
	cp $< $@
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   490
478
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   491
$(DISTSRC_RST_FILES): dist/$(fullpkgname)_src/www/%: www/% | dist/$(fullpkgname)_src/www/
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   492
	cp $< $@
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   493
481
f2b8c358716d Include HTML template to allow full build from distribution tarball.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 480
diff changeset
   494
$(DISTSRC_TMPL_FILES): dist/$(fullpkgname)_src/www/tmpl/%: www/tmpl/% | dist/$(fullpkgname)_src/www/tmpl/
f2b8c358716d Include HTML template to allow full build from distribution tarball.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 480
diff changeset
   495
	cp $< $@
f2b8c358716d Include HTML template to allow full build from distribution tarball.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 480
diff changeset
   496
480
4413ccc9e216 Include VERSION file into source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 479
diff changeset
   497
$(DISTSRC_BUILD_SCRIPTS): dist/$(fullpkgname)_src/%: % | dist/$(fullpkgname)_src/
478
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   498
	cp $< $@
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   499
481
f2b8c358716d Include HTML template to allow full build from distribution tarball.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 480
diff changeset
   500
dist/$(fullpkgname)_src/ $(patsubst %,dist/$(fullpkgname)_src/%, py/ www/ www/tmpl/):
478
740943860879 Add new target for binary distribution and update target for source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 441
diff changeset
   501
	mkdir -p $@
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   502
54
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   503
################################################################
643
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   504
# Word frequency statistic.
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   505
664
77df10cfe3ba Add freq list markers to VOA Anki deck.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 660
diff changeset
   506
define FREQ_MACRO
77df10cfe3ba Add freq list markers to VOA Anki deck.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 660
diff changeset
   507
$(1)_OPT += -freq:$(2):$(3)=$(4)
77df10cfe3ba Add freq list markers to VOA Anki deck.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 660
diff changeset
   508
$(1)_DEP += $(4)
651
08417d7454ec Add VOA to frequency list. Fix dependency on freq list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 646
diff changeset
   509
endef
08417d7454ec Add VOA to frequency list. Fix dependency on freq list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 646
diff changeset
   510
1347
272ec25b6f12 Mark word frequency based on Paul Nation BNC+COCA 25k wordfamily list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1327
diff changeset
   511
FREQLIST_OPT += -grp:'wordlist/pn25k/basewrd*.txt'
272ec25b6f12 Mark word frequency based on Paul Nation BNC+COCA 25k wordfamily list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1327
diff changeset
   512
664
77df10cfe3ba Add freq list markers to VOA Anki deck.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 660
diff changeset
   513
# For gadict_voa.
77df10cfe3ba Add freq list markers to VOA Anki deck.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 660
diff changeset
   514
$(eval $(call FREQ_MACRO,VOA_FREQLIST,freq,GSL,wordlist/gsl.freq))
77df10cfe3ba Add freq list markers to VOA Anki deck.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 660
diff changeset
   515
$(eval $(call FREQ_MACRO,VOA_FREQLIST,freq,AWL,wordlist/awl.freq))
77df10cfe3ba Add freq list markers to VOA Anki deck.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 660
diff changeset
   516
$(eval $(call FREQ_MACRO,VOA_FREQLIST,freq,NGSL,wordlist/ngsl.freq))
77df10cfe3ba Add freq list markers to VOA Anki deck.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 660
diff changeset
   517
$(eval $(call FREQ_MACRO,VOA_FREQLIST,freq,NAWL,wordlist/nawl.freq))
77df10cfe3ba Add freq list markers to VOA Anki deck.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 660
diff changeset
   518
$(eval $(call FREQ_MACRO,VOA_FREQLIST,var,BSL,wordlist/bsl.var))
77df10cfe3ba Add freq list markers to VOA Anki deck.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 660
diff changeset
   519
$(eval $(call FREQ_MACRO,VOA_FREQLIST,var,TSL,wordlist/tsl.var))
646
2d488cfc4c0c Add frequency markers to dictd dictionary and Anki cards.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 644
diff changeset
   520
664
77df10cfe3ba Add freq list markers to VOA Anki deck.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 660
diff changeset
   521
# For other dictionaries.
77df10cfe3ba Add freq list markers to VOA Anki deck.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 660
diff changeset
   522
$(eval $(call FREQ_MACRO,FREQLIST,freq,GSL,wordlist/gsl.freq))
77df10cfe3ba Add freq list markers to VOA Anki deck.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 660
diff changeset
   523
$(eval $(call FREQ_MACRO,FREQLIST,freq,AWL,wordlist/awl.freq))
77df10cfe3ba Add freq list markers to VOA Anki deck.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 660
diff changeset
   524
$(eval $(call FREQ_MACRO,FREQLIST,freq,NGSL,wordlist/ngsl.freq))
77df10cfe3ba Add freq list markers to VOA Anki deck.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 660
diff changeset
   525
$(eval $(call FREQ_MACRO,FREQLIST,freq,NAWL,wordlist/nawl.freq))
77df10cfe3ba Add freq list markers to VOA Anki deck.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 660
diff changeset
   526
$(eval $(call FREQ_MACRO,FREQLIST,var,VOA,dist/wordlist/voa.list))
77df10cfe3ba Add freq list markers to VOA Anki deck.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 660
diff changeset
   527
$(eval $(call FREQ_MACRO,FREQLIST,var,BSL,wordlist/bsl.var))
77df10cfe3ba Add freq list markers to VOA Anki deck.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 660
diff changeset
   528
$(eval $(call FREQ_MACRO,FREQLIST,var,TSL,wordlist/tsl.var))
1075
a8fad275310b Added official KET/PET wordlists of 2012.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1008
diff changeset
   529
$(eval $(call FREQ_MACRO,FREQLIST,var,KET,wordlist/ket.var))
a8fad275310b Added official KET/PET wordlists of 2012.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1008
diff changeset
   530
$(eval $(call FREQ_MACRO,FREQLIST,var,PET,wordlist/pet.var))
643
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   531
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   532
# BNC_COCA_BASEWORD := $(wildcard wordlist/bnc+coca/basewrd[0-1]?.txt)
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   533
# FREQ_DEP += $(BNC_COCA_BASEWORD)
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   534
# FREQ_FILTER += $(patsubst %,-b:%,$(BNC_COCA_BASEWORD))
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   535
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   536
GSL_BASEWORD := $(wildcard wordlist/gsl_1000_*.var)
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   537
# FREQ_DEP += $(GSL_BASEWORD)
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   538
# FREQ_FILTER += $(patsubst %,-b:%,$(GSL_BASEWORD))
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   539
FREQ_DEP += dist/wordlist/gsl.var
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   540
FREQ_FILTER += -b:dist/wordlist/gsl.var
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   541
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   542
NGSL_BASEWORD := $(wildcard wordlist/ngsl_1000_[1-3].var wordlist/ngsl_supplemental.var)
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   543
# FREQ_DEP += $(NGSL_BASEWORD)
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   544
# FREQ_FILTER += $(patsubst %,-b:%,$(NGSL_BASEWORD))
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   545
FREQ_DEP += dist/wordlist/ngsl.var
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   546
FREQ_FILTER += -b:dist/wordlist/ngsl.var
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   547
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   548
# FAMOUS_FREQLIST := wordlist/awl.freq wordlist/gsl.freq wordlist/nawl.freq wordlist/ngsl.freq
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   549
# FREQ_FILTER += $(patsubst %,-f:%,$(FAMOUS_FREQLIST))
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   550
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   551
AWL_BASEWORD := wordlist/awl.var
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   552
FREQ_DEP += $(AWL_BASEWORD)
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   553
FREQ_FILTER += $(patsubst %,-b:%,$(AWL_BASEWORD))
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   554
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   555
NAWL_BASEWORD := wordlist/nawl.var
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   556
FREQ_DEP += $(NAWL_BASEWORD)
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   557
FREQ_FILTER += $(patsubst %,-b:%,$(NAWL_BASEWORD))
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   558
1075
a8fad275310b Added official KET/PET wordlists of 2012.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1008
diff changeset
   559
KET_BASEWORD := wordlist/ket.var
a8fad275310b Added official KET/PET wordlists of 2012.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1008
diff changeset
   560
FREQ_DEP += $(KET_BASEWORD)
a8fad275310b Added official KET/PET wordlists of 2012.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1008
diff changeset
   561
FREQ_FILTER += $(patsubst %,-b:%,$(KET_BASEWORD))
a8fad275310b Added official KET/PET wordlists of 2012.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1008
diff changeset
   562
a8fad275310b Added official KET/PET wordlists of 2012.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1008
diff changeset
   563
PET_BASEWORD := wordlist/pet.var
a8fad275310b Added official KET/PET wordlists of 2012.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1008
diff changeset
   564
FREQ_DEP += $(PET_BASEWORD)
a8fad275310b Added official KET/PET wordlists of 2012.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1008
diff changeset
   565
FREQ_FILTER += $(patsubst %,-b:%,$(PET_BASEWORD))
a8fad275310b Added official KET/PET wordlists of 2012.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1008
diff changeset
   566
643
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   567
VOA_BASEWORD := dist/wordlist/voa.list
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   568
FREQ_DEP += $(VOA_BASEWORD)
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   569
FREQ_FILTER += $(patsubst %,-b:%,$(VOA_BASEWORD))
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   570
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   571
FREQ_FILTER += -12000f:wordlist/oanc.freq
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   572
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   573
.PHONY: freq
769
7877b9a74af7 Rename 'gadict_en-ru+uk' to simply 'gadict' because '+' sign should be escaped in URL.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 768
diff changeset
   574
freq: dist/wordlist/gadict.list py/gadict_freq.py $(FREQ_DEP) $(BUILD_SCRIPTS)
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   575
	$(PYTHON) -B py/gadict_freq.py +b:dist/wordlist/gadict.list $(FREQ_FILTER)
723
53095b480a73 Treat first argument in format like the rest arguments. Targets to print
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 684
diff changeset
   576
53095b480a73 Treat first argument in format like the rest arguments. Targets to print
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 684
diff changeset
   577
.PHONY: missing
724
98fd211d27db Target to show combined statistics about missing words.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 723
diff changeset
   578
missing: missing-words missing-stat
98fd211d27db Target to show combined statistics about missing words.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 723
diff changeset
   579
98fd211d27db Target to show combined statistics about missing words.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 723
diff changeset
   580
.PHONY: missing-words
769
7877b9a74af7 Rename 'gadict_en-ru+uk' to simply 'gadict' because '+' sign should be escaped in URL.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 768
diff changeset
   581
missing-words: dist/wordlist/gadict.list $(FREQ_DEP) $(BUILD_SCRIPTS)
723
53095b480a73 Treat first argument in format like the rest arguments. Targets to print
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 684
diff changeset
   582
	@echo ===== VOA =====
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   583
	$(PYTHON) -B py/gadict_freq.py -b:dist/wordlist/gadict.list +b:dist/wordlist/voa.list
723
53095b480a73 Treat first argument in format like the rest arguments. Targets to print
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 684
diff changeset
   584
	@echo ===== GSL =====
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   585
	$(PYTHON) -B py/gadict_freq.py -b:dist/wordlist/gadict.list +f:wordlist/gsl.freq
723
53095b480a73 Treat first argument in format like the rest arguments. Targets to print
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 684
diff changeset
   586
	@echo ===== AWL =====
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   587
	$(PYTHON) -B py/gadict_freq.py -b:dist/wordlist/gadict.list +f:wordlist/awl.freq
723
53095b480a73 Treat first argument in format like the rest arguments. Targets to print
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 684
diff changeset
   588
	@echo ===== NGSL =====
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   589
	$(PYTHON) -B py/gadict_freq.py -b:dist/wordlist/gadict.list +f:wordlist/ngsl.freq
723
53095b480a73 Treat first argument in format like the rest arguments. Targets to print
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 684
diff changeset
   590
	@echo ===== NAWL =====
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   591
	$(PYTHON) -B py/gadict_freq.py -b:dist/wordlist/gadict.list +f:wordlist/nawl.freq
723
53095b480a73 Treat first argument in format like the rest arguments. Targets to print
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 684
diff changeset
   592
	@echo ===== BSL =====
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   593
	$(PYTHON) -B py/gadict_freq.py -b:dist/wordlist/gadict.list +b:wordlist/bsl.var
723
53095b480a73 Treat first argument in format like the rest arguments. Targets to print
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 684
diff changeset
   594
	@echo ===== TSL =====
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   595
	$(PYTHON) -B py/gadict_freq.py -b:dist/wordlist/gadict.list +b:wordlist/tsl.var
1075
a8fad275310b Added official KET/PET wordlists of 2012.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1008
diff changeset
   596
	@echo ===== KET =====
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   597
	$(PYTHON) -B py/gadict_freq.py -b:dist/wordlist/gadict.list +b:wordlist/ket.var
1075
a8fad275310b Added official KET/PET wordlists of 2012.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1008
diff changeset
   598
	@echo ===== PET =====
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   599
	$(PYTHON) -B py/gadict_freq.py -b:dist/wordlist/gadict.list +b:wordlist/pet.var
723
53095b480a73 Treat first argument in format like the rest arguments. Targets to print
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 684
diff changeset
   600
1008
dc218f2b784d Ported build of Anki apkg to Python 3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 957
diff changeset
   601
.PHONY: missing-speakout
dc218f2b784d Ported build of Anki apkg to Python 3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 957
diff changeset
   602
missing-speakout: dist/wordlist/gadict.list $(FREQ_DEP) $(BUILD_SCRIPTS)
dc218f2b784d Ported build of Anki apkg to Python 3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 957
diff changeset
   603
	@echo ===== so1 =====
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   604
	$(PYTHON) -B py/gadict_freq.py -b:dist/wordlist/gadict.list +b:so1.list | tee so1.miss
1008
dc218f2b784d Ported build of Anki apkg to Python 3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 957
diff changeset
   605
	@echo ===== so2 =====
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   606
	$(PYTHON) -B py/gadict_freq.py -b:dist/wordlist/gadict.list +b:so2.list | tee so2.miss
1008
dc218f2b784d Ported build of Anki apkg to Python 3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 957
diff changeset
   607
	@echo ===== so3 =====
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   608
	$(PYTHON) -B py/gadict_freq.py -b:dist/wordlist/gadict.list +b:so3.list | tee so3.miss
1008
dc218f2b784d Ported build of Anki apkg to Python 3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 957
diff changeset
   609
	@echo ===== so4 =====
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   610
	$(PYTHON) -B py/gadict_freq.py -b:dist/wordlist/gadict.list +b:so4.list | tee so4.miss
1008
dc218f2b784d Ported build of Anki apkg to Python 3.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 957
diff changeset
   611
829
f5c7e513cbff Removed trick with pattern-specific variables because build fail in some situations.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 801
diff changeset
   612
define stat-cmd
f5c7e513cbff Removed trick with pattern-specific variables because build fail in some situations.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 801
diff changeset
   613
{ \
794
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   614
stat() { \
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   615
  lack=`$(PYTHON) -B py/gadict_freq.py -b:dist/wordlist/gadict.list $$2:$$3 | wc -l`; \
801
04397698b6be Count only base word in missing statistic.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 794
diff changeset
   616
  total=`grep -v '^[ 	]' $$3 | wc -l`; \
794
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   617
  cover=$$((total - lack)); \
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   618
  printf "   %4s %5s %5s %4s\n" $$1 $$cover $$total $$lack; \
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   619
}; \
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   620
echo "   ==== ===== ===== ===="; \
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   621
echo "   List Cover Total Lack"; \
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   622
echo "   ==== ===== ===== ===="; \
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   623
stat VOA +b dist/wordlist/voa.list; \
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   624
stat GSL +f wordlist/gsl.freq; \
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   625
stat AWL +f wordlist/awl.freq; \
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   626
stat NGSL +f wordlist/ngsl.freq; \
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   627
stat NAWL +f wordlist/nawl.freq; \
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   628
stat BSL +b wordlist/bsl.var; \
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   629
stat TSL +b wordlist/tsl.var; \
1075
a8fad275310b Added official KET/PET wordlists of 2012.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1008
diff changeset
   630
stat KET +b wordlist/ket.var; \
a8fad275310b Added official KET/PET wordlists of 2012.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1008
diff changeset
   631
stat PET +b wordlist/pet.var; \
794
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   632
echo "   ==== ===== ===== ===="; \
829
f5c7e513cbff Removed trick with pattern-specific variables because build fail in some situations.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 801
diff changeset
   633
}
f5c7e513cbff Removed trick with pattern-specific variables because build fail in some situations.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 801
diff changeset
   634
endef
f5c7e513cbff Removed trick with pattern-specific variables because build fail in some situations.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 801
diff changeset
   635
f5c7e513cbff Removed trick with pattern-specific variables because build fail in some situations.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 801
diff changeset
   636
.PHONY: missing-stat
f5c7e513cbff Removed trick with pattern-specific variables because build fail in some situations.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 801
diff changeset
   637
missing-stat: dist/wordlist/gadict.list $(FREQ_DEP) $(BUILD_SCRIPTS)
f5c7e513cbff Removed trick with pattern-specific variables because build fail in some situations.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 801
diff changeset
   638
	@${stat-cmd}
643
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   639
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   640
dist/wordlist/%.list: %.gadict py/gadict_headwords.py $(BUILD_SCRIPTS) | dist/wordlist/
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   641
	$(PYTHON) -B py/gadict_headwords.py  $< $@
643
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   642
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   643
dist/wordlist/gsl.var: $(GSL_BASEWORD) | dist/wordlist/
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   644
	cat $(GSL_BASEWORD) >$@
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   645
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   646
dist/wordlist/ngsl.var: $(NGSL_BASEWORD) | dist/wordlist/
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   647
	cat $(NGSL_BASEWORD) >$@
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   648
651
08417d7454ec Add VOA to frequency list. Fix dependency on freq list.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 646
diff changeset
   649
dist/wordlist/voa.list: gadict_voa.gadict py/gadict_headwords.py $(MAKEFILE_LIST) | dist/wordlist/
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   650
	$(PYTHON) -B py/gadict_headwords.py gadict_voa.gadict >$@
643
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   651
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   652
dist/wordlist/:
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   653
	mkdir -p $@
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   654
c2c32f45dde6 Search rare words in gadict.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 633
diff changeset
   655
################################################################
54
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   656
# Build targets.
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   657
23
946ae4b96419 Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 22
diff changeset
   658
.PHONY: all
245
5b9fac360762 Rename target to avoid disambiguate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 241
diff changeset
   659
all: dict
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   660
431
4ec7d0ea1602 Fix: ".name" and ".url" intermediate files for dictd automatically removed by GNU make.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 429
diff changeset
   661
.PHONY: dict dictd c5
4ec7d0ea1602 Fix: ".name" and ".url" intermediate files for dictd automatically removed by GNU make.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 429
diff changeset
   662
dictd c5: dict
245
5b9fac360762 Rename target to avoid disambiguate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 241
diff changeset
   663
dict: $(DICTDZ_FILES) $(INDEX_FILES)
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   664
592
f45410f1f80e Move dictfmt options to variable.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 589
diff changeset
   665
DICTFMT := dictfmt
41
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   666
#  --case-sensitive
593
32de94c1b039 Disable word wrapping for dictd dictionary.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 592
diff changeset
   667
DICTFMT_OPT := --headword-separator '; ' --break-headwords --without-headword --utf8 --allchars --columns 0
592
f45410f1f80e Move dictfmt options to variable.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 589
diff changeset
   668
404
cdfa6dfa9072 Integrate dictionary metainfo line name and home page url into dictd build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 401
diff changeset
   669
dist/dictd/%.dict dist/dictd/%.index: dist/dictd/%.c5 dist/dictd/%.c5.name dist/dictd/%.c5.url $(MAKEFILE_LIST)
592
f45410f1f80e Move dictfmt options to variable.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 589
diff changeset
   670
	(cd dist/dictd; $(DICTFMT) $(DICTFMT_OPT)  -c5  -s "`cat $*.c5.name`" -u "`cat $*.c5.url`"  $*)  < $<
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   671
387
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   672
dist/dictd/%.dict.dz: dist/dictd/%.dict
41
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   673
	dictzip -c $< >$@
1
b23e948de24a Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 0
diff changeset
   674
624
934a2a6cbe27 Add dictionaries logo. Goldendict supports PNG format and by default display
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   675
dist/dictd/%.png: %.xpm | dist/dictd/
1209
eacf1b282688 Switched to graphicsmagick to generate favicon. It doesn't support Microsoft ICO so generate PNG instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1207
diff changeset
   676
	gm convert $< $@
624
934a2a6cbe27 Add dictionaries logo. Goldendict supports PNG format and by default display
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   677
431
4ec7d0ea1602 Fix: ".name" and ".url" intermediate files for dictd automatically removed by GNU make.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 429
diff changeset
   678
GADICT_SUFFIXES := en-ru+uk en-ru en-uk voa
4ec7d0ea1602 Fix: ".name" and ".url" intermediate files for dictd automatically removed by GNU make.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 429
diff changeset
   679
.SECONDARY: $(patsubst %,dist/dictd/gadict_%.c5.name,$(GADICT_SUFFIXES))
4ec7d0ea1602 Fix: ".name" and ".url" intermediate files for dictd automatically removed by GNU make.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 429
diff changeset
   680
.SECONDARY: $(patsubst %,dist/dictd/gadict_%.c5.url,$(GADICT_SUFFIXES))
404
cdfa6dfa9072 Integrate dictionary metainfo line name and home page url into dictd build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 401
diff changeset
   681
cdfa6dfa9072 Integrate dictionary metainfo line name and home page url into dictd build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 401
diff changeset
   682
dist/dictd/%.c5.name dist/dictd/%.c5.url: dist/dictd/%.c5
cdfa6dfa9072 Integrate dictionary metainfo line name and home page url into dictd build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 401
diff changeset
   683
	:
cdfa6dfa9072 Integrate dictionary metainfo line name and home page url into dictd build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 401
diff changeset
   684
396
4f16fb80b2a7 Suppress __pycache__ dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 393
diff changeset
   685
# -B  suppress __pycache__ dir
410
65b38ec04ea4 Include VOA in build. Make possible separate Ru/Uk build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 404
diff changeset
   686
769
7877b9a74af7 Rename 'gadict_en-ru+uk' to simply 'gadict' because '+' sign should be escaped in URL.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 768
diff changeset
   687
dist/dictd/gadict.c5: gadict.gadict $(FREQLIST_DEP) py/gadict.py py/gadict_c5.py $(MAKEFILE_LIST) | dist/dictd/
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   688
	LC_ALL=en_US.utf8 $(PYTHON) -B py/gadict_c5.py $(FREQLIST_OPT)  $< $@
769
7877b9a74af7 Rename 'gadict_en-ru+uk' to simply 'gadict' because '+' sign should be escaped in URL.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 768
diff changeset
   689
	echo "gadict En-Ru+Uk"> dist/dictd/gadict.c5.name
646
2d488cfc4c0c Add frequency markers to dictd dictionary and Anki cards.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 644
diff changeset
   690
769
7877b9a74af7 Rename 'gadict_en-ru+uk' to simply 'gadict' because '+' sign should be escaped in URL.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 768
diff changeset
   691
dist/dictd/gadict_en-ru.c5: gadict.gadict py/gadict.py py/gadict_c5.py $(MAKEFILE_LIST) | dist/dictd/
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   692
	LC_ALL=en_US.utf8 $(PYTHON) -B py/gadict_c5.py  $< $@ -lang:ru
410
65b38ec04ea4 Include VOA in build. Make possible separate Ru/Uk build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 404
diff changeset
   693
	echo "gadict En-Ru"> dist/dictd/gadict_en-ru.c5.name
65b38ec04ea4 Include VOA in build. Make possible separate Ru/Uk build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 404
diff changeset
   694
769
7877b9a74af7 Rename 'gadict_en-ru+uk' to simply 'gadict' because '+' sign should be escaped in URL.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 768
diff changeset
   695
dist/dictd/gadict_en-uk.c5: gadict.gadict py/gadict.py py/gadict_c5.py $(MAKEFILE_LIST) | dist/dictd/
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   696
	LC_ALL=en_US.utf8 $(PYTHON) -B py/gadict_c5.py  $< $@ -lang:uk
410
65b38ec04ea4 Include VOA in build. Make possible separate Ru/Uk build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 404
diff changeset
   697
	echo "gadict En-Uk"> dist/dictd/gadict_en-uk.c5.name
65b38ec04ea4 Include VOA in build. Make possible separate Ru/Uk build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 404
diff changeset
   698
646
2d488cfc4c0c Add frequency markers to dictd dictionary and Anki cards.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 644
diff changeset
   699
dist/dictd/gadict_voa.c5: gadict_voa.gadict py/gadict.py py/gadict_c5.py $(MAKEFILE_LIST) | dist/dictd/
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   700
	LC_ALL=en_US.utf8 $(PYTHON) -B py/gadict_c5.py  $< $@ -lang:en
387
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   701
646
2d488cfc4c0c Add frequency markers to dictd dictionary and Anki cards.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 644
diff changeset
   702
dist/dictd/%.c5: %.gadict py/gadict.py py/gadict_c5.py $(MAKEFILE_LIST) | dist/dictd/
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   703
	LC_ALL=en_US.utf8 $(PYTHON) -B py/gadict_c5.py  $< $@
624
934a2a6cbe27 Add dictionaries logo. Goldendict supports PNG format and by default display
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 614
diff changeset
   704
424
98c8f14fc972 Fix "stat" target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 410
diff changeset
   705
dist/dictd/:
387
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   706
	mkdir -p $@
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   707
536
c9f0064d8661 Generate import file for space repetition software in TAB format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 505
diff changeset
   708
.PHONY: srs
555
4a3188fc8951 Generating Packaged Anki Desk files for Anki space repetition software.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 547
diff changeset
   709
srs: $(SRS_ANKI_FILES) $(SRS_TAB_FILES)
4a3188fc8951 Generating Packaged Anki Desk files for Anki space repetition software.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 547
diff changeset
   710
564
93d0bdb815a1 Separate target to build anki files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 558
diff changeset
   711
.PHONY: anki
93d0bdb815a1 Separate target to build anki files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 558
diff changeset
   712
anki: $(SRS_ANKI_FILES)
93d0bdb815a1 Separate target to build anki files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 558
diff changeset
   713
775
6aa817943828 Makefile warn about duplicate implicit rules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 774
diff changeset
   714
GADICT_DEL_FILE := $(wildcard gadict.del)
6aa817943828 Makefile warn about duplicate implicit rules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 774
diff changeset
   715
GADICT_DEL_OPT :=
6aa817943828 Makefile warn about duplicate implicit rules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 774
diff changeset
   716
ifneq '' '$(GADICT_DEL_FILE)'
6aa817943828 Makefile warn about duplicate implicit rules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 774
diff changeset
   717
  GADICT_DEL_OPT := -delfile=$(GADICT_DEL_FILE)
6aa817943828 Makefile warn about duplicate implicit rules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 774
diff changeset
   718
endif
6aa817943828 Makefile warn about duplicate implicit rules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 774
diff changeset
   719
773
3bf7e4c6233f Old name for 'gadict_en-ru+uk' should be passed to keep hash values the same
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 772
diff changeset
   720
# Specific rules (due to renames or other customization).
775
6aa817943828 Makefile warn about duplicate implicit rules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 774
diff changeset
   721
dist/anki/gadict.apkg: gadict.gadict $(GADICT_DEL_FILE) py/gadict.py py/gadict_srs_anki.py $(FREQLIST_DEP) $(MAKEFILE_LIST) | dist/anki/
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   722
	PYTHONPATH=$(ANKI_PY_DIR): LC_ALL=en_US.utf8 $(PYTHON) -B py/gadict_srs_anki.py -name="gadict_en-ru+uk" -rich $(GADICT_DEL_OPT) $(FREQLIST_OPT) $< $@
773
3bf7e4c6233f Old name for 'gadict_en-ru+uk' should be passed to keep hash values the same
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 772
diff changeset
   723
3bf7e4c6233f Old name for 'gadict_en-ru+uk' should be passed to keep hash values the same
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 772
diff changeset
   724
dist/anki/gadict_voa.apkg: gadict_voa.gadict py/gadict.py py/gadict_srs_anki.py $(VOA_FREQLIST_DEP) $(MAKEFILE_LIST) | dist/anki/
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   725
	PYTHONPATH=$(ANKI_PY_DIR): LC_ALL=en_US.utf8 $(PYTHON) -B py/gadict_srs_anki.py -name="gadict_voa" $(VOA_FREQLIST_OPT) $< $@
773
3bf7e4c6233f Old name for 'gadict_en-ru+uk' should be passed to keep hash values the same
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 772
diff changeset
   726
1201
fbbb13f2e0ec Fixed dependency of py file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1191
diff changeset
   727
dist/anki/%.apkg: %.gadialog py/gadialog_srs_anki.py $(MAKEFILE_LIST) | dist/anki/
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   728
	PYTHONPATH=$(ANKI_PY_DIR): LC_ALL=en_US.utf8 $(PYTHON) -B py/gadialog_srs_anki.py -name="$*" $< $@
1146
50007cd95972 Added generation of Anki cards with mini-dialogs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1142
diff changeset
   729
1203
c767b62ec786 Added support for gaphrase format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1202
diff changeset
   730
dist/anki/%.apkg: %.gaphrase py/gaphrase_srs_anki.py $(MAKEFILE_LIST) | dist/anki/
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   731
	PYTHONPATH=$(ANKI_PY_DIR): LC_ALL=en_US.utf8 $(PYTHON) -B py/gaphrase_srs_anki.py -name="$*" $< $@
1203
c767b62ec786 Added support for gaphrase format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1202
diff changeset
   732
773
3bf7e4c6233f Old name for 'gadict_en-ru+uk' should be passed to keep hash values the same
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 772
diff changeset
   733
# General rules.
666
ef697459f88e Store Anki files in separate directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 665
diff changeset
   734
dist/anki/%.apkg: %.gadict %.del py/gadict.py py/gadict_srs_anki.py $(FREQLIST_DEP) $(MAKEFILE_LIST) | dist/anki/
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   735
	PYTHONPATH=$(ANKI_PY_DIR): LC_ALL=en_US.utf8 $(PYTHON) -B py/gadict_srs_anki.py -name=$* -rich -delfile=$*.del $(FREQLIST_OPT) $< $@
608
01fcbb1d5cea Add a way to mark card for deletion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 593
diff changeset
   736
666
ef697459f88e Store Anki files in separate directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 665
diff changeset
   737
dist/anki/%.apkg: %.gadict py/gadict.py py/gadict_srs_anki.py $(FREQLIST_DEP) $(MAKEFILE_LIST) | dist/anki/
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   738
	PYTHONPATH=$(ANKI_PY_DIR): LC_ALL=en_US.utf8 $(PYTHON) -B py/gadict_srs_anki.py -name=$* -rich $(FREQLIST_OPT) $< $@
536
c9f0064d8661 Generate import file for space repetition software in TAB format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 505
diff changeset
   739
772
ea173f7395a0 Separate target to generate SRS tab-files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 771
diff changeset
   740
.PHONY: tab
ea173f7395a0 Separate target to generate SRS tab-files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 771
diff changeset
   741
tab: $(SRS_TAB_FILES)
ea173f7395a0 Separate target to generate SRS tab-files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 771
diff changeset
   742
769
7877b9a74af7 Rename 'gadict_en-ru+uk' to simply 'gadict' because '+' sign should be escaped in URL.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 768
diff changeset
   743
dist/srs/gadict.tab.txt: gadict.gadict py/gadict.py py/gadict_srs_tab.py $(MAKEFILE_LIST) | dist/srs/
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   744
	$(PYTHON) -B py/gadict_srs_tab.py  $< $@ -lang:ru,uk
536
c9f0064d8661 Generate import file for space repetition software in TAB format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 505
diff changeset
   745
587
caf484e75e19 Generalise rule for building .tab.txt files. This helps build off project files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 564
diff changeset
   746
dist/srs/%.tab.txt: %.gadict py/gadict.py py/gadict_srs_tab.py $(MAKEFILE_LIST) | dist/srs/
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   747
	$(PYTHON) -B py/gadict_srs_tab.py  $< $@
536
c9f0064d8661 Generate import file for space repetition software in TAB format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 505
diff changeset
   748
666
ef697459f88e Store Anki files in separate directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 665
diff changeset
   749
dist/anki/ dist/srs/:
536
c9f0064d8661 Generate import file for space repetition software in TAB format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 505
diff changeset
   750
	mkdir -p $@
c9f0064d8661 Generate import file for space repetition software in TAB format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 505
diff changeset
   751
776
d57c28843156 Generate HTML form of dictionary for online presents.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   752
.PHONY: html
d57c28843156 Generate HTML form of dictionary for online presents.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   753
html: $(DICT_HTML_FILES)
d57c28843156 Generate HTML form of dictionary for online presents.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   754
837
ed8a84d9566f No need to include VOA marked in VOA HTML.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 830
diff changeset
   755
dist/html/gadict_voa.html: gadict_voa.gadict py/gadict.py py/gadict_html.py $(VOA_FREQLIST_DEP) $(MAKEFILE_LIST) | dist/html/
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   756
	$(PYTHON) -B py/gadict_html.py $(VOA_FREQLIST_OPT) $< $@
837
ed8a84d9566f No need to include VOA marked in VOA HTML.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 830
diff changeset
   757
776
d57c28843156 Generate HTML form of dictionary for online presents.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   758
dist/html/%.html: %.gadict py/gadict.py py/gadict_html.py $(FREQLIST_DEP) $(MAKEFILE_LIST) | dist/html/
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   759
	$(PYTHON) -B py/gadict_html.py $(FREQLIST_OPT) $< $@
776
d57c28843156 Generate HTML form of dictionary for online presents.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   760
1224
23dc533e3dd3 Added HTML formatter for gadialog files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1214
diff changeset
   761
dist/html/gadialog.html: gadialog.gadialog py/gadialog.py py/gadialog_html.py | dist/html/
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   762
	$(PYTHON) -B py/gadialog_html.py $< $@
1224
23dc533e3dd3 Added HTML formatter for gadialog files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1214
diff changeset
   763
776
d57c28843156 Generate HTML form of dictionary for online presents.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   764
dist/html/:
d57c28843156 Generate HTML form of dictionary for online presents.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   765
	mkdir -p $@
d57c28843156 Generate HTML form of dictionary for online presents.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 775
diff changeset
   766
54
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   767
################################################################
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   768
# Documentation targets.
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   769
768
bd3278653eaa 'html' target will be used for other purpose.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 754
diff changeset
   770
.PHONY: docs web
bd3278653eaa 'html' target will be used for other purpose.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 754
diff changeset
   771
docs web: www
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   772
768
bd3278653eaa 'html' target will be used for other purpose.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 754
diff changeset
   773
.PHONY: www
774
7e8a7ec72bb4 Avoid 'HTML_FILES' generic name usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 773
diff changeset
   774
www: $(WWW_HTML_FILES)
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   775
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   776
$(INDEX_HTML_FILE): dist/www/README.html
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   777
	cp $< $@
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   778
424
98c8f14fc972 Fix "stat" target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 410
diff changeset
   779
$(RST_HTML_FILES): dist/www/%.html: www/%.rst $(RST_CSS_FILE) $(RST_TMPL_FILE) $(BUILD_SCRIPTS) | dist/www/
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   780
	$(RST2HTML) $(RST2HTML_FLAGS) --stylesheet=$(RST_CSS_FILE) --template=$(RST_TMPL_FILE)  www/$*.rst  $@
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   781
424
98c8f14fc972 Fix "stat" target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 410
diff changeset
   782
dist/www/:
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   783
	mkdir -p $@
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   784
789
1a78ecda2555 Add dependency on version information for www files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 779
diff changeset
   785
$(RST_TMPL_FILE): www/tmpl/rst.tmpl.in VERSION $(BUILD_SCRIPTS) | $(dir $(RST_TMPL_FILE))
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   786
	\
482
fefea56726d2 Warn if build done without version file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 481
diff changeset
   787
[[ "${visclean}" = no ]] && warn1='<b>Warning</b>: Build done with local changes!' || :; \
fefea56726d2 Warn if build done without version file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 481
diff changeset
   788
[[ -z "${visclean}" ]] && warn1='<b>Warning</b>: Build done without <b>VERSION</b> file!' || :; \
fefea56726d2 Warn if build done without version file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 481
diff changeset
   789
[[ "${vatrelease}" = no ]] && warn2='<b>Warning</b>: Build is far from latest <tt>$(vtag)</tt> release state by $(vtagdist) changes.' || :; \
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   790
sed -e "s|{date}|$$(date +%F)|" -e "s|{rev}|$$(hg id -i)|" -e "s|{warn1}|$$warn1|" -e "s|{warn2}|$$warn2|" <$< >$@
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   791
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   792
################################################################
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   793
# Article statistics.
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   794
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   795
.PHONY: stat
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   796
stat: $(STAT_HTML_FILE)
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   797
547
f571a9e4e70c Fix: directory without trailing "/" is not created.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 545
diff changeset
   798
$(STAT_HTML_FILE): $(STAT_RST_FILE) $(RST_CSS_FILE) $(RST_TMPL_FILE) | $(dir $(STAT_HTML_FILE))
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   799
	$(RST2HTML) $(RST2HTML_FLAGS) --stylesheet=$(RST_CSS_FILE) --template=$(RST_TMPL_FILE)  $<  $@
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   800
794
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   801
$(STAT_RST_FILE): $(GADICT_FILES) $(STAT_MISSING_FILE) $(BUILD_SCRIPTS) | $(dir $(STAT_RST_FILE))
109
5bb58b8d87a7 Add version info into documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 108
diff changeset
   802
	{ \
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   803
echo '==========================='; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   804
echo ' gadict project statistics'; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   805
echo '==========================='; \
429
e721e428b909 Translations count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 428
diff changeset
   806
echo; \
428
8598efaef822 Align STAT table columns to the right.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 427
diff changeset
   807
echo '.. class:: right'; \
8598efaef822 Align STAT table columns to the right.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 427
diff changeset
   808
echo; \
794
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   809
echo '==================== ======== ======== ========'; \
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   810
echo '   Dictionary        Articles Meanings Examples'; \
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   811
echo '==================== ======== ======== ========'; \
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   812
total=0; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   813
for dic in $(GADICT_FILES); do \
681
13b9335eae0d Add number of meanings and examples statistic. Remove ru/uk statistic because
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
   814
  awk '\
13b9335eae0d Add number of meanings and examples statistic. Remove ru/uk statistic because
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
   815
BEGIN { art=0; tr=0; ex = 0; };\
13b9335eae0d Add number of meanings and examples statistic. Remove ru/uk statistic because
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
   816
/^__$$/{ art += 1 };\
13b9335eae0d Add number of meanings and examples statistic. Remove ru/uk statistic because
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
   817
/^(en|ru|uk)> /{ ex += 1 };\
13b9335eae0d Add number of meanings and examples statistic. Remove ru/uk statistic because
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
   818
/^(n|det|pron|adj|v|adv|prep|conj|num|int|phr|phr\.v|contr|abbr|prefix)$$/{ tr += 1 };'\
794
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   819
"END {printf \"%20s %8s %8s %8s\n\", \"$${dic%.gadict}\", art, tr, ex};"\
681
13b9335eae0d Add number of meanings and examples statistic. Remove ru/uk statistic because
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 674
diff changeset
   820
  <$$dic; \
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   821
done; \
794
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   822
echo '==================== ======== ======== ========'; \
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   823
echo; \
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   824
echo '.. table:: ``gadict`` coverage of famous word lists'; \
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   825
echo '   :class: right'; \
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   826
echo; \
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   827
cat  $(STAT_MISSING_FILE); \
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   828
} >$@
276
66db1bbebe45 Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 275
diff changeset
   829
844
e8e98ed4e381 Fix dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 837
diff changeset
   830
$(STAT_MISSING_FILE): dist/wordlist/gadict.list $(FREQ_DEP) $(BUILD_SCRIPTS) | $(dir $(STAT_MISSING_FILE))
829
f5c7e513cbff Removed trick with pattern-specific variables because build fail in some situations.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 801
diff changeset
   831
	@echo '*' make stat
f5c7e513cbff Removed trick with pattern-specific variables because build fail in some situations.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 801
diff changeset
   832
	@${stat-cmd} >$(STAT_MISSING_FILE)
794
b6b7f7a3b4dc Include statistic on wordlist coverage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 789
diff changeset
   833
424
98c8f14fc972 Fix "stat" target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 410
diff changeset
   834
dist/misc/:
98c8f14fc972 Fix "stat" target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 410
diff changeset
   835
	mkdir -p $@
98c8f14fc972 Fix "stat" target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 410
diff changeset
   836
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   837
################################################################
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   838
# Misc targets.
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   839
684
6ba6249fb194 Create new project logo. Add favicon to project sites.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 683
diff changeset
   840
.PHONY: favicon
6ba6249fb194 Create new project logo. Add favicon to project sites.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 683
diff changeset
   841
favicon: $(FAVICON)
6ba6249fb194 Create new project logo. Add favicon to project sites.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 683
diff changeset
   842
6ba6249fb194 Create new project logo. Add favicon to project sites.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 683
diff changeset
   843
$(FAVICON): $(LOGO_FILE) $(MAKEFILE_LIST) | $(dir $(FAVICON))
1209
eacf1b282688 Switched to graphicsmagick to generate favicon. It doesn't support Microsoft ICO so generate PNG instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1207
diff changeset
   844
	gm convert +antialias $< -resize 16x16 $@
684
6ba6249fb194 Create new project logo. Add favicon to project sites.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 683
diff changeset
   845
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   846
.PHONY: logo
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   847
logo: logo-png
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   848
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   849
.PHONY: logo-png
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   850
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
   851
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   852
# Require:
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   853
#   $ sudo apt-get install imagemagick librsvg2-bin
684
6ba6249fb194 Create new project logo. Add favicon to project sites.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 683
diff changeset
   854
$(LOGO_PNG_FILES): dist/misc/logo-%.png: $(LOGO_FILE) | dist/misc/
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   855
	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
   856
308
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   857
.PHONY: voa
614
594fd4168b66 Fix: do not mess up project root with LaTeX related files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 608
diff changeset
   858
voa: dist/pdf/voa-special.pdf
308
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   859
1253
a4a1e57e8ad7 Renamed dir: contrib/ => misc/.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1226
diff changeset
   860
dist/pdf/voa-special.pdf: misc/voa-special.tex | dist/pdf/
614
594fd4168b66 Fix: do not mess up project root with LaTeX related files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 608
diff changeset
   861
	$(LATEX2PDF) -output-directory dist/pdf/ $<
594fd4168b66 Fix: do not mess up project root with LaTeX related files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 608
diff changeset
   862
594fd4168b66 Fix: do not mess up project root with LaTeX related files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 608
diff changeset
   863
dist/pdf/:
594fd4168b66 Fix: do not mess up project root with LaTeX related files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 608
diff changeset
   864
	mkdir -p $@
308
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   865
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   866
################################################################
108
1f1363141da7 Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 107
diff changeset
   867
# Helpers targets.
1f1363141da7 Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 107
diff changeset
   868
1f1363141da7 Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 107
diff changeset
   869
.PHONY: help
1f1363141da7 Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 107
diff changeset
   870
help:
122
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   871
	@\
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   872
echo; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   873
echo Current configuration:; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   874
echo; \
480
4413ccc9e216 Include VERSION file into source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 479
diff changeset
   875
sed 's=^=  =' <$(VER_FILE)
122
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   876
	@if [ -f Makefile.config ]; then \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   877
		echo; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   878
		echo User configuration:; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   879
		echo; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   880
		sed 's=^=  =' <Makefile.config; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   881
	fi
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   882
	@\
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   883
echo; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   884
echo Supported targets:; \
123
49f373dba523 Fix output sanity.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 122
diff changeset
   885
echo; \
150
28cd06b06bb8 Rename BUILD_SCRIPT ==> BUILD_SCRIPTS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 148
diff changeset
   886
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
   887
249
5ad075a475f2 TODO convention.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 245
diff changeset
   888
.PHONY: todo
5ad075a475f2 TODO convention.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 245
diff changeset
   889
todo:
5ad075a475f2 TODO convention.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 245
diff changeset
   890
	grep -nH 'TODO\|XXX' $(RST_FILES) $(C5_FILES)
5ad075a475f2 TODO convention.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 245
diff changeset
   891
660
5305f170237d Add spell checker based on hunspell.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 655
diff changeset
   892
# Install:
5305f170237d Add spell checker based on hunspell.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 655
diff changeset
   893
#   $ sudo apt-get install python3-enchant hunspell-en-us hunspell-en-gb hunspell-en-au hunspell-en-ca
5305f170237d Add spell checker based on hunspell.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 655
diff changeset
   894
.PHONY: check
5305f170237d Add spell checker based on hunspell.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 655
diff changeset
   895
check:
1316
870abedea142 Allow selecting Python 2 or 3 when parsing dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1314
diff changeset
   896
	$(PYTHON) -B py/gadict_spellcheck.py gadict.gadict
660
5305f170237d Add spell checker based on hunspell.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 655
diff changeset
   897
94
1b2cf5b2b46c Add target that print statistics about word count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 85
diff changeset
   898
################################################################
54
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   899
# Clean targets.
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   900
23
946ae4b96419 Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 22
diff changeset
   901
.PHONY: distclean
946ae4b96419 Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 22
diff changeset
   902
distclean: clean
480
4413ccc9e216 Include VERSION file into source distribution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 479
diff changeset
   903
	rm -rf $(VER_FILE)
13
d0e948499faf Added targets [un]install-user to proper install dict for current user.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 9
diff changeset
   904
23
946ae4b96419 Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 22
diff changeset
   905
.PHONY: clean
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   906
clean:
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   907
	rm -rf dist/
63
f1bd82604661 Add help target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 56
diff changeset
   908