3 # This file is a Makefile for Sample TEA Extension. If it has the name
4 # "Makefile.in" then it is a template for a Makefile; to generate the
5 # actual Makefile, run "./configure", which is a configuration script
6 # generated by the "autoconf" program (constructs like "@foo@" will get
7 # replaced in the actual Makefile.
9 # Copyright (c) 1999 Scriptics Corporation.
10 # Copyright (c) 2002-2005 ActiveState Corporation.
12 # See the file "license.terms" for information on usage and redistribution
13 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
15 #========================================================================
16 # Add additional lines to handle any additional AC_SUBST cases that
17 # have been added in a customized configure script.
18 #========================================================================
20 #SAMPLE_NEW_VAR = @SAMPLE_NEW_VAR@
22 #========================================================================
23 # Nothing of the variables below this line should need to be changed.
24 # Please check the TARGETS section below to make sure the make targets
26 #========================================================================
28 #========================================================================
29 # The names of the source files is defined in the configure script.
30 # The object files are used for linking into the final library.
31 # This will be used when a dist target is added to the Makefile.
32 # It is not important to specify the directory, as long as it is the
33 # $(srcdir) or in the generic, win or unix subdirectory.
34 #========================================================================
36 PKG_SOURCES = @PKG_SOURCES@
37 PKG_OBJECTS = @PKG_OBJECTS@
39 PKG_STUB_SOURCES = @PKG_STUB_SOURCES@
40 PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@
42 #========================================================================
43 # PKG_TCL_SOURCES identifies Tcl runtime files that are associated with
44 # this package that need to be installed, if any.
45 #========================================================================
47 PKG_TCL_SOURCES = @PKG_TCL_SOURCES@
49 #========================================================================
50 # This is a list of public header files to be installed, if any.
51 #========================================================================
53 PKG_HEADERS = @PKG_HEADERS@
55 #========================================================================
56 # "PKG_LIB_FILE" refers to the library (dynamic or static as per
57 # configuration options) composed of the named objects.
58 #========================================================================
60 PKG_LIB_FILE = @PKG_LIB_FILE@
61 PKG_LIB_FILE8 = @PKG_LIB_FILE8@
62 PKG_LIB_FILE9 = @PKG_LIB_FILE9@
63 PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@
65 lib_BINARIES = $(PKG_LIB_FILE) $(PKG_STUB_LIB_FILE)
66 BINARIES = $(lib_BINARIES)
72 exec_prefix = @exec_prefix@
76 includedir = @includedir@
77 datarootdir = @datarootdir@
78 runstatedir = @runstatedir@
84 PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION)
85 pkgdatadir = $(datadir)/$(PKG_DIR)
86 pkglibdir = $(libdir)/$(PKG_DIR)
87 pkgincludedir = $(includedir)/$(PKG_DIR)
89 top_builddir = @abs_top_builddir@
92 INSTALL = @INSTALL@ $(INSTALL_OPTIONS)
93 INSTALL_DATA_DIR = @INSTALL_DATA_DIR@
94 INSTALL_DATA = @INSTALL_DATA@
95 INSTALL_PROGRAM = @INSTALL_PROGRAM@
96 INSTALL_SCRIPT = @INSTALL_SCRIPT@
97 INSTALL_LIBRARY = @INSTALL_LIBRARY@
99 PACKAGE_NAME = @PACKAGE_NAME@
100 PACKAGE_VERSION = @PACKAGE_VERSION@
102 CFLAGS_DEFAULT = @CFLAGS_DEFAULT@
103 CFLAGS_WARNING = @CFLAGS_WARNING@
105 LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@
106 MAKE_LIB = @MAKE_LIB@
107 MAKE_STUB_LIB = @MAKE_STUB_LIB@
110 RANLIB_STUB = @RANLIB_STUB@
111 SHLIB_CFLAGS = @SHLIB_CFLAGS@
112 SHLIB_LD = @SHLIB_LD@
113 SHLIB_LD_LIBS = @SHLIB_LD_LIBS@
114 STLIB_LD = @STLIB_LD@
115 #TCL_DEFS = @TCL_DEFS@
116 TCL_BIN_DIR = @TCL_BIN_DIR@
117 TCL_SRC_DIR = @TCL_SRC_DIR@
118 #TK_BIN_DIR = @TK_BIN_DIR@
119 #TK_SRC_DIR = @TK_SRC_DIR@
121 # Not used, but retained for reference of what libs Tcl required
122 #TCL_LIBS = @TCL_LIBS@
124 #========================================================================
125 # TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our
126 # package without installing. The other environment variables allow us
127 # to test against an uninstalled Tcl. Add special env vars that you
128 # require for testing here (like TCLX_LIBRARY).
129 #========================================================================
131 EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR)
132 #EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR):$(TK_BIN_DIR)
133 TCLLIBPATH = $(top_builddir)
134 TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library`
135 PKG_ENV = @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \
136 PATH="$(EXTRA_PATH):$(PATH)" \
137 TDBC_LIBRARY=`@CYGPATH@ $(srcdir)/library` \
138 TCLLIBPATH="$(TCLLIBPATH)"
140 TCLSH_PROG = @TCLSH_PROG@
141 TCLSH = $(TCLSH_ENV) $(PKG_ENV) $(TCLSH_PROG)
143 #WISH_ENV = TK_LIBRARY=`@CYGPATH@ $(TK_SRC_DIR)/library`
144 #WISH_PROG = @WISH_PROG@
145 #WISH = $(TCLSH_ENV) $(WISH_ENV) $(PKG_ENV) $(WISH_PROG)
147 SHARED_BUILD = @SHARED_BUILD@
149 INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@
150 #INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@
152 PKG_CFLAGS = @PKG_CFLAGS@
154 # TCL_DEFS is not strictly need here, but if you remove it, then you
155 # must make sure that configure.ac checks for the necessary components
156 # that your library may use. TCL_DEFS can actually be a problem if
157 # you do not compile with a similar machine setup as the Tcl core was
159 #DEFS = $(TCL_DEFS) @DEFS@ $(PKG_CFLAGS)
160 DEFS = @DEFS@ $(PKG_CFLAGS) -DTCL_NO_DEPRECATED=1
162 # Move pkgIndex.tcl to 'BINARIES' var if it is generated in the Makefile
163 CONFIG_CLEAN_FILES = Makefile pkgIndex.tcl tdbcConfig.sh
164 CLEANFILES = @CLEANFILES@
166 CPPFLAGS = @CPPFLAGS@
167 LIBS = @PKG_LIBS@ @LIBS@
171 LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@
172 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) \
173 $(CFLAGS_DEFAULT) $(CFLAGS_WARNING) $(SHLIB_CFLAGS) $(CFLAGS)
177 VALGRINDARGS = --tool=memcheck --num-callers=8 --leak-resolution=high \
178 --leak-check=yes --show-reachable=yes -v
180 .SUFFIXES: .c .$(OBJEXT)
182 #========================================================================
183 # Start of user-definable TARGETS section
184 #========================================================================
186 #========================================================================
187 # TEA TARGETS. Please note that the "libraries:" target refers to platform
188 # independent files, and the "binaries:" target includes executable programs and
189 # platform-dependent libraries. Modify these targets so that they install
190 # the various pieces of your package. The make and install rules
191 # for the BINARIES that you specified above have already been done.
192 #========================================================================
194 all: binaries libraries doc
196 #========================================================================
197 # The binaries target builds executable programs, Windows .dll's, unix
198 # shared/static libraries, and any other platform-dependent files.
199 # The list of targets to build for "binaries:" is specified at the top
200 # of the Makefile, in the "BINARIES" variable.
201 #========================================================================
203 binaries: $(BINARIES)
207 #========================================================================
208 # Your doc target should differentiate from doc builds (by the developer)
209 # and doc installs (see install-doc), which just install the docs on the
210 # end user machine when building from source.
211 #========================================================================
215 install: all install-binaries install-libraries install-doc
217 install-binaries: binaries install-lib-binaries install-bin-binaries
219 #========================================================================
220 # This rule installs platform-independent files, such as header files.
221 # The list=...; for p in $$list handles the empty list case x-platform.
222 #========================================================================
224 install-libraries: libraries
225 @$(INSTALL_DATA_DIR) "$(DESTDIR)$(includedir)"
226 @echo "Installing header files in $(DESTDIR)$(includedir)"
227 @list='$(PKG_HEADERS)'; for i in $$list; do \
228 echo "Installing $(srcdir)/$$i" ; \
229 $(INSTALL_DATA) $(srcdir)/$$i "$(DESTDIR)$(includedir)" ; \
232 #========================================================================
233 # Install documentation. Unix manpages should go in the $(mandir)
235 #========================================================================
238 @$(INSTALL_DATA_DIR) "$(DESTDIR)$(mandir)/man3" "$(DESTDIR)$(mandir)/mann"
239 @echo "Installing documentation in $(DESTDIR)$(mandir)"
240 @list='$(srcdir)/doc/*.3'; for i in $$list; do \
241 echo "Installing $$i"; \
242 $(INSTALL_DATA) $$i "$(DESTDIR)$(mandir)/man3" ; \
244 @list='$(srcdir)/doc/*.n'; for i in $$list; do \
245 echo "Installing $$i"; \
246 $(INSTALL_DATA) $$i "$(DESTDIR)$(mandir)/mann" ; \
249 test: binaries libraries
250 $(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) \
251 -load "package ifneeded $(PACKAGE_NAME) $(PACKAGE_VERSION) \
252 [list load `@CYGPATH@ $(PKG_LIB_FILE)` [string totitle $(PACKAGE_NAME)]]"
254 shell: binaries libraries
258 $(TCLSH_ENV) $(PKG_ENV) $(GDB) $(TCLSH_PROG) $(SCRIPT)
260 gdb-test: binaries libraries
261 $(TCLSH_ENV) $(PKG_ENV) $(GDB) \
262 --args $(TCLSH_PROG) `@CYGPATH@ $(srcdir)/tests/all.tcl` \
263 $(TESTFLAGS) -singleproc 1 \
264 -load "package ifneeded $(PACKAGE_NAME) $(PACKAGE_VERSION) \
265 [list load `@CYGPATH@ $(PKG_LIB_FILE)` [string totitle $(PACKAGE_NAME)]]"
267 valgrind: binaries libraries
268 $(TCLSH_ENV) $(PKG_ENV) $(VALGRIND) $(VALGRINDARGS) $(TCLSH_PROG) \
269 `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS)
271 valgrindshell: binaries libraries
272 $(TCLSH_ENV) $(PKG_ENV) $(VALGRIND) $(VALGRINDARGS) $(TCLSH_PROG) $(SCRIPT)
276 #========================================================================
277 # $(PKG_LIB_FILE) should be listed as part of the BINARIES variable
278 # mentioned above. That will ensure that this target is built when you
279 # run "make binaries".
281 # The $(PKG_OBJECTS) objects are created and linked into the final
282 # library. In most cases these object files will correspond to the
283 # source files above.
284 #========================================================================
286 $(PKG_LIB_FILE): $(PKG_OBJECTS)
287 -rm -f $(PKG_LIB_FILE)
289 $(RANLIB) $(PKG_LIB_FILE)
291 $(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS)
292 -rm -f $(PKG_STUB_LIB_FILE)
294 $(RANLIB_STUB) $(PKG_STUB_LIB_FILE)
296 #========================================================================
297 # We need to enumerate the list of .c to .o lines here.
299 # In the following lines, $(srcdir) refers to the toplevel directory
300 # containing your extension. If your sources are in a subdirectory,
301 # you will have to modify the paths to reflect this:
303 # sample.$(OBJEXT): $(srcdir)/generic/sample.c
304 # $(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/sample.c` -o $@
306 # Setting the VPATH variable to a list of paths will cause the makefile
307 # to look into these paths when resolving .c to .obj dependencies.
308 # As necessary, add $(srcdir):$(srcdir)/compat:....
309 #========================================================================
311 VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win:$(srcdir)/macosx
314 $(COMPILE) -c `@CYGPATH@ $<` -o $@
316 #========================================================================
317 # Distribution creation
318 # You may need to tweak this target to make it work correctly.
319 #========================================================================
321 #COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar
322 COMPRESS = tar zcvf $(PKG_DIR).tar.gz $(PKG_DIR)
323 DIST_ROOT = /tmp/dist
324 DIST_DIR = $(DIST_ROOT)/$(PKG_DIR)
326 DIST_INSTALL_DATA = CPPROG='cp -p' $(INSTALL) -m 644
327 DIST_INSTALL_SCRIPT = CPPROG='cp -p' $(INSTALL) -m 755
330 rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.*
333 $(INSTALL_DATA_DIR) $(DIST_DIR)
336 $(DIST_INSTALL_DATA) $(srcdir)/Makefile.in \
337 $(srcdir)/aclocal.m4 $(srcdir)/configure.ac \
339 $(DIST_INSTALL_SCRIPT) $(srcdir)/configure $(DIST_DIR)/
341 $(INSTALL_DATA_DIR) $(DIST_DIR)/tclconfig
342 $(DIST_INSTALL_DATA) $(srcdir)/tclconfig/README.txt \
343 $(srcdir)/tclconfig/tcl.m4 $(srcdir)/tclconfig/install-sh \
344 $(DIST_DIR)/tclconfig/
347 $(DIST_INSTALL_DATA) \
348 $(srcdir)/ChangeLog \
349 $(srcdir)/license.terms \
351 $(srcdir)/pkgIndex.tcl.in \
352 $(srcdir)/tdbcConfig.sh.in \
355 $(INSTALL_DATA_DIR) $(DIST_DIR)/doc
356 $(DIST_INSTALL_DATA) $(srcdir)/doc/tdbc.n \
357 $(srcdir)/doc/tdbc_connection.n \
358 $(srcdir)/doc/tdbc_resultset.n \
359 $(srcdir)/doc/tdbc_statement.n \
360 $(srcdir)/doc/tdbc_mapSqlState.n \
361 $(srcdir)/doc/tdbc_tokenize.n \
362 $(srcdir)/doc/Tdbc_Init.3 \
365 $(INSTALL_DATA_DIR) $(DIST_DIR)/generic
366 $(DIST_INSTALL_DATA) $(srcdir)/generic/tdbc.c $(srcdir)/generic/tdbc.decls \
367 $(srcdir)/generic/tdbc.h $(srcdir)/generic/tdbcDecls.h \
368 $(srcdir)/generic/tdbcInt.h $(srcdir)/generic/tdbcStubInit.c \
369 $(srcdir)/generic/tdbcStubLib.c \
370 $(srcdir)/generic/tdbcTokenize.c $(DIST_DIR)/generic/
372 $(INSTALL_DATA_DIR) $(DIST_DIR)/library
373 $(DIST_INSTALL_DATA) $(srcdir)/library/tdbc.tcl $(DIST_DIR)/library/
375 $(INSTALL_DATA_DIR) $(DIST_DIR)/tests
376 $(DIST_INSTALL_DATA) $(srcdir)/tests/all.tcl \
377 $(srcdir)/tests/tdbc.test \
378 $(srcdir)/tests/tokenize.test \
381 $(INSTALL_DATA_DIR) $(DIST_DIR)/tools
382 $(DIST_INSTALL_DATA) $(srcdir)/tools/genExtStubs.tcl \
383 $(srcdir)/tools/genStubs.tcl \
384 $(srcdir)/tools/tdbc-man2html.tcl \
387 $(INSTALL_DATA_DIR) $(DIST_DIR)/win
388 $(DIST_INSTALL_DATA) $(srcdir)/win/makefile.vc $(srcdir)/win/nmakehlp.c \
389 $(srcdir)/win/targets.vc $(srcdir)/win/rules-ext.vc \
390 $(srcdir)/win/rules.vc $(srcdir)/win/tdbc.rc \
393 (cd $(DIST_ROOT); $(COMPRESS);)
395 #========================================================================
396 # How to rebuild the package's stub table.
397 #========================================================================
399 genstubs: $(srcdir)/tools/genStubs.tcl $(srcdir)/generic/tdbc.decls
400 @echo $(TCLSH_PROGRAM) $(srcdir)/tools/genStubs.tcl $(srcdir)/generic $(srcdir)/generic/tdbc.decls
401 @$(TCLSH) `@CYGPATH@ $(srcdir)/tools/genStubs.tcl` `@CYGPATH@ $(srcdir)/generic` `@CYGPATH@ $(srcdir)/generic/tdbc.decls`
403 #========================================================================
404 # End of user-definable section
405 #========================================================================
407 #========================================================================
408 # Don't modify the file to clean here. Instead, set the "CLEANFILES"
409 # variable in configure.ac
410 #========================================================================
413 -test -z "$(BINARIES)" || rm -f $(BINARIES)
414 -rm -f *.$(OBJEXT) core *.core
415 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
419 -rm -f $(CONFIG_CLEAN_FILES)
420 -rm -f config.cache config.log config.status
422 #========================================================================
423 # Install binary object libraries. On Windows this includes both .dll and
424 # .lib files. Because the .lib files are not explicitly listed anywhere,
425 # we need to deduce their existence from the .dll file of the same name.
426 # Library files go into the lib directory.
427 # In addition, this will generate the pkgIndex.tcl
428 # file in the install location (assuming it can find a usable tclsh shell)
430 # You should not have to modify this target.
431 #========================================================================
433 install-lib-binaries: binaries
434 @$(INSTALL_DATA_DIR) "$(DESTDIR)$(pkglibdir)"
435 @list='$(lib_BINARIES)'; for p in $$list; do \
436 if test -f $$p; then \
437 echo " $(INSTALL_LIBRARY) $$p $(DESTDIR)$(pkglibdir)/$$p"; \
438 $(INSTALL_LIBRARY) $$p "$(DESTDIR)$(pkglibdir)/$$p"; \
439 ext=`echo $$p|sed -e "s/.*\.//"`; \
440 if test "x$$ext" = "xdll"; then \
441 lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \
442 if test -f $$lib; then \
443 echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib"; \
444 $(INSTALL_DATA) $$lib "$(DESTDIR)$(pkglibdir)/$$lib"; \
449 @list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
450 if test -f $(srcdir)/$$p; then \
451 destp=`basename $$p`; \
452 echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \
453 $(INSTALL_DATA) $(srcdir)/$$p "$(DESTDIR)$(pkglibdir)/$$destp"; \
456 @if test "x$(SHARED_BUILD)" = "x1"; then \
457 echo " Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \
458 $(INSTALL_DATA) pkgIndex.tcl "$(DESTDIR)$(pkglibdir)"; \
460 @echo " Install tdbcConfig.sh $(DESTDIR)$(pkglibdir)"; \
461 $(INSTALL_DATA) tdbcConfig.sh $(DESTDIR)$(pkglibdir)/tdbcConfig.sh
463 #========================================================================
464 # Install binary executables (e.g. .exe files and dependent .dll files)
465 # This is for files that must go in the bin directory (located next to
466 # wish and tclsh), like dependent .dll files on Windows.
468 # You should not have to modify this target, except to define bin_BINARIES
469 # above if necessary.
470 #========================================================================
472 install-bin-binaries: binaries
473 @$(INSTALL_DATA_DIR) "$(DESTDIR)$(bindir)"
474 @list='$(bin_BINARIES)'; for p in $$list; do \
475 if test -f $$p; then \
476 echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \
477 $(INSTALL_PROGRAM) $$p "$(DESTDIR)$(bindir)/$$p"; \
481 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
483 && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
486 list='$(lib_BINARIES)'; for p in $$list; do \
487 rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \
489 list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
491 rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \
493 list='$(bin_BINARIES)'; for p in $$list; do \
494 rm -f "$(DESTDIR)$(bindir)/$$p"; \
497 .PHONY: all binaries clean depend distclean doc install libraries test
498 .PHONY: gdb gdb-test valgrind valgrindshell
500 # Tell versions [3.59,3.63) of GNU make to not export all variables.
501 # Otherwise a system limit (for SysV at least) may be exceeded.