Makefile
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sun, 27 Mar 2016 18:03:40 +0300
changeset 396 4f16fb80b2a7
parent 393 2756a6deca7e
child 401 791994f95561
permissions -rw-r--r--
Suppress __pycache__ dir.
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
################################################################
118
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
    34
# Build script definitions.
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
    35
150
28cd06b06bb8 Rename BUILD_SCRIPT ==> BUILD_SCRIPTS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 148
diff changeset
    36
BUILD_SCRIPTS := $(firstword $(MAKEFILE_LIST))
118
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
    37
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
    38
ifneq '' '$(wildcard Makefile.config)'
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
    39
  include Makefile.config
150
28cd06b06bb8 Rename BUILD_SCRIPT ==> BUILD_SCRIPTS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 148
diff changeset
    40
  BUILD_SCRIPTS += Makefile.config
118
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
    41
endif
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
    42
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
    43
################################################################
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    44
# Version extracting/generation.
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    45
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
    46
VER_FILE := dist/misc/VERSION
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
    47
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
    48
# Prevent making distribution with wrong version.
133
60e2090b7462 Rebuild VERSION file for 'dist' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 132
diff changeset
    49
ifneq '' '$(filter deploy% dist%,$(MAKECMDGOALS))'
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    50
  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
    51
    $(shell rm -f $(VER_FILE))
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    52
  endif
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    53
endif
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    54
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    55
# 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
    56
-include $(VER_FILE)
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    57
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
    58
$(VER_FILE): | $(dir $(VER_FILE))
122
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    59
	\
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    60
vtagdist=$$(hg log -r . --template '{latesttagdistance}'); \
141
4b799e3f9a70 Allow release from commit that tag release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 137
diff changeset
    61
vatrelease=$$([ $$vtagdist -le 1 ] && echo yes || echo no); \
122
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    62
vtag=$$(hg log -r . --template '{latesttag}'); \
311
47ae3d88a59d Use more conventional tag naming schema.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 308
diff changeset
    63
vmajor=$${vtag#v}; \
151
206fb46e793d Make code more genetic.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 150
diff changeset
    64
vmajor=$${vmajor%%.*}; \
122
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    65
vminor=$${vtag#*.}; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    66
vrev=$$(hg id -i); \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    67
visclean=$$(case $$vrev in *+) echo no;; *) echo yes;; esac); \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    68
vrev=$${vrev%+}; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    69
{ \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    70
echo "vrev=$$vrev"; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    71
echo "vtag=$$vtag"; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    72
echo "vtagdist=$$vtagdist"; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    73
echo "visclean=$$visclean"; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    74
echo "vatrelease=$$vatrelease"; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    75
echo "vmajor=$$vmajor"; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
    76
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
    77
} >$@
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    78
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
    79
################################################################
106
092b25d032af Set 'help' as default target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 105
diff changeset
    80
# Determine platform/environment.
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
    81
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
    82
host_os = unix
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
    83
ifneq '' '$(COMSPEC)'
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
    84
  ifneq '' '$(WINDIR)'
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
    85
    # Probably under Windows.
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
    86
    host_os = windows
107
4cfb94e11b5d Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
    87
    ifneq '' '$(wildcard /etc/setup/*cygwin*)'
4cfb94e11b5d Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
    88
      # Probably under Cygwin.
4cfb94e11b5d Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
    89
      host_os = cygwin
4cfb94e11b5d Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
    90
    endif
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
    91
  endif
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
    92
endif
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
    93
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
    94
################################################################
107
4cfb94e11b5d Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
    95
# Build tools definition/switches.
4cfb94e11b5d Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
    96
121
38e8a1063673 Add 'DESTDIR' - prefix to 'prefix' variable value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 120
diff changeset
    97
INSTALL = install
38e8a1063673 Add 'DESTDIR' - prefix to 'prefix' variable value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 120
diff changeset
    98
INSTALL_PROGRAM = $(INSTALL)
38e8a1063673 Add 'DESTDIR' - prefix to 'prefix' variable value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 120
diff changeset
    99
INSTALL_DATA = $(INSTALL) -m 644
38e8a1063673 Add 'DESTDIR' - prefix to 'prefix' variable value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 120
diff changeset
   100
107
4cfb94e11b5d Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
   101
RST_WARNING_FLAGS := --halt warning
4cfb94e11b5d Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
   102
RST_FLAGS := --strip-comments
4cfb94e11b5d Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
   103
