-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile.in
270 lines (224 loc) · 8.98 KB
/
Makefile.in
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
#* Generated file, don't edit
#*=====================================================================*/
#* serrano/prgm/project/hiphop/hiphop/Makefile.in */
#* ------------------------------------------------------------- */
#* Author : Manuel Serrano */
#* Creation : Fri Jan 20 14:35:57 2006 */
#* Last change : Fri Jul 5 11:49:21 2024 (serrano) */
#* Copyright : 2006-24 Manuel Serrano */
#* ------------------------------------------------------------- */
#* Generic Makefile to build Hop weblets. */
#*=====================================================================*/
## run "make" to build the .hz file
#*---------------------------------------------------------------------*/
#* Weblet description */
#*---------------------------------------------------------------------*/
HZ=@HZ@
HZVERSION=@VERSION@
DATE="@DATE@"
CATEGORY=programming
LICENSE=@LICENSE@
LIBDIR=@LIBDIR@
HOPREPOSITORY=@HOPREPOSITORY@
HOPLIBDIR=@HOPLIBDIR@
HOPVERSION=@HOPVERSION@
HOPBUILDTAG=@HOPBUILDTAG@
HOPBUILDARCH=@HOPBUILDARCH@
HOPSODIR=@SODIR@
HOPSHAREDIR=@HOPSHAREDIR@
HIPHOPBUILDID=@HIPHOPBUILDID@
HIPHOPLIBDIR=$(LIBDIR)/$(HZ)/$(HZVERSION)
HIPHOPNPMDIR=hiphop-$(HZVERSION)-$(HIPHOPBUILDID)
HOP=@HOP@
HOPJS=@HOPJS@
HOPC=@HOPC@
HFLAGS=@HFLAGS@
HHC=bin/hhc.sh --js-require-hop
LIB=ast.js batch.js compiler.js compiler-utils.js debugger-common.js \
debugger.js debugger-server.js debug.js error.js hiphop.js lang.js \
machine.js net.js queue.js signal.js sweep.js causality.js
LIBMJS=hiphop-loader.mjs
PREPROCESSOR=astutils.js parser.js hhaccess.js
ULIB=parallelmap.js
MODULES=interval.hh.js http.hh.js promise.hh.js timeout.hh.js
SOFILES=$(LIB:%.js=lib/$(HOPSODIR)/%.@SO@) \
$(LIBMJS:%.mjs=lib/$(HOPSODIR)/%.@SO@) \
$(PREPROCESSOR:%.js=preprocessor/$(HOPSODIR)/%.@SO@) \
$(MODULES:%.hh.js=modules/._%.js) \
$(MODULES:%.hh.js=modules/$(HOPSODIR)/%.@SO@)
SODIR=@SODIR@
JSDIR=$(LIBDIR)/$(HZVERSION)
MODFILE=a+r
MODEXE=a+rx
MODDIR=a+rx
#*---------------------------------------------------------------------*/
#* do */
#*---------------------------------------------------------------------*/
.PHONY: do so
do: lib/$(HOPSODIR) preprocessor/$(HOPSODIR) modules/$(HOPSODIR)
$(MAKE) so
so: $(SOFILES) lib/$(HOPSODIR)/config.@SO@ ChangeLog
@ echo "Compilation complete."
#*---------------------------------------------------------------------*/
#* npm */
#*---------------------------------------------------------------------*/
.PHONY: npm
npm-hiphop:
mkdir -p npm/$(HIPHOPNPMDIR)
mkdir -p npm/$(HIPHOPNPMDIR)/lib
mkdir -p npm/$(HIPHOPNPMDIR)/bin
mkdir -p npm/$(HIPHOPNPMDIR)/etc
mkdir -p npm/$(HIPHOPNPMDIR)/modules
cp package.json npm/$(HIPHOPNPMDIR)
cp -r lib npm/$(HIPHOPNPMDIR)
mv npm/$(HIPHOPNPMDIR)/lib/hiphop-client.mjs npm/$(HIPHOPNPMDIR)
cp -r preprocessor npm/$(HIPHOPNPMDIR)
cp -r modules/*.js npm/$(HIPHOPNPMDIR)/modules
cp -r modules/*.d.ts npm/$(HIPHOPNPMDIR)/modules
cp -r test npm/$(HIPHOPNPMDIR)
cp -r etc/configure.js npm/$(HIPHOPNPMDIR)/etc
cp -r etc/buildmodules.js npm/$(HIPHOPNPMDIR)/etc
echo "#!/usr/bin/env node" > npm/$(HIPHOPNPMDIR)/bin/hhc.mjs
echo "import * as hhc from \"../lib/hhc.js\"" >> npm/$(HIPHOPNPMDIR)/bin/hhc.mjs
chmod a+rx npm/$(HIPHOPNPMDIR)/bin/hhc.mjs
cp tools/nets2dot.mjs npm/$(HIPHOPNPMDIR)/bin/nets2dot.mjs
chmod a+rx npm/$(HIPHOPNPMDIR)/bin/nets2dot.mjs
(cd npm/$(HIPHOPNPMDIR); $(HOPJS) -g etc/configure.js package.json lib/config.js.in lib/config.js && $(HOPJS) -g etc/buildmodules.js)
(cd npm; tar --exclude="*.so" -zcf $(HIPHOPNPMDIR).tgz $(HIPHOPNPMDIR))
npm-hiphop-tutorial-async:
mkdir -p npm
cp -r tutorials/hiphop-tutorial-async npm/hiphop-tutorial-async-$(HZVERSION)-$(HIPHOPBUILDID)
(cd npm; tar --exclude="*.so" -zcf hiphop-tutorial-async-$(HZVERSION)-$(HIPHOPBUILDID).tgz hiphop-tutorial-async-$(HZVERSION)-$(HIPHOPBUILDID))
npm-sans-rm: npm-hiphop npm-hiphop-tutorial-async
npm: npm-sans-rm
(cd npm; rm -rf $(HIPHOPNPMDIR))
#*---------------------------------------------------------------------*/
#* .suffixes */
#*---------------------------------------------------------------------*/
.SUFFIXES:
.SUFFIXES: .js .mjs .hop .hh.js .@SO@
#*---------------------------------------------------------------------*/
#* The implicit rules */
#*---------------------------------------------------------------------*/
lib/$(HOPSODIR)/%.@SO@: lib/%.js
$(HOPC) $(HFLAGS) -y -o $@ $<
lib/$(HOPSODIR)/%.@SO@: lib/%.mjs
$(HOPC) $(HFLAGS) -y -o $@ $<
preprocessor/$(HOPSODIR)/%.@SO@: preprocessor/%.js
$(HOPC) $(HFLAGS) -y -o $@ $<
modules/._%.js: modules/%.hh.js modules/node_modules/@hop/hiphop
$(HOPJS) -g lib/hhc.js -o $@ $<
modules/$(HOPSODIR)/%.@SO@: modules/._%.js
$(HOPC) $(HFLAGS) -y -o $@ $<
$(MODULES:%.js=modules/%.@SO@): modules/node_modules/@hop/hiphop \
$(LIB:%.js=lib/%.@SO@)
modules/node_modules/@hop/hiphop: modules/node_modules/@hop
(hiphop=`basename $$PWD`; cd modules/node_modules/@hop; rm -f hiphop; ln -s ../../../../$$hiphop hiphop)
modules/node_modules/@hop: modules/node_modules
mkdir -p $@
modules/node_modules: modules
mkdir -p $@
modules:
mkdir -p $@
lib/$(HOPSODIR):
mkdir -p $@
preprocessor/$(HOPSODIR):
mkdir -p $@
modules/$(HOPSODIR):
mkdir -p $@
#*---------------------------------------------------------------------*/
#* install */
#*---------------------------------------------------------------------*/
.PHONY: install
install:
mkdir -p $(DESTDIR)$(HIPHOPLIBDIR)
# lib
cp -r lib $(DESTDIR)$(HIPHOPLIBDIR)
chmod $(MODDIR) $(DESTDIR)$(HIPHOPLIBDIR)/lib
chmod $(MODFILE) $(DESTDIR)$(HIPHOPLIBDIR)/lib/*.js
chmod $(MODFILE) $(DESTDIR)$(HIPHOPLIBDIR)/lib/*.mjs
chmod -R $(MODDIR) $(DESTDIR)$(HIPHOPLIBDIR)/lib/so
chmod $(MODEXE) $(DESTDIR)$(HIPHOPLIBDIR)/lib/$(HOPSODIR)/*.so
# preprocessor
cp -r preprocessor $(DESTDIR)$(HIPHOPLIBDIR)
chmod $(MODDIR) $(DESTDIR)$(HIPHOPLIBDIR)/preprocessor
chmod $(MODFILE) $(DESTDIR)$(HIPHOPLIBDIR)/preprocessor/*.js
chmod -R $(MODDIR) $(DESTDIR)$(HIPHOPLIBDIR)/preprocessor/so
chmod $(MODEXE) $(DESTDIR)$(HIPHOPLIBDIR)/preprocessor/$(HOPSODIR)/*.so
# modules
cp -r modules $(DESTDIR)$(HIPHOPLIBDIR)
chmod $(MODDIR) $(DESTDIR)$(HIPHOPLIBDIR)/modules
chmod $(MODFILE) $(DESTDIR)$(HIPHOPLIBDIR)/modules/*.js
chmod -R $(MODDIR) $(DESTDIR)$(HIPHOPLIBDIR)/modules/so
chmod $(MODEXE) $(DESTDIR)$(HIPHOPLIBDIR)/modules/$(HOPSODIR)/*.so
# test
cp -r test $(DESTDIR)$(HIPHOPLIBDIR)
chmod $(MODDIR) $(DESTDIR)$(HIPHOPLIBDIR)/test
# package.json
cp package.json $(DESTDIR)$(HIPHOPLIBDIR)
chmod $(MODFILE) $(DESTDIR)$(HIPHOPLIBDIR)/package.json
# link hiphop into the hop directory
cd $(DESTDIR)$(HOPLIBDIR)/hop/$(HOPVERSION)/node_modules/@hop; \
rm -f hiphop; \
ln -s $(DESTDIR)$(HIPHOPLIBDIR) hiphop
uninstall:
rm -rf $(DESTDIR)$(HIPHOPLIBDIR)
#*---------------------------------------------------------------------*/
#* clean */
#*---------------------------------------------------------------------*/
clean-npm:
rm -rf npm
clean:
rm -rf lib/so
rm -rf modules/so
rm -rf preprocessor/so
cleanall: clean
rm -f config.status
rm -f lib/config.js
rm -rf arch/debian/debian
rm -rf modules/node_modules/@hop/hiphop
rm -rf node_modules
rm -f package-lock.json
distclean: cleanall
#*---------------------------------------------------------------------*/
#* hz */
#*---------------------------------------------------------------------*/
.PHONY: distrib tgz hz $(HOPREPOSITORY)/$(HZ)-$(HZVERSION).tar.gz
distrib: hz
hz: tgz
tgz: $(HOPREPOSITORY)/$(HZ)-$(HZVERSION).tar.gz
$(HOPREPOSITORY)/$(HZ)-$(HZVERSION).tar.gz: \
package.json \
package-lock.json \
modules \
configure \
Makefile.in Makefile \
lib/config.js.in \
lib/hiphop.d.ts \
$(FILES) \
LICENSE \
arch \
docker \
etc \
doc \
.travis.yml.in \
test \
examples \
tutorials \
ChangeLog
mkdir -p $(HOPREPOSITORY) && \
(cd ..; \
cp -r $(HZ) $(HZ)-$(HZVERSION); \
tar cfz $@ \
--exclude='$(HZ)/private' \
--exclude=.gitignore \
--exclude=.git \
--exclude=so \
--exclude=arch/debian/build.$(HZ) \
--exclude='*~' $(^:%=$(HZ)-$(HZVERSION)/%); \
rm -rf $(HZ)-$(HZVERSION))
#*---------------------------------------------------------------------*/
#* ChangeLog */
#*---------------------------------------------------------------------*/
ChangeLog:
git log --pretty=format:"hiphop ($(HZVERSION)-1) unstable; urgency=low%n%n * %s%n%n -- %an <%ae> %cD%n" > ChangeLog