Makefile
author Oleksandr Gavenko <gavenkoa@gmail.com>
Tue, 31 Jan 2017 03:42:15 +0200
changeset 191 aee53838634e
parent 185 59df68b203ca
permissions -rw-r--r--
Update CHANGES.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
48
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     1
#
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     2
# You can override such variables in Makefile.config:
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
#
185
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
     4
#   FORCE         Non empty allow deploy with unclean working state.
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
     5
#
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
     6
#   SF_USER       SourceForge user name.
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
     7
#   WWW_SRV_NAME
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
     8
#   WWW_SRV_USER
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
     9
#   WWW_SRV_DIR
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
    10
#   HG_SRV_NAME
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
    11
#   HG_SRV_USER
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
    12
#   HG_SRV_DIR
48
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    14
################################################################
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    15
# Standard GNU Makefile settings.
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    16
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    17
SHELL = /bin/bash
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    18
export PATH := /bin:/usr/bin:${PATH}
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    19
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    20
# Disable built in pattern rules.
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    21
MAKEFLAGS += -r
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    22
# Disable built in variables.
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    23
MAKEFLAGS += -R
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    24
# Disable built in suffix rules.
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    25
.SUFFIXES:
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    26
# Delete target file if command fails.
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    27
.DELETE_ON_ERROR:
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    28
# Default target.
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    29
.DEFAULT_GOAL = help
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    30
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    31
################################################################
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    32
# Build script definitions.
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    33
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    34
BUILD_SCRIPTS := $(firstword $(MAKEFILE_LIST))
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    35
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    36
ifneq '' '$(wildcard Makefile.config)'
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    37
  include Makefile.config
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    38
  BUILD_SCRIPTS += Makefile.config
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    39
endif
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    40
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    41
################################################################
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    42
# Version extracting/generation.
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    43
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    44
# Prevent making distribution with wrong version.
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    45
ifneq '' '$(filter deploy% dist%,$(MAKECMDGOALS))'
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    46
  ifeq '' '$(MAKE_RESTARTS)'
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    47
    $(info $(shell rm -f VERSION))
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    48
  endif
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    49
endif
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    50
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    51
# Here are vmajor and vminor. Look README section "Versioning rules."
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    52
-include VERSION
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    53
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    54
VERSION:
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    55
	\
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    56
vtagdist=$$(hg log -r . --template '{latesttagdistance}'); \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    57
vatrelease=$$([ $$vtagdist -le 1 ] && echo yes || echo no); \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    58
vtag=$$(hg log -r . --template '{latesttag}'); \
50
0bda4161d1b9 Fix tag prefix (after copy/paste).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 49
diff changeset
    59
vmajor=$${vtag#v}; \
48
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    60
vmajor=$${vmajor%%.*}; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    61
vminor=$${vtag#*.}; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    62
vrev=$$(hg id -i); \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    63
visclean=$$(case $$vrev in *+) echo no;; *) echo yes;; esac); \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    64
vrev=$${vrev%+}; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    65
{ \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    66
echo "vrev=$$vrev"; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    67
echo "vtag=$$vtag"; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    68
echo "vtagdist=$$vtagdist"; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    69
echo "visclean=$$visclean"; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    70
echo "vatrelease=$$vatrelease"; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    71
echo "vmajor=$$vmajor"; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    72
echo "vminor=$$vminor"; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    73
} >VERSION
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    74
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    75
################################################################
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    76
# Determine platform/environment.
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    77
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    78
host_os = unix
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    79
ifneq '' '$(COMSPEC)'
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    80
  ifneq '' '$(WINDIR)'
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    81
    # Probably under Windows.
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    82
    host_os = windows
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    83
    ifneq '' '$(wildcard /etc/setup/*cygwin*)'
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    84
      # Probably under Cygwin.
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    85
      host_os = cygwin
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    86
    endif
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    87
  endif
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    88
endif
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    89
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    90
################################################################
77
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
    91
# Build tools definition/switches.
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
    92
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
    93
RST_WARNING_FLAGS := --halt warning
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
    94
RST_FLAGS := --strip-comments
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
    95
RST_FLAGS += $(RST_WARNING_FLAGS)
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
    96
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
    97