RST_FLAGS += $(RST_WARNING_FLAGS)
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   104
107
4cfb94e11b5d Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
   105
RST2HTML := rst2html
4cfb94e11b5d Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
   106
ifeq '$(host_os)' 'cygwin'
4cfb94e11b5d Add warning flags to 'rst2html'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
   107
  RST2HTML := rst2html.py
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   108
endif
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   109
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
   110
RST2HTML_FLAGS := $(RST_FLAGS) $(RST2HTML_RENDER_FLAGS)
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   111
308
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   112
LATEX2PDF := pdflatex
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   113
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   114
################################################################
54
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   115
# Install paths.
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   116
41
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   117
ifeq '$(origin prefix)' 'undefined'
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   118
  ifeq '$(shell id -u)' '0'
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   119
    prefix = /usr/local
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   120
  else
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   121
    prefix = $(HOME)/usr
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   122
  endif
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   123
endif
388
d98d8f8cdef9 Eliminate "DESTDIR", "prefix" variable should be sufficient.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 387
diff changeset
   124
datarootdir := $(prefix)/share
389
10020d94a315 Install/uninstall "gadict.el".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
   125
datadir := $(datarootdir)/dictd
10020d94a315 Install/uninstall "gadict.el".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
   126
elispdir := $(datarootdir)/emacs/site-lisp
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   127
54
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   128
################################################################
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   129
# Project dirs/files.
21
d4b27e5b7a4b Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 20
diff changeset
   130
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   131
pkgname = gadict
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   132
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
   133
387
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   134
# GADICT_FILES := $(wildcard *.gadict)
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   135
GADICT_FILES := gadict_en-ru+ua.gadict
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   136
387
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   137
C5_FILES := $(patsubst %.gadict,dist/dictd/%.c5,$(GADICT_FILES))
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   138
DICT_FILES := $(C5_FILES:.c5=.dict)
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   139
DICTDZ_FILES := $(C5_FILES:.c5=.dict.dz)
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   140
INDEX_FILES := $(C5_FILES:.c5=.index)
1
b23e948de24a Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 0
diff changeset
   141
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   142
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
   143
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
   144
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   145
RST_GEN_FILES := STAT.rst
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   146
RST_COMMON_FILES := header.rst
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   147
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
   148
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
   149
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   150
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
   151
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   152
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
   153
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
   154
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   155
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
   156
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   157
LOGO_NAME := logo
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   158
LOGO_SVG := $(LOGO_NAME).svg
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   159
LOGO_DIM := 32x32 48x48 64x64
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   160
LOGO_PNG_FILES := $(patsubst %,$(LOGO_NAME)-%.png,$(LOGO_DIM))
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   161
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   162
DIST_DIR = $(fullpkgname)
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   163
DISTSRC_DIR = $(fullpkgname)_src
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   164
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   165
DIST_FILES = $(DICTDZ_FILES) $(INDEX_FILES) $(RST_HTML_FILES) $(RST_FILES)
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   166
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   167
DISTSRC_HELPER_FILES = Makefile rst.css .dir-locals.el
204
f93358e8be5b Exclude .html files from src bundle as they can be recreated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   168
DISTSRC_FILES = $(C5_FILES) $(RST_FILES) $(DISTSRC_HELPER_FILES)
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   169
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   170
DIST_TARBALLS = $(DIST_DIR).tar.gz $(DIST_DIR).tar.bz2
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   171
DISTSRC_TARBALLS = $(DISTSRC_DIR).tar.gz $(DISTSRC_DIR).tar.bz2
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   172
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   173
################################################################
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   174
# Deploy/release targets.
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   175
338
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   176
.PHONY: deploy
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   177
deploy: deploy2defun deploy2sf
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   178
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   179
.PHONY: release
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   180
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
   181
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   182
.PHONY: release2defun
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   183
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
   184
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   185
.PHONY: release2sf
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   186
release2defun: validate-release deploy2sf
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   187
338
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   188
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   189
DEFUN_USER ?= user
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   190
DEFUN_HG_SRV ?= hg.defun.work
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   191
DEFUN_HG_DIR ?= /srv/hg/gadict
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   192
DEFUN_WWW_SRV ?= defun.work
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   193
DEFUN_WWW_DIR ?= /srv/www/gadict
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   194
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   195
.PHONY: deploy2defun
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   196
deploy2defun: deploy2defun-src deploy2defun-www
118
c9ce7b6ae3bc Make SourceForge user name as configurable parameter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 115
diff changeset
   197
