forked from lua-stdlib/lua-stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocal.mk
182 lines (145 loc) · 4.9 KB
/
local.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# Local Make rules.
#
# Copyright (C) 2013-2015 Gary V. Vaughan
# Written by Gary V. Vaughan, 2013
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
## ------------ ##
## Environment. ##
## ------------ ##
std_path = $(abs_srcdir)/lib/?.lua;$(abs_srcdir)/lib/?/init.lua
LUA_ENV = LUA_PATH="$(std_path);$(LUA_PATH)"
## ---------- ##
## Bootstrap. ##
## ---------- ##
old_NEWS_hash = d41d8cd98f00b204e9800998ecf8427e
update_copyright_env = \
UPDATE_COPYRIGHT_HOLDER='(Gary V. Vaughan|Reuben Thomas)' \
UPDATE_COPYRIGHT_USE_INTERVALS=1 \
UPDATE_COPYRIGHT_FORCE=1
## ------------- ##
## Declarations. ##
## ------------- ##
doccorefunctionsdir = $(docdir)/core_functions
doccorelibrariesdir = $(docdir)/core_libraries
docfunctionaldir = $(docdir)/functional_style
docmodulesdir = $(docdir)/modules
docobjectsdir = $(docdir)/object_system
dist_doc_DATA =
dist_doccorefunctions_DATA =
dist_doccorelibraries_DATA =
dist_docfunctional_DATA =
dist_docmodules_DATA =
dist_docobjects_DATA =
include specs/specs.mk
## ------ ##
## Build. ##
## ------ ##
dist_lua_DATA += \
lib/std.lua \
$(NOTHING_ELSE)
luastddir = $(luadir)/std
dist_luastd_DATA = \
lib/std/base.lua \
lib/std/container.lua \
lib/std/debug.lua \
lib/std/functional.lua \
lib/std/io.lua \
lib/std/list.lua \
lib/std/math.lua \
lib/std/object.lua \
lib/std/operator.lua \
lib/std/optparse.lua \
lib/std/package.lua \
lib/std/set.lua \
lib/std/strbuf.lua \
lib/std/strict.lua \
lib/std/string.lua \
lib/std/table.lua \
lib/std/tree.lua \
lib/std/tuple.lua \
$(NOTHING_ELSE)
# For bugwards compatibility with LuaRocks 2.1, while ensuring that
# `require "std.debug_init"` continues to work, we have to install
# the former `$(luadir)/std/debug_init.lua` to `debug_init/init.lua`.
# When LuaRocks works again, move this file back to dist_luastd_DATA
# above and rename to debug_init.lua.
luastddebugdir = $(luastddir)/debug_init
dist_luastddebug_DATA = \
lib/std/debug_init/init.lua \
$(NOTHING_ELSE)
# In order to avoid regenerating std.lua at configure time, which
# causes the documentation to be rebuilt and hence requires users to
# have ldoc installed, put std/std.lua in as a Makefile dependency.
# (Strictly speaking, distributing an AC_CONFIG_FILE would be wrong.)
lib/std.lua: lib/std.lua.in
./config.status --file=$@
## Use a builtin rockspec build with root at $(srcdir)/lib, and note
## the github repository doesn't have the same name as the rockspec!
mkrockspecs_args = --module-dir $(srcdir)/lib --repository lua-stdlib
## ------------- ##
## Distribution. ##
## ------------- ##
EXTRA_DIST += \
build-aux/config.ld.in \
lib/std.lua.in \
$(NOTHING_ELSE)
## -------------- ##
## Documentation. ##
## -------------- ##
doccorefunctions = $(srcdir)/doc/core_functions/std
doccorelibraries = $(srcdir)/doc/core_libraries/std
docfunctional = $(srcdir)/doc/functional_style/std
docmodules = $(srcdir)/doc/modules/std
docobjects = $(srcdir)/doc/object_system/std
dist_doc_DATA += \
$(srcdir)/doc/index.html \
$(srcdir)/doc/ldoc.css
dist_doccorefunctions_DATA += \
$(doccorefunctions).html \
$(NOTHING_ELSE)
dist_doccorelibraries_DATA += \
$(doccorelibraries).debug.html \
$(doccorelibraries).io.html \
$(doccorelibraries).math.html \
$(doccorelibraries).package.html \
$(doccorelibraries).string.html \
$(doccorelibraries).table.html \
$(NOTHING_ELSE)
dist_docfunctional_DATA += \
$(docfunctional).functional.html \
$(docfunctional).operator.html \
$(NOTHING_ELSE)
dist_docmodules_DATA += \
$(docmodules).optparse.html \
$(docmodules).strict.html \
$(NOTHING_ELSE)
dist_docobjects_DATA += \
$(docobjects).container.html \
$(docobjects).list.html \
$(docobjects).object.html \
$(docobjects).set.html \
$(docobjects).strbuf.html \
$(docobjects).tree.html \
$(docobjects).tuple.html \
$(NOTHING_ELSE)
## Parallel make gets confused when one command ($(LDOC)) produces
## multiple targets (all the html files above), so use the presence
## of the doc directory as a sentinel file.
$(dist_doc_DATA) $(dist_doccorefunctions_DATA): $(srcdir)/doc
$(dist_doccorelibraries_DATA) $(dist_docfunctional_DATA): $(srcdir)/doc
$(dist_docmodules_DATA) $(dist_docobjects_DATA): $(srcdir)/doc
$(srcdir)/doc: $(dist_lua_DATA) $(dist_luastd_DATA)
test -d $@ || mkdir $@
$(LDOC) -c build-aux/config.ld -d $(abs_srcdir)/doc .