RST2HTML := rst2html
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
    98
ifeq '$(host_os)' 'cygwin'
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
    99
  RST2HTML := rst2html.py
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   100
endif
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   101
RST2HTML_FLAGS := $(RST_FLAGS)
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   102
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   103
################################################################
48
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   104
# Project dirs/files.
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   105
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   106
pkgname = 2048-js-ai
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   107
sfpkgname = js-2048-ai
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   108
fullpkgname = $(pkgname)-$(vmajor).$(vminor)
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   109
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   110
DIST_DIR = $(fullpkgname)
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   111
77
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   112
RST_GEN_FILES := VERSION.rst
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   113
RST_COMMON_FILES := VERSION.rst header.rst
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   114
RST_FILES := $(filter-out $(RST_COMMON_FILES),$(sort $(wildcard *.rst) $(RST_GEN_FILES)))
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   115
RST_HTML_FILES := $(RST_FILES:.rst=.html)
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   116
57
94e1b2d0bd31 Add JSDoc annotation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   117
JS_FILES := $(wildcard *.js)
77
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   118
HTML_FILES := 2048.html
178
ef24ad27c83d Add deploy dependency on CSS file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 175
diff changeset
   119
CSS_FILES := rst.css
ef24ad27c83d Add deploy dependency on CSS file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 175
diff changeset
   120
WWW_FILES := $(JS_FILES) $(HTML_FILES) $(CSS_FILES) $(RST_HTML_FILES)
48
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   121
82
a61ac9c2d506 Package RST files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 80
diff changeset
   122
DIST_FILES = $(WWW_FILES) $(RST_FILES) VERSION
48
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   123
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   124
DIST_TARBALLS = $(DIST_DIR).tar.gz $(DIST_DIR).zip
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   125
57
94e1b2d0bd31 Add JSDoc annotation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   126
JSDOC_DIR := jsdoc
94e1b2d0bd31 Add JSDoc annotation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   127
48
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   128
################################################################
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   129
# Deploy targets.
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   130
185
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
   131
SF_USER ?= gavenkoa
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
   132
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
   133
WWW_SRV_NAME ?= defun.work
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
   134
WWW_SRV_USER ?= user
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
   135
WWW_SRV_DIR ?= /srv/www/2048
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
   136
HG_SRV_NAME ?= hg.defun.work
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
   137
HG_SRV_USER ?= user
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
   138
HG_SRV_DIR ?= /srv/hg/2048-js-ai
48
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   139
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   140
.PHONY: deploy
175
9a83576eec4c Deploy to personal home page. Use game itself as index.html.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 84
diff changeset
   141
deploy: deploy2defun deploy2sf
9a83576eec4c Deploy to personal home page. Use game itself as index.html.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 84
diff changeset
   142
9a83576eec4c Deploy to personal home page. Use game itself as index.html.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 84
diff changeset
   143
.PHONY: deploy2defun
9a83576eec4c Deploy to personal home page. Use game itself as index.html.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 84
diff changeset
   144
deploy2defun: deploy2defun-src deploy2defun-www
9a83576eec4c Deploy to personal home page. Use game itself as index.html.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 84
diff changeset
   145
9a83576eec4c Deploy to personal home page. Use game itself as index.html.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 84
diff changeset
   146
.PHONY: deploy2defun-src
9a83576eec4c Deploy to personal home page. Use game itself as index.html.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 84
diff changeset
   147
deploy2defun-src:
185
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
   148
	hg push ssh://$(HG_SRV_USER)@$(HG_SRV_NAME)/$(HG_SRV_DIR)/ || [ $$? = 1 ]
175
9a83576eec4c Deploy to personal home page. Use game itself as index.html.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 84
diff changeset
   149
9a83576eec4c Deploy to personal home page. Use game itself as index.html.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 84
diff changeset
   150
.PHONY: deploy2defun-www
9a83576eec4c Deploy to personal home page. Use game itself as index.html.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 84
diff changeset
   151
