-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.in
347 lines (284 loc) · 10.3 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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# Alore Makefile
# Variables set by configure
prefix = $(DESTDIR)@prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
bindir = @bindir@
libdir = @libdir@
incdir = @includedir@
mandir = @mandir@
alorelibdir = @alorelibdir@
aloreincdir = @aloreincdir@
aloredatadir = @aloredatadir@
CC = @CC@
LD = $(CC)
RANLIB = @RANLIB@
STRIP = strip
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
MKDIR_P = @MKDIR_P@
PLATFORM = @PLATFORM@
OPT_MODULES = @OPT_MODULES@
# C compiler and linker options
CFLAGS = @CFLAGS@ -I. @CPPFLAGS@
LD_SHARED = @LD_SHARED@
LDFLAGS = @LDFLAGS@ @LD_EXPORT_FLAGS@ @LIBS@
MOD_LDFLAGS = @MOD_LDFLAGS@ @LIBS@
MOD_CFLAGS = $(CFLAGS) @CC_SHARED_FLAGS@
IMPLIB = @IMPLIB@
RESFILE = @RESFILE@
# Either buildversion or empty (depending on whether we are building from a
# git working copy or not).
VERSIONDEP = @VERSIONDEP@
# @SOEXT@ and @EXEEXT@ are also required.
# End of variables set by configure
ALORELIBS = re string time unittest pack tempfile url cgi http
ALORELIBS += memorystream email __os argparse fileutil
# Core (parser, interpreter, module and symbol table management, etc.)
SRC = src/lex.c src/strtonum.c src/symtable.c src/common.c src/compile.c
SRC += src/error.c src/file.c src/parse.c src/scan.c src/list.c src/cmem.c
SRC += src/ident.c src/display.c src/output.c src/parseexpr.c
SRC += src/opcodesize.c src/class.c src/globals.c src/module.c
SRC += src/dynaload.c src/files.c src/strtables.c src/dynload.c
# Runtime (interpreter, helpers, etc.)
SRC += src/interp.c src/runtime.c src/call.c src/keyint.c src/aloreapi.c
SRC += src/memapi.c src/thread.c src/exception.c
SRC += src/exit.c src/util.c src/errmsg.c src/win32_exception.c
# Garbage collector
SRC += src/gc.c src/heap.c src/heapalloc.c
# Debugging helpers
SRC += src/debug_memory.c src/debug_runtime.c src/displaycode.c
# std module
SRC += src/std_module.c src/std_float.c src/std_str.c src/std_map.c
SRC += src/std_sort.c src/std_str_format.c src/std_array.c src/std_type.c
SRC += src/std_int.c src/std_int_long.c src/std_hashvalue.c src/std_wrappers.c
# Statically linked modules
SRC += src/io_module.c src/io_posix.c src/io_text.c
SRC += src/encodings_module.c src/encodings_tables.c
SRC += src/errno_module.c src/errno_info.c
SRC += src/loader_module.c
SRC += src/thread_module.c src/thread_athread.c src/athread_pthread.c
SRC += src/athread_win32.c
SRC += src/reflect_module.c
SRC += src/re_module.c src/re_comp.c src/re_match.c src/re_disp.c
SRC += src/string_module.c
SRC += src/os_module.c src/os_posix.c src/os_win32.c
SRC += src/set_module.c
SRC += src/random_module.c
SRC += src/math_module.c
SRC += src/time_module.c
SRC += src/bitop_module.c
SRC += src/sys_module.c
SRC += src/pack_module.c
# Dynamically linked modules
MODULE_SRC = src/testc_module.c src/unicode_module.c src/unicode_names.c
MODULE_SRC += src/socket_module.c src/serversocket_module.c src/base64_module.c
MODULE_OBJ = $(MODULE_SRC:.c=.o)
MODULES = lib/__testc@SOEXT@ lib/unicode@SOEXT@ lib/socket@SOEXT@
MODULES += lib/serversocket@SOEXT@ lib/base64@SOEXT@ lib/__dummy@SOEXT@
MODULES += $(OPT_MODULES:%=lib/%@SOEXT@)
MODULE_LIBS = $(MODULES:lib/%@SOEXT@=lib/liba%.a)
API_INC = config.h src/alore.h src/module.h src/value.h src/common.h
API_INC += src/aconfig.h src/thread.h src/globals.h src/runtime.h src/mem.h
API_INC += src/operator.h src/class.h src/lex.h src/array.h src/errmsg.h
API_INC += src/str.h src/cmodules.h
OBJX = $(SRC:.c=.o)
OBJ = $(OBJX:.S=.o)
INTERP_SRC = $(SRC) src/main.c src/cmodules.c src/version.c
INTERP_OBJX = $(INTERP_SRC:.c=.o)
INTERP_OBJ = $(INTERP_OBJX:.S=.o)
COMPILED_SRC = $(SRC) src/stub.c src/version.c
COMPILED_OBJX = $(COMPILED_SRC:.c=.o)
COMPILED_OBJ = $(COMPILED_OBJX:.S=.o)
ALL_SRC = $(SRC) $(MODULE_SRC) src/main.c src/cmodules.c src/version.c
ALL_SRC += src/stub.c
ALOREC_SRC = util/alorec.alo util/compiler/compile.alo util/compiler/util.alo
ALOREC_SRC += util/compiler/platdeps.alo util/compiler/options.alo
.PHONY: all clean distclean test testaddit install buildversion doc
.SUFFIXES: .c .o _dyn.o
all: alore alorec $(MODULES) $(IMPLIB)
alore $(IMPLIB): $(INTERP_OBJ) $(RESFILE)
$(LD) -o $@ $(INTERP_OBJ) $(LDFLAGS) $(RESFILE)
alorec: alore lib/libalorec.a $(ALOREC_SRC) $(MODULE_LIBS) $(MODULES)
./alore util/alorec.alo -L lib util/alorec.alo
mv util/alorec@EXEEXT@ .
lib/libalorec.a: $(COMPILED_OBJ)
ar rc $@ $(COMPILED_OBJ)
$(RANLIB) $@
# Windows resource file (contains the icon)
alore.res: windows/alore.rc windows/alore.ico
windres windows/alore.rc -O coff -o alore.res
test: alore $(MODULES)
test/test.sh
doc: alore $(MODULES)
util/conv.sh
clean:
rm -rf alore alorec alore.exe alorec.exe lib/libalorec.a \
src/*.o $(MODULES) build.h lib/*.inf $(MODULE_LIBS) test/TEMP \
test/TMP test/TMPDIR libalore.a
distclean: clean
rm -f config.h config.log config.status config.h configure.lineno
rm -rf autom4te.cache
rm -f Makefile core
rm -f doc/html/*.html doc/html/*.css
rm -f release/alore-*.gz release/alore-*.zip
rm -f windows/installer/Alore-*.exe
find . '(' -name "*~" \
-o -name "#*#" \
-o -name "svn-commit*.tmp" ')' -exec rm -f {} ';'
install: alore alorec
for dir in $(bindir) $(libdir) $(alorelibdir) $(incdir) \
$(aloreincdir); do \
if [ ! -d $$dir ]; then \
$(MKDIR_P) $$dir; \
fi; \
done
for lib in $(ALORELIBS); do \
$(MKDIR_P) $(alorelibdir)/$$lib; \
$(INSTALL_DATA) lib/$$lib/*.alo $(alorelibdir)/$$lib; \
done
for lib in $(MODULES); do \
$(INSTALL_DATA) $$lib $(alorelibdir); \
done
for lib in $(MODULE_LIBS); do \
$(INSTALL_DATA) $$lib $(alorelibdir); \
done
for inf in $(MODULE_LIBS:.a=.inf); do \
if [ -f $$inf ]; then \
$(INSTALL_DATA) $$inf $(alorelibdir); \
fi; \
done
$(INSTALL_DATA) $(API_INC) $(aloreincdir)
$(INSTALL_PROGRAM) alore@EXEEXT@ $(bindir)
$(INSTALL_PROGRAM) alorec@EXEEXT@ $(bindir)
$(INSTALL_DATA) lib/libalorec.a $(libdir)
if test ${PLATFORM} == windows; then \
${INSTALL_DATA} ${IMPLIB} ${libdir}; \
fi
$(MKDIR_P) "$(aloredatadir)/check"
$(INSTALL_DATA) check/check.alo "$(aloredatadir)/check"
@echo "Copy checker modules:"
@for modp in check/*; do \
mod=`basename $$modp`; \
if [ -d $$modp ] && [ $$mod != testchk ] && [ $$mod != tmp ]; then \
echo " $$modp -> $(aloredatadir)/$$modp"; \
$(MKDIR_P) "$(aloredatadir)/$$modp"; \
$(INSTALL_DATA) $$modp/*.alo "$(aloredatadir)/$$modp"; \
fi; \
done
@echo "Copy library stubs:"
@for modp in stubs/*; do \
echo " $$modp -> $(aloredatadir)/$$modp"; \
$(MKDIR_P) "$(aloredatadir)/$$modp"; \
$(INSTALL_DATA) $$modp/*.alo "$(aloredatadir)/$$modp"; \
done
if test $(PLATFORM) != windows; then \
if [ ! -d $(mandir) ]; then $(MKDIR_P) $(mandir); fi; \
if [ ! -d $(mandir)/man1 ]; then $(MKDIR_P) $(mandir)/man1; fi; \
$(INSTALL_DATA) doc/alore.man $(mandir)/man1/alore.1; \
$(INSTALL_DATA) doc/alorec.man $(mandir)/man1/alorec.1; \
fi
# Install files and strip binaries.
install-strip: install
$(STRIP) $(bindir)/alore@EXEEXT@
$(STRIP) $(bindir)/alorec@EXEEXT@
for lib in $(MODULES); do \
$(STRIP) $(alorelibdir)/`basename $$lib`; \
done
# Update dependencies in Makefile.depend. Run this every time dependicies
# change. This is not run automatically!
#
# NOTE: gcc is required for this target, but since Makefile.depend is normally
# included in the distribution, gcc is not needed for building.
depend:
echo '# DO NOT EDIT -- generated automatically by "make depend"' > \
Makefile.depend
for f in $(ALL_SRC); \
do \
gcc -MM -MG -I. $$f | \
sed -e "s/^\(.*\)\.o:/`dirname $$f`\/\1.o:/" >> \
Makefile.depend; \
done
for f in $(MODULE_SRC); \
do \
gcc -MM -MG -I. $$f | \
sed -e "s/^\(.*\)\.o:/`dirname $$f`\/\1_dyn.o:/" >> \
Makefile.depend; \
done
# Run tidy for all the generated documentation files. Some spurious warnings
# are ignored manually using grep.
# Note that tidy may not properly check HTML validity.
checkhtml: doc
@for f in doc/html/*.html; do \
tidy -q -e "$$f" 2>&1 | sed 's/line/ line/g' | \
egrep -v 'anchor "(en|de)code"' > tidy.tmp; \
if test "`cat tidy.tmp`x" != x; then \
echo "$$f":; \
cat tidy.tmp; \
fi; \
done
@rm tidy.tmp
# Run linkchecker to check the links in the generated documentation files.
# Note that linkchecker may not properly check anchors and some other issues.
checklinks: doc
linkchecker -a --no-status doc/html/index.html
# Always update build.h if building from a git working copy.
build.h: $(VERSIONDEP)
@if [ -d .git ]; \
then \
printf '#define A_BUILD "'`git describe`'"\n' > build.tmp; \
else \
echo '#define A_BUILD "exported"' > build.tmp; \
fi
@if [ ! -f build.h ]; \
then \
cp build.tmp build.h; \
echo "build.h created"; \
fi
@if [ `(cmp -s build.tmp build.h; echo $$?;)` != 0 ]; \
then \
cp build.tmp build.h; \
echo "build.h updated"; \
fi
@rm build.tmp
# Dummy rule.
buildversion:
lib/__testc@SOEXT@: src/testc_module_dyn.o $(IMPLIB)
$(LD_SHARED) -o $@ src/testc_module_dyn.o $(IMPLIB) $(MOD_LDFLAGS)
lib/liba__testc.a: src/testc_module.o
ar rc $@ src/testc_module.o
$(RANLIB) $@
lib/unicode@SOEXT@: src/unicode_module_dyn.o src/unicode_names_dyn.o $(IMPLIB)
$(LD_SHARED) -o $@ src/unicode_module_dyn.o src/unicode_names_dyn.o \
$(IMPLIB) $(MOD_LDFLAGS)
lib/libaunicode.a: src/unicode_module.o src/unicode_names.o
ar rc $@ src/unicode_module.o src/unicode_names.o
$(RANLIB) $@
lib/socket@SOEXT@: src/socket_module_dyn.o $(IMPLIB)
$(LD_SHARED) -o $@ src/socket_module_dyn.o $(IMPLIB) \
$(MOD_LDFLAGS)
lib/libasocket.a: src/socket_module.o
ar rc $@ src/socket_module.o
$(RANLIB) $@
lib/serversocket@SOEXT@: src/serversocket_module_dyn.o $(IMPLIB)
$(LD_SHARED) -o $@ src/serversocket_module_dyn.o $(IMPLIB) \
$(MOD_LDFLAGS)
lib/libaserversocket.a: src/serversocket_module.o
ar rc $@ src/serversocket_module.o
$(RANLIB) $@
lib/base64@SOEXT@: src/base64_module_dyn.o $(IMPLIB)
$(LD_SHARED) -o $@ src/base64_module_dyn.o $(IMPLIB) $(MOD_LDFLAGS)
lib/libabase64.a: src/base64_module.o
ar rc $@ src/base64_module.o
$(RANLIB) $@
lib/__dummy@SOEXT@: src/dummy_module_dyn.o $(IMPLIB)
$(LD_SHARED) -o $@ src/dummy_module_dyn.o $(IMPLIB) $(MOD_LDFLAGS)
lib/liba__dummy.a: src/dummy_module.o
ar rc $@ src/dummy_module.o
$(RANLIB) $@
.c_dyn.o:
$(CC) $(MOD_CFLAGS) -c $< -o $@
.c.o:
$(CC) $(CFLAGS) -o $@ -c $<
include Makefile.depend