-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile.in
375 lines (321 loc) · 12.9 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
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
#
# @configure_input@
#
#========================================================================
# All these assignments are substituted by configure
#========================================================================
PKG_SOURCES = @PKG_SOURCES@
PKG_OBJECTS = @PKG_OBJECTS@
PKG_STUB_SOURCES = @PKG_STUB_SOURCES@
PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@
PKG_TEST_SOURCES = @PKG_TEST_SOURCES@
PKG_TEST_OBJECTS = @PKG_TEST_OBJECTS@
PKG_TCL_SOURCES = @PKG_TCL_SOURCES@
PKG_HEADERS = @PKG_HEADERS@
PKG_PRIVATE_HEADERS=@PKG_PRIVATE_HEADERS@
PKG_LIB_FILE = @PKG_LIB_FILE@
PKG_TEST_LIB_FILE = @PKG_TEST_LIB_FILE@
PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@
SHELL = @SHELL@
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
datarootdir = @datarootdir@
datadir = @datadir@
mandir = @mandir@
DESTDIR =
INSTALL_OPTIONS =
INSTALL = $(SHELL) $(srcdir)/tclconfig/install-sh -c ${INSTALL_OPTIONS}
INSTALL_DATA_DIR = ${INSTALL} -d -m 755
INSTALL_PROGRAM = ${INSTALL} -m 555
INSTALL_DATA = ${INSTALL} -m 444
INSTALL_SCRIPT = ${INSTALL_PROGRAM}
INSTALL_LIBRARY = ${INSTALL_DATA}
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
CC = @CC@
CFLAGS_DEFAULT = @CFLAGS_DEFAULT@
CFLAGS_WARNING = @CFLAGS_WARNING@
CLEANFILES=@CLEANFILES@
EXEEXT=@EXEEXT@
LDFLAGS_DEFAULT=@LDFLAGS_DEFAULT@
MAKE_LIB=@MAKE_LIB@
MAKE_SHARED_LIB=@MAKE_SHARED_LIB@
MAKE_STATIC_LIB=@MAKE_STATIC_LIB@
MAKE_STUB_LIB=@MAKE_STUB_LIB@
MAKE_TEST_LIB=@MAKE_TEST_LIB@
OBJEXT=@OBJEXT@
RANLIB=@RANLIB@
RANLIB_STUB=@RANLIB_STUB@
SHLIB_CFLAGS=@SHLIB_CFLAGS@
SHLIB_LD=@SHLIB_LD@
SHLIB_LD_LIBS=@SHLIB_LD_LIBS@
STLIB_LD=@STLIB_LD@
TCL_SRC_DIR=@TCL_SRC_DIR@
TCL_BIN_DIR=@TCL_BIN_DIR@
# Not actually used, but can help when tracing errors
#TCL_LIBS=@TCL_LIBS@
#MT=@MT@
TCLSH_PROG=@TCLSH_PROG@
INCLUDES=@PKG_INCLUDES@ @TCL_INCLUDES@
PKG_CFLAGS=@PKG_CFLAGS@
DEFS=@DEFS@ $(PKG_CFLAGS)
CPPFLAGS=@CPPFLAGS@
LIBS=@PKG_LIBS@ @LIBS@ @MATH_LIBS@
PKG_TEST_LIBS=${PKG_STUB_LIB_FILE}
AR=@AR@
CFLAGS=@CFLAGS@
CYGPATH=@CYGPATH@
SDX=@SDX@
#RC=@RC@
#RCFLAGS=@RES_DEFS@
#RES=@RES_SUFFIX@
#ADD_MANIFEST=@ADD_MANIFEST@
EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR)
PKG_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \
@LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \
PATH="$(EXTRA_PATH):$(PATH)" \
TCLLIBPATH="$(top_builddir)"
TCLSH_PROG = @TCLSH_PROG@
TCLSH = $(PKG_ENV) $(TCLSH_PROG)
#========================================================================
# None of these assignments are substituted by configure
#========================================================================
SRC_DIR=$(srcdir)
BINARIES=$(PKG_LIB_FILE) $(PKG_STUB_LIB_FILE) $(PKG_TEST_LIB_FILE)
PKG_DIR=$(PACKAGE_NAME)$(PACKAGE_VERSION)
PKG_KIT_ROOT=$(PKG_DIR)-$(PLATFORM)
PKG_KIT=$(PKG_KIT_ROOT).kit
pkglibdir=$(libdir)/$(PKG_DIR)
top_builddir=.
TCL_VERSION_REQ=8.5b1
GDB=gdb
VALGRIND=valgrind
CONFIG_CLEAN_FILES="Makefile tclooConfig.sh"
COMPILE=$(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
VPATH=$(SRC_DIR)/generic:$(SRC_DIR)/unix:$(SRC_DIR)/win:$(SRC_DIR)/macosx:$(SRC_DIR)
TESTFLAGS=
KIT_PKG_ROOT=$(PKG_KIT_ROOT).vfs/lib/$(PACKAGE_NAME)
ITERATIONS=1000
TCL_TOOLS_DIR=$(TCL_SRC_DIR)/tools
#========================================================================
# This is something that is found by executing a Tcl script
#========================================================================
PLATFORM:=$(shell echo 'package require platform;puts [platform::generic]' | $(TCLSH))
#========================================================================
# Master rules
#========================================================================
all: package libraries
package: $(PKG_LIB_FILE) pkgIndex.tcl
testpackage: $(PKG_TEST_LIB_FILE)
libraries: $(PKG_STUB_LIB_FILE)
install: all install-package install-libraries install-headers install-doc
kit: sdx_valid $(PKG_KIT)
#========================================================================
# Basic installation rules
#========================================================================
install-package: package
@mkdir -p $(DESTDIR)$(pkglibdir)
$(INSTALL_PROGRAM) $(PKG_LIB_FILE) $(DESTDIR)$(pkglibdir)/$(PKG_LIB_FILE)
$(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir)/pkgIndex.tcl
$(INSTALL_DATA) tclooConfig.sh $(DESTDIR)$(pkglibdir)/tclooConfig.sh
# for p in $(SRC_DIR)/library/*.tcl ; do \
# destp=`basename $$p`; \
# echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \
# $(INSTALL_DATA) $$p $(DESTDIR)$(pkglibdir)/$$destp; \
# done
install-headers:
@echo "Installing header files in $(DESTDIR)$(includedir)"
@mkdir -p $(DESTDIR)$(includedir)
@list='$(PKG_HEADERS)'; for p in $$list; do \
echo "Installing $(SRC_DIR)/$$p" ; \
destp=`basename $$p`; \
$(INSTALL_DATA) $(SRC_DIR)/$$p $(DESTDIR)$(includedir)/$$destp ; \
done;
install-private-headers:
@echo "Installing private header files in $(DESTDIR)$(includedir)"
@mkdir -p $(DESTDIR)$(includedir)
@list='$(PKG_PRIVATE_HEADERS)'; for p in $$list; do \
echo "Installing $(SRC_DIR)/$$p" ; \
destp=`basename $$p`; \
$(INSTALL_DATA) $(SRC_DIR)/$$p $(DESTDIR)$(includedir)/$$destp ; \
done;
install-libraries: libraries
@echo "Installing $(PKG_STUB_LIB_FILE) in $(DESTDIR)$(pkglibdir)"
@mkdir -p $(DESTDIR)$(pkglibdir)
$(INSTALL_DATA) $(PKG_STUB_LIB_FILE) $(DESTDIR)$(pkglibdir)
#========================================================================
# Install documentation. Unix manpages should go in the $(mandir) directory.
#========================================================================
install-doc: doc
@echo "Installing documentation in $(DESTDIR)$(mandir)"
@mkdir -p $(DESTDIR)$(mandir)/mann
@list='$(SRC_DIR)/doc/*.n'; for i in $$list; do \
echo "Installing $$i"; \
rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \
$(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \
done
@mkdir -p $(DESTDIR)$(mandir)/man3
@list='$(SRC_DIR)/doc/*.3'; for i in $$list; do \
echo "Installing $$i"; \
rm -f $(DESTDIR)$(mandir)/man3/`basename $$i`; \
$(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/man3 ; \
done
# A do-nothing target at the moment
doc:
#========================================================================
# Run the test suite or benchmarks for the package, or just start a shell
# primed to load the package.
#========================================================================
test: package testpackage libraries
@echo $(TCLSH_PROG) $(SRC_DIR)/tests/all.tcl $(TESTLOAD) $(TESTFLAGS)
@$(TCLSH) `$(CYGPATH) $(SRC_DIR)/tests/all.tcl` $(TESTLOAD) $(TESTFLAGS)
benchmarks: package libraries
@echo Benchmark Iterations = $(ITERATIONS)
@list='$(SRC_DIR)/benchmarks/*.tcl'; for i in $$list; do \
echo "Benchmarking $$i"; \
time $(TCLSH) `$(CYGPATH) $$i` $(ITERATIONS); \
done
shell: package libraries
@echo $(TCLSH_PROG) $(SCRIPT)
@$(TCLSH) $(SCRIPT)
valgrind: package libraries
@echo $(VALGRIND) $(TCLSH_PROG) $(SCRIPT)
@$(PKG_ENV) $(VALGRIND) $(TCLSH_PROG) $(SCRIPT)
valgrindtest: package libraries
@echo $(VALGRIND) $(TCLSH_PROG) $(SRC_DIR)/tests/all.tcl $(TESTLOAD) $(TESTFLAGS)
@$(PKG_ENV) $(VALGRIND) $(TCLSH_PROG) `$(CYGPATH) $(SRC_DIR)/tests/all.tcl` $(TESTLOAD) $(TESTFLAGS) -singleproc 1
valgrindshell: binaries libraries
$(PKG_ENV) valgrind $(VALGRINDARGS) $(TCLSH_PROG) $(SCRIPT)
#========================================================================
# These rules say how to run tclsh in a hostile Windows environment, while
# still working on Unix.
#========================================================================
gdb.run:
@echo "catch {puts \"target exec [file attributes [file normalize [info nameofexecutable]] -shortname]\";exit};puts \"target exec [file normalize [info nameofexecutable]]\"" | $(TCLSH) > $@
@echo "set env TCL_LIBRARY=$(TCL_SRC_DIR)/library" >> $@
@echo "set env LD_LIBRARY_PATH=$(EXTRA_PATH):$(LD_LIBRARY_PATH)" >> $@
@echo "set env TCLLIBPATH=$(top_builddir)" >> $@
@sh -c 'test x$${OSTYPE} = xmsys && echo "set new-console off" >> $@' || true
gdb: package libraries gdb.run
@echo gdb $(TCLSH_PROG) $(ARGS)
@gdb --command=gdb.run $(ARGS)
@rm gdb.run
gdbtest: package libraries gdb.run
@echo "set args `$(CYGPATH) $(SRC_DIR)/tests/all.tcl` $(TESTLOAD) $(TESTFLAGS) -singleproc 1" >>gdb.run
@echo gdb $(TCLSH_PROG) $(MANGLED)
@gdb --command=gdb.run
@rm gdb.run
#========================================================================
# The rules for actually doing the build of the package.
#========================================================================
$(PKG_LIB_FILE): $(PKG_OBJECTS)
-rm -f $(PKG_LIB_FILE)
${MAKE_LIB}
$(RANLIB) $(PKG_LIB_FILE)
$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS)
-rm -f $(PKG_STUB_LIB_FILE)
${MAKE_STUB_LIB}
$(RANLIB_STUB) $(PKG_STUB_LIB_FILE)
$(PKG_TEST_LIB_FILE): $(PKG_STUB_LIB_FILE)
$(MAKE) PKG_TEST_LIB_FILE=dummy PKG_LIB_FILE=$(PKG_TEST_LIB_FILE) \
PKG_OBJECTS="$(PKG_TEST_OBJECTS)" \
LIBS="$(PKG_TEST_LIBS)" \
CFLAGS="${SHLIB_CFLAGS} -DUSE_TCL_STUBS -DUSE_TCLOO_STUBS" \
$(PKG_TEST_LIB_FILE)
.c.@OBJEXT@:
$(COMPILE) -c `$(CYGPATH) $<` -o $@
.rc.$(RES):
$(RC) $@ $(RCFLAGS) "$<"
pkgIndex.tcl: Makefile
-@echo Creating pkgIndex.tcl
@( \
echo 'if {[catch {package require Tcl $(TCL_VERSION_REQ)}]} return'; \
echo 'package ifneeded $(PACKAGE_NAME) $(PACKAGE_VERSION) \
[list load [file join $$dir $(PKG_LIB_FILE)] $(PACKAGE_NAME)]' \
) > pkgIndex.tcl
Makefile: $(SRC_DIR)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
#========================================================================
# How to rebuild the package's stub table.
#========================================================================
genstubs: $(TCL_TOOLS_DIR)/genStubs.tcl $(SRC_DIR)/generic/tclOO.decls
@echo $(TCLSH_PROG) $(TCL_TOOLS_DIR)/genStubs.tcl $(SRC_DIR)/generic $(SRC_DIR)/generic/tclOO.decls
@$(TCLSH) `$(CYGPATH) $(TCL_TOOLS_DIR)/genStubs.tcl` `$(CYGPATH) $(SRC_DIR)/generic` `$(CYGPATH) $(SRC_DIR)/generic/tclOO.decls`
#========================================================================
# Build a starkit - this is experimental!
#========================================================================
sdx_valid:
@test "$(SDX)" != "none" || ( echo "Cannot build kit; no sdx!"; false )
$(PKG_KIT): $(PKG_LIB_FILE)
-@mkdir -p $(KIT_PKG_ROOT)/$(PLATFORM)
cp $(PKG_LIB_FILE) $(KIT_PKG_ROOT)/$(PLATFORM)
-@echo Creating $(KIT_PKG_ROOT)/pkgIndex.tcl
@( \
echo 'if {[catch {package require Tcl $(TCL_VERSION_REQ)}]} return'; \
echo 'package ifneeded $(PACKAGE_NAME) $(PACKAGE_VERSION)' \
'[list load [file join $$dir $(PLATFORM) $(PKG_LIB_FILE)] $(PACKAGE_NAME)]' \
) > $(KIT_PKG_ROOT)/pkgIndex.tcl
$(SDX) wrap $(PKG_KIT)
-@rm -rf $(PKG_KIT_ROOT).vfs $(PKG_KIT_ROOT).bat
#========================================================================
# How to clean up after a build.
#========================================================================
clean:
-test -z "$(BINARIES)" || rm -f $(BINARIES)
-rm -f *.$(OBJEXT) core *.core
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean: clean
-rm -f *.tab.c
-rm -f $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log config.status
#========================================================================
# Distribution creation (FROM sampleextension)
# You may need to tweak this target to make it work correctly.
#========================================================================
#COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar
COMPRESS = tar zcvf $(PKG_DIR).tar.gz $(PKG_DIR)
DIST_ROOT = /tmp/dist
DIST_DIR = $(DIST_ROOT)/$(PKG_DIR)
dist-clean:
rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.*
dist: dist-clean
mkdir -p $(DIST_DIR)
cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/license* \
$(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \
$(DIST_DIR)/
chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4
chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in
for i in $(srcdir)/*.[ch]; do \
if [ -f $$i ]; then \
cp -p $$i $(DIST_DIR)/ ; \
fi; \
done;
mkdir $(DIST_DIR)/tclconfig
cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \
$(DIST_DIR)/tclconfig/
chmod 664 $(DIST_DIR)/tclconfig/tcl.m4
chmod +x $(DIST_DIR)/tclconfig/install-sh
list='demos generic library mac tests unix win'; \
for p in $$list; do \
if test -d $(srcdir)/$$p ; then \
mkdir $(DIST_DIR)/$$p; \
cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \
fi; \
done
mkdir $(DIST_DIR)/doc
for p in $(srcdir)/doc/*.?; do \
soelim -I $(srcdir)/doc $$p >$(DIST_DIR)/doc/`basename $$p`; \
done
(cd $(DIST_ROOT); $(COMPRESS);)
#========================================================================
# Magic declarations to make.
#========================================================================
.SUFFIXES: .c .$(OBJEXT) .rc .$(RES)
.PHONY: all package clean depend distclean doc install libraries test kit
.PHONY: sdx_valid doc dist dist-clean benchmarks shell genstubs gdb gdbtest
.PHONY: valgrind valgrindtest testpackage