deploy2defun-www: deploy-check $(WWW_FILES)
185
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
   152
	( echo 'cd $(WWW_SRV_DIR)'; \
175
9a83576eec4c Deploy to personal home page. Use game itself as index.html.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 84
diff changeset
   153
for f in $(WWW_FILES); do \
9a83576eec4c Deploy to personal home page. Use game itself as index.html.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 84
diff changeset
   154
  echo "put $$f"; \
9a83576eec4c Deploy to personal home page. Use game itself as index.html.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 84
diff changeset
   155
  echo "chmod 644 $$f"; \
9a83576eec4c Deploy to personal home page. Use game itself as index.html.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 84
diff changeset
   156
done; \
9a83576eec4c Deploy to personal home page. Use game itself as index.html.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 84
diff changeset
   157
echo "put 2048.html index.html"; \
9a83576eec4c Deploy to personal home page. Use game itself as index.html.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 84
diff changeset
   158
echo 'quit'; \
185
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
   159
) | sftp -b - $(WWW_SRV_USER)@$(WWW_SRV_NAME)
48
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   160
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   161
# First time you deploy to SourceForge (sf) you need manually login to:
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   162
#   $ sftp $(SF_USER),$(pkgname)@web.sourceforge.net
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   163
# as it may require interactive input for accepting server public key.
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   164
# Next time any action fully automated.
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   165
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   166
.PHONY: deploy2sf
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   167
deploy2sf: deploy2sf-src deploy2sf-www deploy2sf-release
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   168
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   169
.PHONY: deploy2sf-src
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   170
deploy2sf-src:
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   171
	hg push ssh://$(SF_USER)@hg.code.sf.net/p/$(sfpkgname)/hg || [ $$? = 1 ]
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   172
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   173
# Will be accessed via http://$(pkgname).sourceforge.net
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   174
.PHONY: deploy2sf-www
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   175
deploy2sf-www: deploy-check $(WWW_FILES)
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   176
	( echo 'cd htdocs'; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   177
for f in $(WWW_FILES); do \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   178
  echo "put $$f"; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   179
  echo "chmod 644 $$f"; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   180
done; \
175
9a83576eec4c Deploy to personal home page. Use game itself as index.html.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 84
diff changeset
   181
echo "put 2048.html index.html"; \
48
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   182
echo 'quit'; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   183
) | sftp -b - $(SF_USER),$(sfpkgname)@web.sourceforge.net
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   184
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   185
.PHONY: deploy2sf-release
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   186
deploy2sf-release: deploy-check $(DIST_TARBALLS)
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   187
	( echo 'cd /home/frs/project/$(shell v=$(sfpkgname); echo $${v:0:1}/$${v:0:2})/$(sfpkgname)'; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   188
echo "put  README.rst"; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   189
echo "chmod 644 README.rst"; \
183
e3293e79262b Fix sftp error: Couldn't create directory: Failure
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 178
diff changeset
   190
echo "-mkdir v$(vmajor).$(vminor)"; \
48
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   191
echo "cd v$(vmajor).$(vminor)"; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   192
for f in $(DIST_TARBALLS); do \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   193
	echo "put $$f"; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   194
	echo "chmod 644 $$f"; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   195
done; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   196
echo 'quit'; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   197
) | sftp -b - $(SF_USER),$(sfpkgname)@frs.sourceforge.net
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   198
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   199
.PHONY: deploy-check
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   200
deploy-check:
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   201
	\
185
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
   202
case "$(FORCE)$(visclean)" in \
48
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   203
  no) echo "Local changes found. Build stop."; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   204
    exit 1;; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   205
esac
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   206
	\
185
59df68b203ca Add option to allow deploy with unclean working state. Add
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 183
diff changeset
   207
case "$(FORCE)$(vatrelease)" in \
48
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   208
  no) echo "We are not at release. Build stop."; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   209
    exit 1;; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   210
esac
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   211
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   212
################################################################
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   213
# Dist targets.
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   214
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   215
.PHONY: dist
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   216
dist: dist-bin
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   217
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   218
.PHONY: dist-bin
49
4b48e9e06000 Fix dist build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
   219
