5 # make V=1 for verbose make output
9 ifeq ("$(origin V)", "command line")
25 SH_CFLAGS ?
= @SH_CFLAGS@
26 SH_LDFLAGS ?
= @SH_LDFLAGS@
28 SH_LDFLAGS
+= @SH_SOPREFIX@libjim@LIBSOEXT@
30 SHOBJ_CFLAGS ?
= @SHOBJ_CFLAGS@
32 SHOBJ_LDFLAGS ?
= @SHOBJ_LDFLAGS@
34 SHOBJ_LDFLAGS ?
= @SHOBJ_LDFLAGS_R@
36 CFLAGS
= @CFLAGS@ @CCOPTS@ @CPPFLAGS@
37 CXXFLAGS
= @CXXFLAGS@ @CXXOPTS@
41 exec_prefix ?
= @
exec_prefix@
45 CC
+= -Wall
$(OPTIM
) -I.
46 CXX
+= -Wall
$(OPTIM
) -I.
47 @if
[get-define
srcdir] ne
"."
49 CXXFLAGS
+= -I@
srcdir@
56 LIBJIM
:= libjim@LIBSOEXT@
57 SH_LIBJIM
:= $(LIBJIM
)
60 DEF_LD_PATH
:= @LD_LIBRARY_PATH@
="@builddir@:$(@LD_LIBRARY_PATH@)"
63 @if HAVE_CXX_EXTENSIONS
64 JIMSH_CC
:= $(CXX
) $(CXXFLAGS
)
66 JIMSH_CC
:= $(CC
) $(CFLAGS
)
69 OBJS
:= _load-static-exts.o jim-subcmd.o jim-interactive.o jim-format.o jim.o utf8.o jimregexp.o jimiocompat.o \
70 @EXTRA_OBJS@ @C_EXT_OBJS@ @TCL_EXT_OBJS@
72 JIMSH
:= jimsh@EXEEXT@
75 INSTALL_DATA_DIR ?
= mkdir
-p
80 all: $(JIMSH
) @C_EXT_SHOBJS@
82 # Create C extensions from pure Tcl extensions
85 $(ECHO
) " TCLEXT _$*.c"
86 $(Q
)@tclsh@ @
srcdir@
/make-c-ext.tcl
$< >_
$*.c
88 $(Q
)$(CC
) $(CFLAGS
) -c
-o
$@ _
$*.c
92 $(Q
)$(CC
) $(CFLAGS
) $(CPPFLAGS
) $(TARGET_ARCH
) -c
$< -o
$@
94 $(JIMSH
): $(LIBJIM
) jimsh.o initjimsh.o
96 $(Q
)$(JIMSH_CC
) @SH_LINKRPATH_FLAGS@ @SH_LINKFLAGS@
$(LDFLAGS
) -o
$@ jimsh.o initjimsh.o
$(LIBJIM
) $(LDLIBS
) $(LIBS
)
99 install: all @TCL_EXTS@ install-exec install-docs
100 $(INSTALL_DATA_DIR
) $(DESTDIR
)@
libdir@
/jim
101 $(INSTALL_DATA
) $(LIBJIM
) $(DESTDIR
)@
libdir@
102 $(INSTALL_DATA
) @
srcdir@
/README.extensions @C_EXT_SHOBJS@
$(DESTDIR
)@
libdir@
/jim
103 for i in tcltest.tcl @TCL_EXTS@
; do
$(INSTALL_DATA
) @
srcdir@
/$$i $(DESTDIR
)@
libdir@
/jim
; done
104 $(INSTALL_DATA_DIR
) $(DESTDIR
)@
includedir@
105 $(INSTALL_DATA
) @
srcdir@
/jim.h @
srcdir@
/jim-eventloop.h @
srcdir@
/jim-signal.h \
106 @
srcdir@
/jim-subcmd.h @
srcdir@
/jim-win32compat.h
$(DESTDIR
)@
includedir@
107 $(INSTALL_DATA
) jim-config.h
$(DESTDIR
)@
includedir@
108 $(INSTALL_DATA_DIR
) $(DESTDIR
)@
bindir@
109 $(INSTALL_DATA
) build-jim-ext
$(DESTDIR
)@
bindir@
110 $(INSTALL_DATA_DIR
) $(DESTDIR
)@
libdir@
/pkgconfig
111 $(INSTALL_DATA
) jimtcl.
pc $(DESTDIR
)@
libdir@
/pkgconfig
114 $(INSTALL_DATA_DIR
) $(DESTDIR
)@
bindir@
115 $(INSTALL_PROGRAM
) $(JIMSH
) $(DESTDIR
)@
bindir@
118 rm -f
$(DESTDIR
)@
bindir@
/$(JIMSH
)
119 rm -f
$(DESTDIR
)@
bindir@
/build-jim-ext
120 rm -f
$(DESTDIR
)@
libdir@
/$(LIBJIM
)
121 for i in README.extensions @C_EXT_SHOBJS@ @TCL_EXTS@
; do
rm -f
$(DESTDIR
)@
libdir@
/jim
/$$i; done
122 rm -f
$(DESTDIR
)@
includedir@
/jim
*.h
123 rm -f
$(DESTDIR
)@
datadir@
/doc
/jim
/Tcl.html
125 install install-exec
: all
130 cd @
srcdir@
/tests
; $(DEF_LD_PATH
) $(MAKE
) jimsh
=@builddir@
/jimsh TOPSRCDIR
=..
132 $(OBJS
) jimsh.o initjimsh.o
: Makefile
$(wildcard *.h
)
135 # Generate the unicode case mapping
136 utf8.o
: _unicode_mapping.c
138 _unicode_mapping.c
: @
srcdir@
/UnicodeData.txt @
srcdir@
/parse-unidata.tcl
139 $(ECHO
) " UNIDATA $@"
140 $(Q
)@tclsh@ @
srcdir@
/parse-unidata.tcl @PARSE_UNIDATA_FLAGS@ @
srcdir@
/UnicodeData.txt @
srcdir@
/EastAsianWidth.txt
>$@ ||
( rm $@
; exit
1)
143 _load-static-exts.c
: @
srcdir@
/make-load-static-exts.tcl Makefile
144 $(ECHO
) " MKLDEXT $@"
145 $(Q
)@tclsh@ @
srcdir@
/make-load-static-exts.tcl @STATIC_EXTS@
>$@ ||
( rm $@
; exit
1)
150 $(Q
)$(AR
) cr
$@
$(OBJS
)
154 $(Q
)$(CC
) $(CFLAGS
) $(LDFLAGS
) $(SH_LDFLAGS
) -o
$@
$(OBJS
) $(LDLIBS
) $(LIBS
)
161 @if INSTALL_DOCS eq
"nodocs"
165 @if INSTALL_DOCS eq
"docs"
167 $(INSTALL_DATA_DIR
) $(DESTDIR
)$(docdir
)
168 $(INSTALL_DATA
) Tcl.html
$(DESTDIR
)$(docdir
)
171 @if INSTALL_DOCS eq
"shipped"
173 $(INSTALL_DATA_DIR
) $(DESTDIR
)$(docdir
)
174 @echo
"Warning: asciidoc not available - installing Tcl_shipped.html"
175 $(INSTALL_DATA
) Tcl_shipped.html
$(DESTDIR
)$(docdir
)/Tcl.html
178 Tcl.html
: jim_tcl.txt @
srcdir@
/make-index
180 @tclsh@ @
srcdir@
/make-index
$> $^ | @ASCIIDOC@
-d manpage
- | @SED@
-e
'/^<div.*id="footer-text"/,/<\/div>/d' >$@
182 @echo
"asciidoc is not available"; false
186 rm -f
*.o
*.so
*.dll
*.exe lib
*.a
$(JIMSH
) $(LIBJIM
) Tcl.html _
*.c
189 rm -f jimautoconf.h jim-config.h Makefile config.log @
srcdir@
/autosetup
/jimsh0@EXEEXT@ build-jim-ext
190 rm -f jimtcl.
pc tests
/Makefile
193 cp
$< Tcl_shipped.html
195 # automake compatibility. do nothing for all these targets
196 EMPTY_AUTOMAKE_TARGETS
:= dvi pdf ps
info html
tags ctags
mostlyclean maintainer-clean
check installcheck installdirs \
197 install-pdf install-ps install-info install-html
-install-dvi
uninstall install-data
198 .PHONY
: $(EMPTY_AUTOMAKE_TARGETS
)
199 $(EMPTY_AUTOMAKE_TARGETS
):
201 # automake compatibility - install sources from the current dir to $(distdir)
202 distdir_full
:= $(shell cd
$(distdir
); pwd
)
204 cd
"@srcdir@"; git ls-files | cpio
-pdmu
$(distdir_full
)
207 CC
='@CC@' @AUTOREMAKE@