338
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   198
.PHONY: deploy2defun-src
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   199
deploy2defun-src:
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   200
	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
   201
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   202
.PHONY: deploy2defun-www
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   203
deploy2defun-www: $(HTML_FILES)
338
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   204
	( \
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   205
echo 'cd $(DEFUN_WWW_DIR)'; \
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   206
for f in $(HTML_FILES); do \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   207
  n=$${f##*/}; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   208
  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
   209
  echo "chmod 644 $$n"; \
338
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   210
done; \
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   211
echo 'quit'; \
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   212
) | 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
   213
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   214
61a9d2de0e3e New home page. SF is used as mirror.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 313
diff changeset
   215
SF_USER ?= gavenkoa
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   216
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   217
# First time you deploy to SourceForge (sf) you need manually login to:
120
cb5ab06a72a7 Inline URL to make code more verbose.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 119
diff changeset
   218
#   $ sftp $(SF_USER),$(pkgname)@web.sourceforge.net
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   219
# as it may require interactive input for accepting server public key.
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   220
# Next time any action fully automated.
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   221
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   222
.PHONY: deploy2sf
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   223
deploy2sf: deploy2sf-src deploy2sf-www deploy2sf-voa
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   224
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   225
.PHONY: deploy2sf-src
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   226
deploy2sf-src:
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   227
	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
   228
119
20f1d1080886 Rename 'name' ==> 'pkgname'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 118
diff changeset
   229
# 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
   230
.PHONY: deploy2sf-www
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   231
deploy2sf-www: $(HTML_FILES)
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   232
	( echo 'cd htdocs'; \
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   233
for f in $(HTML_FILES); do \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   234
  n=$${f##*/}; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   235
  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
   236
  echo "chmod 644 $$n"; \
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   237
done; \
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   238
echo 'quit'; \
120
cb5ab06a72a7 Inline URL to make code more verbose.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 119
diff changeset
   239
) | sftp -b - $(SF_USER),$(pkgname)@web.sourceforge.net
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   240
308
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   241
.PHONY: deploy2sf-voa
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   242
deploy2sf-voa: voa
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   243
	( echo 'cd htdocs'; \
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   244
  echo "put voa-special.pdf"; \
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   245
  echo "chmod 644 voa-special.pdf"; \
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   246
echo 'quit'; \
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   247
) | sftp -b - $(SF_USER),$(pkgname)@web.sourceforge.net
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   248
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   249
.PHONY: release2sf
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   250
deploy2sf-release: validate-release $(DIST_TARBALLS) $(DISTSRC_TARBALLS)
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   251
	exit 1
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   252
	: TODO broken due to new project hierarchy
287
d01045b55e04 Avoid names inlining.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 276
diff changeset
   253
	( echo 'cd /home/frs/project/$(shell v=$(pkgname); echo $${v:0:1}/$${v:0:2})/$(pkgname)'; \
115
1c6ffaecdf50 Fix sftp command usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 112
diff changeset
   254
echo "put  README.rst"; \
1c6ffaecdf50 Fix sftp command usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 112
diff changeset
   255
echo "chmod 644 README.rst"; \
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   256
echo "mkdir v$(vmajor).$(vminor)"; \
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   257
echo "cd v$(vmajor).$(vminor)"; \
142
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 141
diff changeset
   258
for f in $(DIST_TARBALLS) $(DISTSRC_TARBALLS); do \
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   259
	echo "put $$f"; \
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   260
	echo "chmod 644 $$f"; \
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   261
done; \
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   262
echo 'quit'; \
120
cb5ab06a72a7 Inline URL to make code more verbose.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 119
diff changeset
   263
) | sftp -b - $(SF_USER),$(pkgname)@frs.sourceforge.net
111
84fe35f49224 Add 'deploy' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 110
diff changeset
   264
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   265
.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
   266
validate-release:
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   267
	\
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   268
case ${visclean} in \
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   269
  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
   270
    exit 1;; \
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   271
esac
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   272
	\
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   273
case $(vatrelease) in \
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   274
  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
   275
    exit 1;; \
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   276
esac
124
7d9f38580ed9 Add 'deploy-check' target to check source sanity before release.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 123
diff changeset
   277
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   278
################################################################
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   279
# Dist targets.
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   280
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   281
.PHONY: dist
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   282
dist: dist-dictd dist-src
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   283
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   284
.PHONY: dist-dictd
105
35cc545ec03d 'clean'-like targets delete artefacts after 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 103
diff changeset
   285
dist-dictd: $(DIST_TARBALLS)
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   286
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   287
.PHONY: dist-src
105
35cc545ec03d 'clean'-like targets delete artefacts after 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 103
diff changeset
   288
dist-src: $(DISTSRC_TARBALLS)
103
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   289
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   290
%.tar.gz: %
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   291
	tar zcf $*.tar.gz $*
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   292
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   293
%.tar.bz2: %
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   294
	tar jcf $*.tar.bz2 $*
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   295
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   296
$(DIST_DIR): $(DIST_FILES)
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   297
	rm -rf $@
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   298
	mkdir $@
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   299
	cp $(DIST_FILES) $@
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   300
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   301
$(DISTSRC_DIR): $(DISTSRC_FILES)
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   302
	rm -rf $@
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   303
	mkdir $@
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   304
	cp $(DISTSRC_FILES) $@
b5b1dc62bdc0 Add 'dist' targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 94
diff changeset
   305
54
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   306
################################################################
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   307
# Build targets.
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   308
23
946ae4b96419 Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 22
diff changeset
   309
.PHONY: all
245
5b9fac360762 Rename target to avoid disambiguate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 241
diff changeset
   310
all: dict
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   311
245
5b9fac360762 Rename target to avoid disambiguate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 241
diff changeset
   312
.PHONY: dict
5b9fac360762 Rename target to avoid disambiguate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 241
diff changeset
   313
dict: $(DICTDZ_FILES) $(INDEX_FILES)
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   314
41
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   315
#  --case-sensitive
387
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   316
#	-u "`sed -n '\|http://[[:print:]]\+/|{s=^.*\(http://\)=\1=;p;q;}' $<`"
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   317
#	-s "`sed -n '/^ABOUT: /{s=ABOUT: ==;p;q;}' $<`"
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   318
dist/dictd/%.dict dist/dictd/%.index: dist/dictd/%.c5
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   319
	(cd dist/dictd; dictfmt  -c5 --headword-separator '; ' --break-headwords --utf8 --allchars $*)  < $<
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   320
387
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   321
dist/dictd/%.dict.dz: dist/dictd/%.dict
41
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   322
	dictzip -c $< >$@
1
b23e948de24a Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 0
diff changeset
   323
396
4f16fb80b2a7 Suppress __pycache__ dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 393
diff changeset
   324
# -B  suppress __pycache__ dir
387
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   325
dist/dictd/%.c5: %.gadict | dist/dictd
396
4f16fb80b2a7 Suppress __pycache__ dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 393
diff changeset
   326
	python3 -B py/gadict_c5.py $< $@
387
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   327
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   328
dist/dictd:
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   329
	mkdir -p $@
1616fc7c1f09 Start using "gadict.py".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 384
diff changeset
   330
54
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   331
################################################################
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   332
# Install/uninstall targets.
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   333
23
946ae4b96419 Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 22
diff changeset
   334
.PHONY: install
148
b0142666eeba Fix dependency for 'install' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 146
diff changeset
   335
install: $(DICTDZ_FILES) $(INDEX_FILES)
389
10020d94a315 Install/uninstall "gadict.el".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
   336
	mkdir -p $(datadir) $(elispdir)
41
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   337
	for f in $(DICTDZ_FILES) $(INDEX_FILES); do \
121
38e8a1063673 Add 'DESTDIR' - prefix to 'prefix' variable value.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 120
diff changeset
   338
		$(INSTALL_DATA) $$f $(datadir); \
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   339
	done
389
10020d94a315 Install/uninstall "gadict.el".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
   340
	$(INSTALL_DATA) contrib/gadict.el $(elispdir)
10020d94a315 Install/uninstall "gadict.el".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
   341
	emacs -batch -f batch-byte-compile $(elispdir)/gadict.el
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   342
384
3af39c0b5229 A way to uninstall old C5 dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 339
diff changeset
   343
OLD_DICT_FILES := gadict-abbr.dict-c5 gadict-adjective-en-ru.dict-c5 \
3af39c0b5229 A way to uninstall old C5 dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 339
diff changeset
   344
gadict-adverb-en-ru.dict-c5 gadict-conjunction-en-ru.dict-c5            \
3af39c0b5229 A way to uninstall old C5 dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 339
diff changeset
   345
gadict-en-ru.dict-c5 gadict-irregular-verbs-en-ru.dict-c5               \
3af39c0b5229 A way to uninstall old C5 dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 339
diff changeset
   346
gadict-numeral-en-ru.dict-c5 gadict-phrasal-verbs-en-ru.dict-c5         \
3af39c0b5229 A way to uninstall old C5 dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 339
diff changeset
   347
gadict-preposition-en-ru.dict-c5 gadict-pronoun-en-ru.dict-c5           \
3af39c0b5229 A way to uninstall old C5 dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 339
diff changeset
   348
gadict-regular-verbs-en-ru.dict-c5
3af39c0b5229 A way to uninstall old C5 dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 339
diff changeset
   349
3af39c0b5229 A way to uninstall old C5 dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 339
diff changeset
   350
OLD_DICTDZ_FILES := $(OLD_DICT_FILES:.dict-c5=.dict.dz)
3af39c0b5229 A way to uninstall old C5 dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 339
diff changeset
   351
OLD_INDEX_FILES := $(OLD_DICT_FILES:.dict-c5=.index)
3af39c0b5229 A way to uninstall old C5 dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 339
diff changeset
   352
23
946ae4b96419 Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 22
diff changeset
   353
.PHONY: uninstall
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   354
uninstall:
41
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   355
	for f in $(DICTDZ_FILES) $(INDEX_FILES); do \
8f1dc5d77f3d Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
   356
		rm -f $(datadir)/$$f; \
21
d4b27e5b7a4b Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 20
diff changeset
   357
	done
384
3af39c0b5229 A way to uninstall old C5 dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 339
diff changeset
   358
	for f in $(OLD_DICTDZ_FILES) $(OLD_INDEX_FILES); do \
3af39c0b5229 A way to uninstall old C5 dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 339
diff changeset
   359
		rm -f $(datadir)/$$f; \
3af39c0b5229 A way to uninstall old C5 dictionaries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 339
diff changeset
   360
	done
389
10020d94a315 Install/uninstall "gadict.el".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
   361
	rm -f $(elispdir)/gadict.el $(elispdir)/gadict.elc
13
d0e948499faf Added targets [un]install-user to proper install dict for current user.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 9
diff changeset
   362
54
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   363
################################################################
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   364
# Documentation targets.
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   365
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   366
.PHONY: docs
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   367
docs: html
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   368
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   369
.PHONY: html
276
66db1bbebe45 Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 275
diff changeset
   370
html: $(RST_HTML_FILES)
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   371
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   372
$(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
   373
	cp $< $@
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   374
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   375
$(RST_HTML_FILES): dist/www/%.html: www/%.rst $(RST_CSS_FILE) $(RST_TMPL_FILE) $(BUILD_SCRIPTS) | dist/www
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   376
	$(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
   377
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   378
dist/www:
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   379
	mkdir -p $@
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   380
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   381
$(RST_TMPL_FILE): www/tmpl/rst.tmpl.in $(BUILD_SCRIPTS) | $(dir $(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
   382
	\
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   383
[[ ${visclean} = no ]] && warn1='<b>Warning</b>: Build done with local changes!' || :; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   384
[[ ${vatrelease} = no ]] && warn2='<b>Warning</b>: Build is far from latest <tt>$(vtag)</tt> release state by $(vtagdist) changes.' || :; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   385
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
   386
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   387
################################################################
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   388
# Article statistics.
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   389
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   390
.PHONY: stat
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   391
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
   392
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   393
$(STAT_HTML_FILE): $(STAT_RST_FILE) $(RST_CSS_FILE) $(RST_TMPL_FILE) | dist/www
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   394
	$(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
   395
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   396
$(STAT_RST_FILE): $(GADICT_FILES) $(BUILD_SCRIPTS)
109
5bb58b8d87a7 Add version info into documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 108
diff changeset
   397
	{ \
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   398
echo '==========================='; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   399
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
   400
echo '==========================='; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   401
echo '.. contents::'; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   402
echo '   :local:'; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   403
echo; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   404
echo '======================================== ====='; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   405
echo '             Dictionary                  Count'; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   406
echo '======================================== ====='; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   407
total=0; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   408
for dic in $(GADICT_FILES); do \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   409
  cnt=`grep '^__' $$dic | wc -l`; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   410
  printf '%40s %5s\n' $${dic%.dict-c5} $$cnt; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   411
  total=$$(($$total + $$cnt)); \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   412
done; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   413
printf '%40s %5s\n' '**Total**' $$total; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   414
echo '======================================== ====='; \
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   415
} >$@
276
66db1bbebe45 Generalise RST build code. Remove index.rst, use README.rst instead.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 275
diff changeset
   416
66
be91c79007e9 Add 'html' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   417
################################################################
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   418
# Misc targets.
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   419
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   420
.PHONY: logo
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   421
logo: logo-png
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   422
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   423
.PHONY: logo-png
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   424
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
   425
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   426
# Require:
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   427
#   $ sudo apt-get install imagemagick librsvg2-bin
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   428
$(LOGO_PNG_FILES): $(LOGO_NAME)-%.png: $(LOGO_SVG)
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   429
	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
   430
308
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   431
.PHONY: voa
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   432
voa: voa-special.pdf
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   433
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   434
voa-special.pdf: contrib/voa-special.tex
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   435
	$(LATEX2PDF) -output-directory . $<
7a5f4265a581 Build and deploy VOA in PDF format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 287
diff changeset
   436
275
9f70f66ee2a1 Merge with 'ffead' project. Most significant is generating different sizes PNG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 274
diff changeset
   437
################################################################
108
1f1363141da7 Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 107
diff changeset
   438
# Helpers targets.
1f1363141da7 Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 107
diff changeset
   439
1f1363141da7 Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 107
diff changeset
   440
.PHONY: help
1f1363141da7 Dump version info with 'version' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 107
diff changeset
   441
help:
122
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   442
	@\
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   443
echo; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   444
echo Current configuration:; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   445
echo; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   446
sed 's=^=  =' <VERSION
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   447
	@if [ -f Makefile.config ]; then \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   448
		echo; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   449
		echo User configuration:; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   450
		echo; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   451
		sed 's=^=  =' <Makefile.config; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   452
	fi
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   453
	@\
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   454
echo; \
003356f9e504 Gather all available version info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 121
diff changeset
   455
echo Supported targets:; \
123
49f373dba523 Fix output sanity.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 122
diff changeset
   456
echo; \
150
28cd06b06bb8 Rename BUILD_SCRIPT ==> BUILD_SCRIPTS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 148
diff changeset
   457
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
   458
249
5ad075a475f2 TODO convention.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 245
diff changeset
   459
.PHONY: todo
5ad075a475f2 TODO convention.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 245
diff changeset
   460
todo:
5ad075a475f2 TODO convention.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 245
diff changeset
   461
	grep -nH 'TODO\|XXX' $(RST_FILES) $(C5_FILES)
5ad075a475f2 TODO convention.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 245
diff changeset
   462
241
13fcad0b3a84 Add project logo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 240
diff changeset
   463
.PHONY: logo-png
13fcad0b3a84 Add project logo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 240
diff changeset
   464
logo-png: logo-64x64.png
13fcad0b3a84 Add project logo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 240
diff changeset
   465
13fcad0b3a84 Add project logo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 240
diff changeset
   466
# Require:
13fcad0b3a84 Add project logo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 240
diff changeset
   467
#   $ sudo apt-get install imagemagick librsvg2-bin
13fcad0b3a84 Add project logo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 240
diff changeset
   468
%.png: %.svg
274
f0b6d4c0ee97 Set transparent background for PNG logo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 261
diff changeset
   469
	convert +antialias -background transparent $< $@
241
13fcad0b3a84 Add project logo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 240
diff changeset
   470
94
1b2cf5b2b46c Add target that print statistics about word count.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 85
diff changeset
   471
################################################################
54
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   472
# Clean targets.
12426df26196 Add headlines docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   473
23
946ae4b96419 Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 22
diff changeset
   474
.PHONY: distclean
946ae4b96419 Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 22
diff changeset
   475
distclean: clean
13
d0e948499faf Added targets [un]install-user to proper install dict for current user.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 9
diff changeset
   476
23
946ae4b96419 Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 22
diff changeset
   477
.PHONY: clean
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   478
clean:
339
4d8d46bbe30d Move RST files to separate directory. Build HTML files out of sources
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 338
diff changeset
   479
	rm -rf dist/
63
f1bd82604661 Add help target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 56
diff changeset
   480