dist-bin: $(DIST_TARBALLS)
48
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   220
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   221
%.tar.gz: %
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   222
	tar zcf $*.tar.gz $*
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   223
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   224
%.tar.bz2: %
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   225
	tar jcf $*.tar.bz2 $*
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   226
49
4b48e9e06000 Fix dist build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
   227
%.zip: %
4b48e9e06000 Fix dist build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
   228
	zip -r $*.zip $*
4b48e9e06000 Fix dist build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
   229
48
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   230
$(DIST_DIR): $(DIST_FILES)
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   231
	rm -rf $@
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   232
	mkdir $@
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   233
	cp $(DIST_FILES) $@
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   234
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   235
################################################################
77
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   236
# Documentation targets.
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   237
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   238
.PHONY: docs
175
9a83576eec4c Deploy to personal home page. Use game itself as index.html.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 84
diff changeset
   239
docs: html
9a83576eec4c Deploy to personal home page. Use game itself as index.html.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 84
diff changeset
   240
9a83576eec4c Deploy to personal home page. Use game itself as index.html.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 84
diff changeset
   241
.PHONY: html
9a83576eec4c Deploy to personal home page. Use game itself as index.html.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 84
diff changeset
   242
html: rst2html
77
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   243
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   244
.PHONY: rst2html
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   245
rst2html: $(RST_HTML_FILES)
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   246
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   247
$(RST_HTML_FILES): $(RST_COMMON_FILES)
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   248
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   249
$(RST_HTML_FILES): %.html: %.rst rst.css header.rst VERSION.rst $(BUILD_SCRIPTS)
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   250
	$(RST2HTML) $(RST2HTML_FLAGS) --stylesheet=rst.css $*.rst $@
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   251
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   252
VERSION.rst: VERSION $(BUILD_SCRIPTS)
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   253
	{ \
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   254
	echo 'For ``$(pkgname)`` version: ``$(vmajor).$(vminor)``.'; \
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   255
	echo; \
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   256
	case ${visclean} in \
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   257
		yes) echo 'Source files are at revision: ``$(vrev)``.';; \
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   258
		no) echo 'Some source files was modified from revision: ``$(vrev)``.';; \
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   259
	esac; \
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   260
	echo; \
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   261
	case ${vatrelease} in \
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   262
		yes) echo 'Package is at release state.';; \
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   263
		no) echo 'Package is far from release state by $(vtagdist) changes.';; \
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   264
	esac; \
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   265
	echo; \
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   266
	echo 'Build date: ``'$$(date +%F)'``.'; \
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   267
	} >$@
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   268
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   269
################################################################
48
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   270
# Helpers targets.
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   271
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   272
.PHONY: help
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   273
help:
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   274
	@\
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   275
echo; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   276
echo Current configuration:; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   277
echo; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   278
sed 's=^=  =' <VERSION
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   279
	@if [ -f Makefile.config ]; then \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   280
		echo; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   281
		echo User configuration:; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   282
		echo; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   283
		sed 's=^=  =' <Makefile.config; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   284
	fi
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   285
	@\
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   286
echo; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   287
echo Supported targets:; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   288
echo; \
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   289
sed -n -e '/^[[:alnum:]_-]*:/{s=^\(.*\):.*=  \1=;p;}' $(BUILD_SCRIPTS)
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   290
57
94e1b2d0bd31 Add JSDoc annotation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   291
.PHONY: jsdoc
94e1b2d0bd31 Add JSDoc annotation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   292
jsdoc:
94e1b2d0bd31 Add JSDoc annotation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   293
	jsdoc -a -p -d=$(JSDOC_DIR) $(JS_FILES)
94e1b2d0bd31 Add JSDoc annotation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   294
48
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   295
################################################################
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   296
# Clean targets.
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   297
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   298
.PHONY: distclean
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   299
distclean: clean
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   300
	rm -f VERSION
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   301
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   302
.PHONY: clean
32b976d3fd10 Release build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   303
clean:
77
c2bad6178c65 Add project docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 57
diff changeset
   304
	rm -rf $(JSDOC_DIR) $(RST_GEN_FILES) $(RST_HTML_FILES) $(DIST_DIR) $(DIST_TARBALLS)
57
94e1b2d0bd31 Add JSDoc annotation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
   305