1# Makefile.in -- 2# 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. 8# 9# Copyright (c) 1999 Scriptics Corporation. 10# Copyright (c) 2002-2005 ActiveState Corporation. 11# 12# See the file "license.terms" for information on usage and redistribution 13# of this file, and for a DISCLAIMER OF ALL WARRANTIES. 14 15#======================================================================== 16# Add additional lines to handle any additional AC_SUBST cases that 17# have been added in a customized configure script. 18#======================================================================== 19 20#SAMPLE_NEW_VAR = @SAMPLE_NEW_VAR@ 21 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 25# are correct. 26#======================================================================== 27 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#======================================================================== 35 36PKG_SOURCES = @PKG_SOURCES@ 37PKG_OBJECTS = @PKG_OBJECTS@ 38 39PKG_STUB_SOURCES = @PKG_STUB_SOURCES@ 40PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@ 41 42#======================================================================== 43# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with 44# this package that need to be installed, if any. 45#======================================================================== 46 47PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ 48 49#======================================================================== 50# This is a list of public header files to be installed, if any. 51#======================================================================== 52 53PKG_HEADERS = @PKG_HEADERS@ 54 55#======================================================================== 56# "PKG_LIB_FILE" refers to the library (dynamic or static as per 57# configuration options) composed of the named objects. 58#======================================================================== 59 60PKG_LIB_FILE = @PKG_LIB_FILE@ 61PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ 62 63lib_BINARIES = $(PKG_LIB_FILE) 64BINARIES = $(lib_BINARIES) 65 66SHELL = @SHELL@ 67 68srcdir = @srcdir@ 69prefix = @prefix@ 70exec_prefix = @exec_prefix@ 71 72bindir = @bindir@ 73libdir = @libdir@ 74includedir = @includedir@ 75datarootdir = @datarootdir@ 76datadir = @datadir@ 77mandir = @mandir@ 78 79DESTDIR ?= 80 81PKG_DIR = $(PACKAGE_NAME)-$(PACKAGE_VERSION) 82pkgdatadir = $(datadir)/$(PKG_DIR) 83pkglibdir = $(libdir)/$(PKG_DIR) 84pkgincludedir = $(includedir)/$(PKG_DIR) 85 86top_builddir = @abs_top_builddir@ 87 88INSTALL_OPTIONS = 89INSTALL = @INSTALL@ $(INSTALL_OPTIONS) 90INSTALL_DATA_DIR = @INSTALL_DATA_DIR@ 91INSTALL_DATA = @INSTALL_DATA@ 92INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s 93INSTALL_SCRIPT = @INSTALL_SCRIPT@ 94INSTALL_LIBRARY = @INSTALL_LIBRARY@ -s 95 96PACKAGE_NAME = @PACKAGE_NAME@ 97PACKAGE_VERSION = @PACKAGE_VERSION@ 98CC = @CC@ 99CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ 100CFLAGS_WARNING = @CFLAGS_WARNING@ 101EXEEXT = @EXEEXT@ 102LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ 103MAKE_LIB = @MAKE_LIB@ 104MAKE_SHARED_LIB = @MAKE_SHARED_LIB@ 105MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ 106MAKE_STUB_LIB = @MAKE_STUB_LIB@ 107OBJEXT = @OBJEXT@ 108RANLIB = @RANLIB@ 109RANLIB_STUB = @RANLIB_STUB@ 110SHLIB_CFLAGS = @SHLIB_CFLAGS@ 111SHLIB_LD = @SHLIB_LD@ 112SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ 113STLIB_LD = @STLIB_LD@ 114#TCL_DEFS = @TCL_DEFS@ 115TCL_BIN_DIR = @TCL_BIN_DIR@ 116TCL_SRC_DIR = @TCL_SRC_DIR@ 117#TK_BIN_DIR = @TK_BIN_DIR@ 118#TK_SRC_DIR = @TK_SRC_DIR@ 119 120# Not used, but retained for reference of what libs Tcl required 121#TCL_LIBS = @TCL_LIBS@ 122 123TDBC_VERSION = @TDBC_VERSION@ 124TDBC_BIN_DIR = @tdbc_BIN_DIR@ 125TDBC_LIB_FILE = @TDBC_LIB_FILE@ 126 127#======================================================================== 128# TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our 129# package without installing. The other environment variables allow us 130# to test against an uninstalled Tcl. Add special env vars that you 131# require for testing here (like TCLX_LIBRARY). 132#======================================================================== 133 134EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) 135#EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR):$(TK_BIN_DIR) 136TCLLIBPATH = $(top_builddir) $(TDBC_BIN_DIR) 137TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` 138PKG_ENV = @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ 139 PATH="$(EXTRA_PATH):$(PATH)" \ 140 TDBC_LIBRARY=`@CYGPATH@ @tdbc_LIBRARY_PATH@` \ 141 TCLLIBPATH="$(TCLLIBPATH)" 142 143TCLSH_PROG = @TCLSH_PROG@ 144TCLSH = $(TCLSH_ENV) $(PKG_ENV) $(TCLSH_PROG) 145 146#WISH_ENV = TK_LIBRARY=`@CYGPATH@ $(TK_SRC_DIR)/library` 147#WISH_PROG = @WISH_PROG@ 148#WISH = $(TCLSH_ENV) $(WISH_ENV) $(PKG_ENV) $(WISH_PROG) 149 150SHARED_BUILD = @SHARED_BUILD@ 151 152INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ 153#INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@ 154 155PKG_CFLAGS = @PKG_CFLAGS@ 156 157# TCL_DEFS is not strictly need here, but if you remove it, then you 158# must make sure that configure.ac checks for the necessary components 159# that your library may use. TCL_DEFS can actually be a problem if 160# you do not compile with a similar machine setup as the Tcl core was 161# compiled with. 162#DEFS = $(TCL_DEFS) @DEFS@ $(PKG_CFLAGS) 163DEFS = @DEFS@ $(PKG_CFLAGS) 164 165# Move pkgIndex.tcl to 'BINARIES' var if it is generated in the Makefile 166CONFIG_CLEAN_FILES = Makefile pkgIndex.tcl 167CLEANFILES = @CLEANFILES@ 168 169CPPFLAGS = @CPPFLAGS@ 170LIBS = @PKG_LIBS@ @LIBS@ 171AR = @AR@ 172CFLAGS = @CFLAGS@ 173COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 174 175GDB = gdb 176VALGRIND = valgrind 177VALGRINDARGS = --tool=memcheck --num-callers=8 --leak-resolution=high \ 178 --leak-check=yes --show-reachable=yes -v 179 180TCL_VERSION = @TCL_VERSION@ 181TCL_MAJOR_VERSION = @TCL_MAJOR_VERSION@ 182 183tmdir = $(libdir)/tcl$(TCL_MAJOR_VERSION)/$(TCL_VERSION) 184pkgslash = `echo $(PACKAGE_NAME) | sed s=tdbc=tdbc/=` 185pkgtmdir = $(tmdir)/tdbc 186pkgtmfile = $(tmdir)/$(pkgslash)-$(PACKAGE_VERSION).tm 187 188.SUFFIXES: .c .$(OBJEXT) 189 190#======================================================================== 191# Start of user-definable TARGETS section 192#======================================================================== 193 194#======================================================================== 195# TEA TARGETS. Please note that the "libraries:" target refers to platform 196# independent files, and the "binaries:" target includes executable programs and 197# platform-dependent libraries. Modify these targets so that they install 198# the various pieces of your package. The make and install rules 199# for the BINARIES that you specified above have already been done. 200#======================================================================== 201 202all: binaries libraries doc 203 204#======================================================================== 205# The binaries target builds executable programs, Windows .dll's, unix 206# shared/static libraries, and any other platform-dependent files. 207# The list of targets to build for "binaries:" is specified at the top 208# of the Makefile, in the "BINARIES" variable. 209#======================================================================== 210 211binaries: $(BINARIES) 212 213libraries: 214 215#======================================================================== 216# Your doc target should differentiate from doc builds (by the developer) 217# and doc installs (see install-doc), which just install the docs on the 218# end user machine when building from source. 219#======================================================================== 220 221doc: 222 223install: all install-tm install-doc 224 225install-binaries: binaries install-lib-binaries install-bin-binaries 226 227#======================================================================== 228# This rule installs platform-independent files, such as header files. 229# The list=...; for p in $$list handles the empty list case x-platform. 230#======================================================================== 231 232install-libraries: libraries 233 @$(INSTALL_DATA_DIR) $(DESTDIR)$(includedir) 234 @echo "Installing header files in $(DESTDIR)$(includedir)" 235 @list='$(PKG_HEADERS)'; for i in $$list; do \ 236 echo "Installing $(srcdir)/$$i" ; \ 237 $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ 238 done; 239 240#======================================================================== 241# Install documentation. Unix manpages should go in the $(mandir) 242# directory. 243#======================================================================== 244 245install-doc: doc 246 @$(INSTALL_DATA_DIR) $(DESTDIR)$(mandir)/mann 247 @echo "Installing documentation in $(DESTDIR)$(mandir)" 248 @list='$(srcdir)/doc/*.n'; for i in $$list; do \ 249 echo "Installing $$i"; \ 250 $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \ 251 done 252 253test: binaries libraries 254 $(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) \ 255 -load "package ifneeded tdbc::sqlite3 $(PACKAGE_VERSION) \ 256 [list source `@CYGPATH@ $(srcdir)/library/tdbcsqlite3.tcl`]" 257 258shell: binaries libraries 259 @$(TCLSH) $(SCRIPT) 260 261gdb: 262 $(TCLSH_ENV) $(PKG_ENV) $(GDB) $(TCLSH_PROG) $(SCRIPT) 263 264gdb-test: binaries libraries 265 $(TCLSH_ENV) $(PKG_ENV) $(GDB) \ 266 --args $(TCLSH_PROG) `@CYGPATH@ $(srcdir)/tests/all.tcl` \ 267 $(TESTFLAGS) -singleproc 1 \ 268 -load "package ifneeded tdbc::sqlite3 $(PACKAGE_VERSION) \ 269 [list source `@CYGPATH@ $(srcdir)/library/tdbcsqlite3.tcl`]" 270 271valgrind: binaries libraries 272 $(TCLSH_ENV) $(PKG_ENV) $(VALGRIND) $(VALGRINDARGS) $(TCLSH_PROG) \ 273 `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) 274 275valgrindshell: binaries libraries 276 $(TCLSH_ENV) $(PKG_ENV) $(VALGRIND) $(VALGRINDARGS) $(TCLSH_PROG) $(SCRIPT) 277 278depend: 279 280#======================================================================== 281# $(PKG_LIB_FILE) should be listed as part of the BINARIES variable 282# mentioned above. That will ensure that this target is built when you 283# run "make binaries". 284# 285# The $(PKG_OBJECTS) objects are created and linked into the final 286# library. In most cases these object files will correspond to the 287# source files above. 288#======================================================================== 289 290$(PKG_LIB_FILE): $(PKG_OBJECTS) 291 -rm -f $(PKG_LIB_FILE) 292 ${MAKE_LIB} 293 $(RANLIB) $(PKG_LIB_FILE) 294 295$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) 296 -rm -f $(PKG_STUB_LIB_FILE) 297 ${MAKE_STUB_LIB} 298 $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) 299 300#======================================================================== 301# We need to enumerate the list of .c to .o lines here. 302# 303# In the following lines, $(srcdir) refers to the toplevel directory 304# containing your extension. If your sources are in a subdirectory, 305# you will have to modify the paths to reflect this: 306# 307# sample.$(OBJEXT): $(srcdir)/generic/sample.c 308# $(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/sample.c` -o $@ 309# 310# Setting the VPATH variable to a list of paths will cause the makefile 311# to look into these paths when resolving .c to .obj dependencies. 312# As necessary, add $(srcdir):$(srcdir)/compat:.... 313#======================================================================== 314 315VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win:$(srcdir)/macosx 316 317.c.@OBJEXT@: 318 $(COMPILE) -c `@CYGPATH@ $<` -o $@ 319 320#======================================================================== 321# Distribution creation 322# You may need to tweak this target to make it work correctly. 323#======================================================================== 324 325#COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar 326COMPRESS = tar zcvf $(PKG_DIR).tar.gz $(PKG_DIR) 327DIST_ROOT = /tmp/dist 328DIST_DIR = $(DIST_ROOT)/$(PKG_DIR) 329 330DIST_INSTALL_DATA = CPPROG='cp -p' $(INSTALL) -m 644 331DIST_INSTALL_SCRIPT = CPPROG='cp -p' $(INSTALL) -m 755 332 333dist-clean: 334 rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.* 335 336dist: dist-clean 337 $(INSTALL_DATA_DIR) $(DIST_DIR) 338 339 # TEA files 340 $(DIST_INSTALL_DATA) $(srcdir)/Makefile.in \ 341 $(srcdir)/aclocal.m4 $(srcdir)/configure.ac \ 342 $(DIST_DIR)/ 343 $(DIST_INSTALL_SCRIPT) $(srcdir)/configure $(DIST_DIR)/ 344 345 $(INSTALL_DATA_DIR) $(DIST_DIR)/tclconfig 346 $(DIST_INSTALL_DATA) $(srcdir)/tclconfig/README.txt \ 347 $(srcdir)/tclconfig/tcl.m4 $(srcdir)/tclconfig/install-sh \ 348 $(DIST_DIR)/tclconfig/ 349 350 # Extension files 351 $(DIST_INSTALL_DATA) \ 352 $(srcdir)/ChangeLog \ 353 $(srcdir)/license.terms \ 354 $(srcdir)/README \ 355 $(srcdir)/pkgIndex.tcl.in \ 356 $(DIST_DIR)/ 357 358 $(INSTALL_DATA_DIR) $(DIST_DIR)/doc 359 $(DIST_INSTALL_DATA) $(srcdir)/doc/tdbc_sqlite3.n $(DIST_DIR)/doc/ 360 361 $(INSTALL_DATA_DIR) $(DIST_DIR)/library 362 $(DIST_INSTALL_DATA) $(srcdir)/library/tdbcsqlite3.tcl $(DIST_DIR)/library/ 363 364 $(INSTALL_DATA_DIR) $(DIST_DIR)/tests 365 $(DIST_INSTALL_DATA) $(srcdir)/tests/all.tcl $(srcdir)/tests/tdbcsqlite3.test \ 366 $(DIST_DIR)/tests/ 367 368 $(INSTALL_DATA_DIR) $(DIST_DIR)/win 369 $(DIST_INSTALL_DATA) $(srcdir)/win/makefile.vc $(srcdir)/win/nmakehlp.c \ 370 $(srcdir)/win/targets.vc $(srcdir)/win/rules-ext.vc \ 371 $(srcdir)/win/rules.vc $(DIST_DIR)/win/ 372 373 (cd $(DIST_ROOT); $(COMPRESS);) 374 375#======================================================================== 376# End of user-definable section 377#======================================================================== 378 379#======================================================================== 380# Don't modify the file to clean here. Instead, set the "CLEANFILES" 381# variable in configure.ac 382#======================================================================== 383 384clean: 385 -test -z "$(BINARIES)" || rm -f $(BINARIES) 386 -rm -f *.$(OBJEXT) core *.core 387 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 388 389distclean: clean 390 -rm -f *.tab.c 391 -rm -f $(CONFIG_CLEAN_FILES) 392 -rm -f config.cache config.log config.status 393 394#======================================================================== 395# Install binary object libraries. On Windows this includes both .dll and 396# .lib files. Because the .lib files are not explicitly listed anywhere, 397# we need to deduce their existence from the .dll file of the same name. 398# Library files go into the lib directory. 399# In addition, this will generate the pkgIndex.tcl 400# file in the install location (assuming it can find a usable tclsh shell) 401# 402# You should not have to modify this target. 403#======================================================================== 404 405install-lib-binaries: binaries 406 @$(INSTALL_DATA_DIR) $(DESTDIR)$(pkglibdir) 407 @list='$(lib_BINARIES)'; for p in $$list; do \ 408 if test -f $$p; then \ 409 echo " $(INSTALL_LIBRARY) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ 410 $(INSTALL_LIBRARY) $$p $(DESTDIR)$(pkglibdir)/$$p; \ 411 ext=`echo $$p|sed -e "s/.*\.//"`; \ 412 if test "x$$ext" = "xdll"; then \ 413 lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \ 414 if test -f $$lib; then \ 415 echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib"; \ 416 $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib; \ 417 fi; \ 418 fi; \ 419 fi; \ 420 done 421 @list='$(PKG_TCL_SOURCES)'; for p in $$list; do \ 422 if test -f $(srcdir)/$$p; then \ 423 destp=`basename $$p`; \ 424 echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \ 425 $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkglibdir)/$$destp; \ 426 fi; \ 427 done 428 @if test "x$(SHARED_BUILD)" = "x1"; then \ 429 echo " Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \ 430 $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ 431 fi 432 433#======================================================================== 434# Install binary executables (e.g. .exe files and dependent .dll files) 435# This is for files that must go in the bin directory (located next to 436# wish and tclsh), like dependent .dll files on Windows. 437# 438# You should not have to modify this target, except to define bin_BINARIES 439# above if necessary. 440#======================================================================== 441 442install-bin-binaries: binaries 443 @$(INSTALL_DATA_DIR) $(DESTDIR)$(bindir) 444 @list='$(bin_BINARIES)'; for p in $$list; do \ 445 if test -f $$p; then \ 446 echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \ 447 $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \ 448 fi; \ 449 done 450 451Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 452 cd $(top_builddir) \ 453 && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status 454 455uninstall-binaries: 456 list='$(lib_BINARIES)'; for p in $$list; do \ 457 rm -f $(DESTDIR)$(pkglibdir)/$$p; \ 458 done 459 list='$(PKG_TCL_SOURCES)'; for p in $$list; do \ 460 p=`basename $$p`; \ 461 rm -f $(DESTDIR)$(pkglibdir)/$$p; \ 462 done 463 list='$(bin_BINARIES)'; for p in $$list; do \ 464 rm -f $(DESTDIR)$(bindir)/$$p; \ 465 done 466 467install-tm: 468 @$(INSTALL_DATA_DIR) $(DESTDIR)$(pkgtmdir) 469 $(INSTALL_DATA) $(srcdir)/library/tdbcsqlite3.tcl \ 470 $(DESTDIR)$(pkgtmfile) 471 472.PHONY: all binaries clean depend distclean doc install libraries test 473.PHONY: gdb gdb-test valgrind valgrindshell 474.PHONY: install-tm 475 476# Tell versions [3.59,3.63) of GNU make to not export all variables. 477# Otherwise a system limit (for SysV at least) may be exceeded. 478.NOEXPORT: 479