10 SH_CFLAGS ?
= @SH_CFLAGS@
11 SH_LDFLAGS ?
= @SH_LDFLAGS@
13 SH_LDFLAGS
+= @SH_SOPREFIX@libjim@LIBSOEXT@
15 SHOBJ_CFLAGS ?
= @SHOBJ_CFLAGS@
17 SHOBJ_LDFLAGS ?
= @SHOBJ_LDFLAGS@
19 SHOBJ_LDFLAGS ?
= @SHOBJ_LDFLAGS_R@
21 CFLAGS
= @CFLAGS@ @CCOPTS@
22 CXXFLAGS
= @CXXFLAGS@ @CXXOPTS@
26 exec_prefix ?
= @
exec_prefix@
29 CC
+= -D_GNU_SOURCE
-Wall
$(OPTIM
) -I.
30 CXX
+= -D_GNU_SOURCE
-Wall
$(OPTIM
) -I.
33 CXXFLAGS
+= -I@
srcdir@
40 LIBJIM
:= libjim@LIBSOEXT@
41 SH_LIBJIM
:= $(LIBJIM
)
44 DEF_LD_PATH
:= @LD_LIBRARY_PATH@
="@builddir@:$(@LD_LIBRARY_PATH@)"
47 @if HAVE_CXX_EXTENSIONS
48 JIMSH_CC
:= $(CXX
) $(CXXFLAGS
)
50 JIMSH_CC
:= $(CC
) $(CFLAGS
)
53 OBJS
:= _load-static-exts.o jim-subcmd.o jim-interactive.o jim-format.o jim.o utf8.o jimregexp.o \
54 @EXTRA_OBJS@ @C_EXT_OBJS@ @TCL_EXT_OBJS@
56 JIMSH
:= jimsh@EXEEXT@
59 INSTALL_DATA_DIR ?
= mkdir
-p
64 all: $(JIMSH
) @C_EXT_SHOBJS@
66 # Create C extensions from pure Tcl extensions
69 @tclsh@ @
srcdir@
/make-c-ext.tcl
$< >_
$*.c
70 $(CC
) $(CFLAGS
) -c
-o
$@ _
$*.c
76 $(INSTALL_DATA_DIR
) $(DESTDIR
)$(prefix)/doc
/jim
77 $(INSTALL_DATA
) Tcl.html
$(DESTDIR
)$(prefix)/doc
/jim
82 $(JIMSH
): $(LIBJIM
) jimsh.o initjimsh.o
83 $(JIMSH_CC
) @SH_LINKFLAGS@
$(LDFLAGS
) -o
$@ jimsh.o initjimsh.o
$(LIBJIM
) $(LDLIBS
) $(LIBS
)
86 install: all @TCL_EXTS@ install-exec install-docs
87 $(INSTALL_DATA_DIR
) $(DESTDIR
)@
libdir@
/jim
88 $(INSTALL_DATA
) $(LIBJIM
) $(DESTDIR
)@
libdir@
89 $(INSTALL_DATA
) @
srcdir@
/README.extensions @C_EXT_SHOBJS@
$(DESTDIR
)@
libdir@
/jim
90 for i in @TCL_EXTS@
; do
$(INSTALL_DATA
) @
srcdir@
/$$i $(DESTDIR
)@
libdir@
/jim
; done
91 $(INSTALL_DATA_DIR
) $(DESTDIR
)@
includedir@
92 $(INSTALL_DATA
) @
srcdir@
/jim.h @
srcdir@
/jim-eventloop.h @
srcdir@
/jim-signal.h \
93 @
srcdir@
/jim-subcmd.h @
srcdir@
/jim-win32compat.h
$(DESTDIR
)@
includedir@
94 $(INSTALL_DATA
) jim-config.h
$(DESTDIR
)@
includedir@
95 $(INSTALL_DATA_DIR
) $(DESTDIR
)@
bindir@
96 $(INSTALL_DATA
) build-jim-ext
$(DESTDIR
)@
bindir@
99 $(INSTALL_DATA_DIR
) $(DESTDIR
)@
bindir@
100 $(INSTALL_PROGRAM
) $(JIMSH
) $(DESTDIR
)@
bindir@
103 rm -f
$(DESTDIR
)@
bindir@
/$(JIMSH
)
104 rm -f
$(DESTDIR
)@
bindir@
/build-jim-ext
105 rm -f
$(DESTDIR
)@
libdir@
/$(LIBJIM
)
106 for i in README.extensions @C_EXT_SHOBJS@ @TCL_EXTS@
; do
rm -f
$(DESTDIR
)@
libdir@
/jim
/$$i; done
107 rm -f
$(DESTDIR
)@
includedir@
/jim
*.h
108 rm -f
$(DESTDIR
)@
datadir@
/doc
/jim
/Tcl.html
110 install install-exec
: all
115 cd @
srcdir@
/tests
; $(DEF_LD_PATH
) $(MAKE
) jimsh
=@builddir@
/jimsh
117 $(OBJS
): Makefile
$(wildcard *.h
)
120 # Generate the unicode case mapping
121 utf8.o
: _unicode_mapping.c
123 _unicode_mapping.c
: @
srcdir@
/UnicodeData.txt @
srcdir@
/parse-unidata.tcl
124 @tclsh@ @
srcdir@
/parse-unidata.tcl @
srcdir@
/UnicodeData.txt
>$@ ||
( rm $@
; exit
1)
127 _load-static-exts.c
: @
srcdir@
/make-load-static-exts.tcl Makefile
128 @tclsh@ @
srcdir@
/make-load-static-exts.tcl @STATIC_EXTS@
>$@ ||
( rm $@
; exit
1)
136 $(CC
) $(CFLAGS
) $(LDFLAGS
) $(SH_LDFLAGS
) -o
$@
$(OBJS
) $(LDLIBS
) $(LIBS
)
139 # Note that $> $^ is for compatibility with both GNU make and BSD make
140 readdir.so
: jim-readdir.c
141 $(CC
) $(CFLAGS
) $(SHOBJ_CFLAGS
) -c
-o jim-readdir.o
$> $^
142 $(CC
) $(CFLAGS
) $(LDFLAGS
) $(SHOBJ_LDFLAGS
) -o
$@ jim-readdir.o
$(SH_LIBJIM
)
144 array.so
: jim-array.c
145 $(CC
) $(CFLAGS
) $(SHOBJ_CFLAGS
) -c
-o jim-array.o
$> $^
146 $(CC
) $(CFLAGS
) $(LDFLAGS
) $(SHOBJ_LDFLAGS
) -o
$@ jim-array.o
$(SH_LIBJIM
)
148 clock.so
: jim-clock.c
149 $(CC
) $(CFLAGS
) $(SHOBJ_CFLAGS
) -c
-o jim-clock.o
$> $^
150 $(CC
) $(CFLAGS
) $(LDFLAGS
) $(SHOBJ_LDFLAGS
) -o
$@ jim-clock.o
$(SH_LIBJIM
)
153 $(CC
) $(CFLAGS
) $(SHOBJ_CFLAGS
) -c
-o jim-file.o
$> $^
154 $(CC
) $(CFLAGS
) $(LDFLAGS
) $(SHOBJ_LDFLAGS
) -o
$@ jim-file.o
$(SH_LIBJIM
)
156 posix.so
: jim-posix.c
157 $(CC
) $(CFLAGS
) $(SHOBJ_CFLAGS
) -c
-o jim-posix.o
$> $^
158 $(CC
) $(CFLAGS
) $(LDFLAGS
) $(SHOBJ_LDFLAGS
) -o
$@ jim-posix.o
$(SH_LIBJIM
)
160 regexp.so
: jim-regexp.c
161 $(CC
) $(CFLAGS
) $(SHOBJ_CFLAGS
) -c
-o jim-regexp.o
$> $^
162 $(CC
) $(CFLAGS
) $(LDFLAGS
) $(SHOBJ_LDFLAGS
) -o
$@ jim-regexp.o
$(SH_LIBJIM
)
164 syslog.so
: jim-syslog.c
165 $(CC
) $(CFLAGS
) $(SHOBJ_CFLAGS
) -c
-o jim-syslog.o
$> $^
166 $(CC
) $(CFLAGS
) $(LDFLAGS
) $(SHOBJ_LDFLAGS
) -o
$@ jim-syslog.o
$(SH_LIBJIM
)
168 readline.so
: jim-readline.c
169 $(CC
) $(CFLAGS
) $(SHOBJ_CFLAGS
) -c
-o jim-readline.o
$> $^
170 $(CC
) $(CFLAGS
) $(LDFLAGS
) $(SHOBJ_LDFLAGS
) -o
$@ jim-readline.o
$(SH_LIBJIM
) @LDLIBS_readline@
173 $(CC
) $(CFLAGS
) $(SHOBJ_CFLAGS
) -c
-o jim-pack.o
$> $^
174 $(CC
) $(CFLAGS
) $(LDFLAGS
) $(SHOBJ_LDFLAGS
) -o
$@ jim-pack.o
$(SH_LIBJIM
) @LDLIBS_pack@
176 tclprefix.so
: jim-tclprefix.c
177 $(CC
) $(CFLAGS
) $(SHOBJ_CFLAGS
) -c
-o jim-tclprefix.o
$> $^
178 $(CC
) $(CFLAGS
) $(LDFLAGS
) $(SHOBJ_LDFLAGS
) -o
$@ jim-tclprefix.o
$(SH_LIBJIM
) @LDLIBS_tclprefix@
180 sqlite3.so
: jim-sqlite3.c
181 $(CC
) $(CFLAGS
) $(SHOBJ_CFLAGS
) -c
-o jim-sqlite3.o
$> $^
182 $(CC
) $(CFLAGS
) $(LDFLAGS
) $(SHOBJ_LDFLAGS
) -o
$@ jim-sqlite3.o
$(SH_LIBJIM
) @LDLIBS_sqlite3@
184 win32.so
: jim-win32.c
185 $(CC
) $(CFLAGS
) $(SHOBJ_CFLAGS
) -c
-o jim-win32.o
$> $^
186 $(CC
) $(CFLAGS
) $(LDFLAGS
) $(SHOBJ_LDFLAGS
) -o
$@ jim-win32.o
$(SH_LIBJIM
) @LDLIBS_win32@
189 $(CXX
) $(CXXFLAGS
) $(SHOBJ_CFLAGS
) -c
-o jim-mk.o
$> $^
190 $(CXX
) $(CXXFLAGS
) $(LDFLAGS
) $(SHOBJ_LDFLAGS
) -o
$@ jim-mk.o
$(SH_LIBJIM
) @LDLIBS_mk@
193 $(CC
) $(CFLAGS
) $(SHOBJ_CFLAGS
) -c
-o jim-sdl.o
$> $^
194 $(CC
) $(CFLAGS
) $(LDFLAGS
) $(SHOBJ_LDFLAGS
) -o
$@ jim-sdl.o
$(SH_LIBJIM
) @LDLIBS_sdl@
196 Tcl.html
: jim_tcl.txt
197 @tclsh@ @
srcdir@
/make-index
$> $^ | asciidoc
-o
$@
-d manpage
- || cp @
srcdir@
/Tcl_shipped.html Tcl.html
200 rm -f
*.o
*.so
*.dll
*.exe lib
*.a
$(JIMSH
) $(LIBJIM
) Tcl.html _
*.c
203 rm -f jimautoconf.h jim-config.h Makefile config.log autosetup
/jimsh0@EXEEXT@ build-jim-ext
206 cp
$< Tcl_shipped.html
208 # automake compatibility. do nothing for all these targets
209 EMPTY_AUTOMAKE_TARGETS
:= dvi pdf ps
info html
tags ctags
mostlyclean maintainer-clean
check installcheck installdirs \
210 install-pdf install-ps install-info install-html
-install-dvi
uninstall install-data
211 .PHONY
: $(EMPTY_AUTOMAKE_TARGETS
)
212 $(EMPTY_AUTOMAKE_TARGETS
):
214 # automake compatibility - install sources from the current dir to $(distdir)
215 distdir_full
:= $(shell cd
$(distdir
); pwd
)
217 cd
"@srcdir@"; git ls-files | cpio
-pdmu
$(distdir_full
)
220 CC
='@CC@' @AUTOREMAKE@