blob: 29c226b60417baf3cf580252626e72da7868874a (
plain)
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
|
@if NO_SILENT_RULES
Q :=
ECHO := @:
@else
# make V=1 for verbose make output
Q := @
ECHO := @echo
ifeq ($(V),1)
ifeq ("$(origin V)", "command line")
Q :=
ECHO := @:
endif
endif
@endif
# Tools
CC = @CCACHE@ @CC@
CXX = @CCACHE@ @CXX@
RANLIB = @RANLIB@
AR = @AR@
STRIP = @STRIP@
@if COVERAGE
export CCACHE_DISABLE := 1
@endif
# Configuration
SH_CFLAGS ?= @SH_CFLAGS@
SH_LDFLAGS ?= @SH_LDFLAGS@
@if SH_SOPREFIX
@if SH_SOFULLPATH
SH_LDFLAGS += @SH_SOPREFIX@$(DESTDIR)@libdir@/libjim@LIBSOEXT@
@else
SH_LDFLAGS += @SH_SOPREFIX@libjim@LIBSOEXT@
@endif
@endif
SHOBJ_CFLAGS ?= @SHOBJ_CFLAGS@
@if JIM_STATICLIB
SHOBJ_LDFLAGS ?= @SHOBJ_LDFLAGS@
@else
SHOBJ_LDFLAGS ?= @SHOBJ_LDFLAGS_R@
@endif
@if [get-define srcdir] ne "."
VPATH := @srcdir@
AS_CFLAGS = -I@srcdir@
AS_CXXFLAGS = -I@srcdir@
@endif
AS_CFLAGS += @AS_CFLAGS@
AS_CXXFLAGS += @AS_CFLAGS@
AS_CPPFLAGS += @AS_CPPFLAGS@
CFLAGS ?= @CFLAGS@
CXXFLAGS ?= @CXXFLAGS@
LDFLAGS = @LDFLAGS@
LDLIBS += @LDLIBS@
LIBS += @LIBS@
exec_prefix ?= @exec_prefix@
prefix ?= @prefix@
docdir = @docdir@
srcdir := @srcdir@
@if JIM_STATICLIB
LIBJIM := libjim.a
@else
LIBJIM := libjim@LIBSOEXT@
SH_LIBJIM := $(LIBJIM)
CC += $(SH_CFLAGS)
CXX += $(SH_CFLAGS)
DEF_LD_PATH := @LD_LIBRARY_PATH@="@builddir@:$(@LD_LIBRARY_PATH@)"
@endif
@if HAVE_CXX_EXTENSIONS
JIMSH_CC := $(CXX) $(AS_CXXFLAGS) $(CXXFLAGS)
@else
JIMSH_CC := $(CC) $(AS_FLAGS) $(CFLAGS)
@endif
OBJS := _load-static-exts.o jim-subcmd.o jim-interactive.o jim-format.o jim.o utf8.o jimregexp.o jimiocompat.o \
@EXTRA_OBJS@ @C_EXT_OBJS@ @TCL_EXT_OBJS@
JIMSH := jimsh@EXEEXT@
@if JIM_INSTALL
INSTALL_DATA_DIR ?= mkdir -p
INSTALL_DATA ?= cp
INSTALL_PROGRAM ?= cp
@endif
all: $(JIMSH) @C_EXT_SHOBJS@
# Create C extensions from pure Tcl extensions
.SUFFIXES: .tcl
.tcl.o:
$(ECHO) " TCLEXT _$*.c"
$(Q)@tclsh@ @srcdir@/make-c-ext.tcl $< >_$*.c
$(ECHO) " CC $@"
$(Q)$(CC) $(AS_CFLAGS) $(AS_CPPFLAGS) $(CFLAGS) $(CPPFLAGS) -c -o $@ _$*.c
.c.o:
$(ECHO) " CC $@"
$(Q)$(CC) $(AS_CFLAGS) $(AS_CPPFLAGS) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
$(JIMSH): $(LIBJIM) jimsh.o initjimsh.o
$(ECHO) " LINK $@"
$(Q)$(JIMSH_CC) @SH_LINKRPATH_FLAGS@ @SH_LINKFLAGS@ $(LDFLAGS) -o $@ jimsh.o initjimsh.o $(LIBJIM) $(LDLIBS) $(LIBS)
@if JIM_INSTALL
install: all @TCL_EXTS@ install-exec install-docs
$(INSTALL_DATA_DIR) $(DESTDIR)@libdir@/jim
$(INSTALL_DATA) $(LIBJIM) $(DESTDIR)@libdir@
@if !JIM_STATICLIB
ln -s -f $(LIBJIM) $(DESTDIR)@libdir@/libjim@SH_SOEXT@
@endif
$(INSTALL_DATA) @srcdir@/README.extensions @C_EXT_SHOBJS@ $(DESTDIR)@libdir@/jim
for i in tcltest.tcl @TCL_EXTS@; do $(INSTALL_DATA) @srcdir@/$$i $(DESTDIR)@libdir@/jim; done
$(INSTALL_DATA_DIR) $(DESTDIR)@includedir@
$(INSTALL_DATA) @srcdir@/jim.h @srcdir@/jim-eventloop.h @srcdir@/jim-signal.h \
@srcdir@/jim-subcmd.h @srcdir@/jim-win32compat.h $(DESTDIR)@includedir@
$(INSTALL_DATA) jim-config.h $(DESTDIR)@includedir@
$(INSTALL_DATA_DIR) $(DESTDIR)@bindir@
$(INSTALL_DATA) build-jim-ext $(DESTDIR)@bindir@
$(INSTALL_DATA_DIR) $(DESTDIR)@libdir@/pkgconfig
$(INSTALL_DATA) jimtcl.pc $(DESTDIR)@libdir@/pkgconfig
install-exec: all
$(INSTALL_DATA_DIR) $(DESTDIR)@bindir@
$(INSTALL_PROGRAM) $(JIMSH) $(DESTDIR)@bindir@
$(INSTALL_PROGRAM) @srcdir@/jimdb $(DESTDIR)@bindir@
uninstall:
rm -f $(DESTDIR)@bindir@/$(JIMSH)
rm -f $(DESTDIR)@bindir@/build-jim-ext
rm -f $(DESTDIR)@libdir@/$(LIBJIM)
for i in README.extensions @C_EXT_SHOBJS@ @TCL_EXTS@; do rm -f $(DESTDIR)@libdir@/jim/$$i; done
rm -f $(DESTDIR)@includedir@/jim*.h
rm -f $(DESTDIR)@datadir@/doc/jim/Tcl.html
@else
install install-exec: all
uninstall:
@endif
test check: $(JIMSH)
$(DEF_LD_PATH) $(MAKE) -C tests jimsh="@builddir@/jimsh"
$(OBJS) jimsh.o initjimsh.o: Makefile $(wildcard *.h)
@if JIM_UTF8
# Generate the unicode case mapping
utf8.o: _unicode_mapping.c
_unicode_mapping.c: @srcdir@/UnicodeData.txt @srcdir@/parse-unidata.tcl
$(ECHO) " UNIDATA $@"
$(Q)@tclsh@ @srcdir@/parse-unidata.tcl @PARSE_UNIDATA_FLAGS@ @srcdir@/UnicodeData.txt @srcdir@/EastAsianWidth.txt >$@ || ( rm $@; exit 1)
@endif
_load-static-exts.c: @srcdir@/make-load-static-exts.tcl Makefile
$(ECHO) " MKLDEXT $@"
$(Q)@tclsh@ @srcdir@/make-load-static-exts.tcl @STATIC_EXTS@ >$@ || ( rm $@; exit 1)
$(LIBJIM): $(OBJS)
@if JIM_STATICLIB
$(ECHO) " AR $@"
$(Q)$(AR) cr $@ $(OBJS)
$(Q)$(RANLIB) $@
@else
$(ECHO) " LDSO $@ libjim@SH_SOEXT@"
$(Q)$(CC) $(AS_CFLAGS) $(CFLAGS) $(LDFLAGS) $(SH_LDFLAGS) -o $@ $(OBJS) $(LDLIBS) $(LIBS)
@if SH_SOEXT ne LIBSOEXT
$(Q)ln -s -f $@ libjim@SH_SOEXT@
@endif
@endif
@BUILD_SHOBJS@
docs: Tcl.html
@if INSTALL_DOCS eq "nodocs"
install-docs:
@endif
@if INSTALL_DOCS eq "docs"
install-docs: docs
$(INSTALL_DATA_DIR) $(DESTDIR)$(docdir)
$(INSTALL_DATA) Tcl.html $(DESTDIR)$(docdir)
@endif
@if INSTALL_DOCS eq "shipped"
install-docs:
$(INSTALL_DATA_DIR) $(DESTDIR)$(docdir)
@echo "Warning: asciidoc not available - installing Tcl_shipped.html"
$(INSTALL_DATA) @srcdir@/Tcl_shipped.html $(DESTDIR)$(docdir)/Tcl.html
@endif
Tcl.html: jim_tcl.txt @srcdir@/make-index
@if HAVE_ASCIIDOC
@tclsh@ @srcdir@/make-index $> $^ | @ASCIIDOC@ --attribute footer-style=none -d manpage - >$@
@else
@echo "asciidoc is not available"; false
@endif
coverage:
@if COVERAGE
@if COVERAGE_TOOL eq "lcov"
@LCOV@ -c --rc genhtml_branch_coverage=1 -d . -o lcov.txt
@GENHTML@ --rc genhtml_branch_coverage=1 -o coverage_html lcov.txt > genhtml_output.txt
@LCOV@ --summary lcov.txt
@endif
@if COVERAGE_TOOL eq "gcovr"
@GCOVR@ -s -e 'conftest*' --html --html-details --output coverage.html
@endif
@if COVERAGE_TOOL eq "gcov"
gcov @srcdir@/*.c
@endif
@else
@echo "Use ./configure --coverage to enable code coverage"
@endif
clean:
rm -f *.o *.so *.dll *.exe lib*.a $(JIMSH) $(LIBJIM) Tcl.html _*.c libjim@SH_SOEXT@
rm -f jsmn/*.o
@if COVERAGE
rm -f *.gcno *.gcov *.gcda */*.gcno */*.gcda */*.gcov coverage*.html
rm -rf coverage_html lcov.txt genhtml_output.txt
@endif
distclean: clean
rm -f jimautoconf.h jim-config.h Makefile config.log jimsh0@EXEEXT@ build-jim-ext
rm -f jimtcl.pc tests/Makefile examples.api/Makefile
ship: Tcl.html
cp $< Tcl_shipped.html
# automake compatibility. do nothing for all these targets
EMPTY_AUTOMAKE_TARGETS := dvi pdf ps info html tags ctags mostlyclean maintainer-clean check installcheck installdirs \
install-pdf install-ps install-info install-html -install-dvi uninstall install-data
.PHONY: $(EMPTY_AUTOMAKE_TARGETS)
$(EMPTY_AUTOMAKE_TARGETS):
# automake compatibility - install sources from the current dir to $(distdir)
distdir_full := $(shell cd $(distdir); pwd)
distdir:
cd "@srcdir@"; git ls-files | cpio -pdmu $(distdir_full)
reconfig:
CC='@CC@' @AUTOREMAKE@
|