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_LIB_FILE8 = @PKG_LIB_FILE8@ 62PKG_LIB_FILE9 = @PKG_LIB_FILE9@ 63PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ 64 65lib_BINARIES = $(PKG_LIB_FILE) 66BINARIES = $(lib_BINARIES) 67 68SHELL = @SHELL@ 69 70srcdir = @srcdir@ 71prefix = @prefix@ 72exec_prefix = @exec_prefix@ 73 74bindir = @bindir@ 75libdir = @libdir@ 76includedir = @includedir@ 77datarootdir = @datarootdir@ 78runstatedir = @runstatedir@ 79datadir = @datadir@ 80mandir = @mandir@ 81 82DESTDIR = 83 84PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) 85pkgdatadir = $(datadir)/$(PKG_DIR) 86pkglibdir = $(libdir)/$(PKG_DIR) 87pkgincludedir = $(includedir)/$(PKG_DIR) 88 89top_builddir = @abs_top_builddir@ 90 91INSTALL_OPTIONS = 92INSTALL = @INSTALL@ $(INSTALL_OPTIONS) 93INSTALL_DATA_DIR = @INSTALL_DATA_DIR@ 94INSTALL_DATA = @INSTALL_DATA@ 95INSTALL_PROGRAM = @INSTALL_PROGRAM@ 96INSTALL_SCRIPT = @INSTALL_SCRIPT@ 97INSTALL_LIBRARY = @INSTALL_LIBRARY@ 98 99PACKAGE_NAME = @PACKAGE_NAME@ 100PACKAGE_VERSION = @PACKAGE_VERSION@ 101CC = @CC@ 102CCLD = @CCLD@ 103CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ 104CFLAGS_WARNING = @CFLAGS_WARNING@ 105EXEEXT = @EXEEXT@ 106LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ 107MAKE_LIB = @MAKE_LIB@ 108MAKE_STUB_LIB = @MAKE_STUB_LIB@ 109OBJEXT = @OBJEXT@ 110RANLIB = @RANLIB@ 111RANLIB_STUB = @RANLIB_STUB@ 112SHLIB_CFLAGS = @SHLIB_CFLAGS@ 113SHLIB_LD = @SHLIB_LD@ 114SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ 115STLIB_LD = @STLIB_LD@ 116#TCL_DEFS = @TCL_DEFS@ 117TCL_BIN_DIR = @TCL_BIN_DIR@ 118TCL_SRC_DIR = @TCL_SRC_DIR@ 119#TK_BIN_DIR = @TK_BIN_DIR@ 120#TK_SRC_DIR = @TK_SRC_DIR@ 121 122# Not used, but retained for reference of what libs Tcl required 123#TCL_LIBS = @TCL_LIBS@ 124 125#======================================================================== 126# TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our 127# package without installing. The other environment variables allow us 128# to test against an uninstalled Tcl. Add special env vars that you 129# require for testing here (like TCLX_LIBRARY). 130#======================================================================== 131 132EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) 133#EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR):$(TK_BIN_DIR) 134TCLLIBPATH = $(top_builddir) 135TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` 136PKG_ENV = @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ 137 PATH="$(EXTRA_PATH):$(PATH)" \ 138 TCLLIBPATH="$(TCLLIBPATH)" 139 140TCLSH_PROG = @TCLSH_PROG@ 141TCLSH = $(TCLSH_ENV) $(PKG_ENV) $(TCLSH_PROG) 142 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) 146 147SHARED_BUILD = @SHARED_BUILD@ 148 149INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ -I. -I$(srcdir)/.. 150#INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@ 151 152PKG_CFLAGS = @PKG_CFLAGS@ 153 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 158# compiled with. 159#DEFS = $(TCL_DEFS) @DEFS@ $(PKG_CFLAGS) 160DEFS = @DEFS@ $(PKG_CFLAGS) 161 162# Move pkgIndex.tcl to 'BINARIES' var if it is generated in the Makefile 163CONFIG_CLEAN_FILES = Makefile pkgIndex.tcl 164CLEANFILES = @CLEANFILES@ 165 166CPPFLAGS = @CPPFLAGS@ 167LIBS = @PKG_LIBS@ @LIBS@ 168AR = @AR@ 169CFLAGS = @CFLAGS@ 170LDFLAGS = @LDFLAGS@ 171LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ 172COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) \ 173 $(CFLAGS_DEFAULT) $(CFLAGS_WARNING) $(SHLIB_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 180.SUFFIXES: .c .$(OBJEXT) 181 182#======================================================================== 183# Start of user-definable TARGETS section 184#======================================================================== 185 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#======================================================================== 193 194all: binaries libraries doc 195 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#======================================================================== 202 203binaries: $(BINARIES) 204 205libraries: 206 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#======================================================================== 212 213doc: 214 @echo "If you have documentation to create, place the commands to" 215 @echo "build the docs in the 'doc:' target. For example:" 216 @echo " xml2nroff sample.xml > sample.n" 217 @echo " xml2html sample.xml > sample.html" 218 219install: all install-binaries install-libraries install-doc 220 221install-binaries: binaries install-lib-binaries install-bin-binaries 222 223#======================================================================== 224# This rule installs platform-independent files, such as header files. 225# The list=...; for p in $$list handles the empty list case x-platform. 226#======================================================================== 227 228install-libraries: libraries 229 @$(INSTALL_DATA_DIR) "$(DESTDIR)$(includedir)" 230 @echo "Installing header files in $(DESTDIR)$(includedir)" 231 @list='$(PKG_HEADERS)'; for i in $$list; do \ 232 echo "Installing $(srcdir)/$$i" ; \ 233 $(INSTALL_DATA) $(srcdir)/$$i "$(DESTDIR)$(includedir)" ; \ 234 done; 235 236#======================================================================== 237# Install documentation. Unix manpages should go in the $(mandir) 238# directory. 239#======================================================================== 240 241install-doc: doc 242 @$(INSTALL_DATA_DIR) "$(DESTDIR)$(mandir)/mann" 243 @echo "Installing documentation in $(DESTDIR)$(mandir)" 244 @list='$(srcdir)/doc/*.n'; for i in $$list; do \ 245 echo "Installing $$i"; \ 246 $(INSTALL_DATA) $$i "$(DESTDIR)$(mandir)/mann" ; \ 247 done 248 249test: binaries libraries 250 @echo "SQLite TEA distribution does not include tests" 251 252shell: binaries libraries 253 @$(TCLSH) $(SCRIPT) 254 255gdb: 256 $(TCLSH_ENV) $(PKG_ENV) $(GDB) $(TCLSH_PROG) $(SCRIPT) 257 258gdb-test: binaries libraries 259 $(TCLSH_ENV) $(PKG_ENV) $(GDB) \ 260 --args $(TCLSH_PROG) `@CYGPATH@ $(srcdir)/tests/all.tcl` \ 261 $(TESTFLAGS) -singleproc 1 \ 262 -load "package ifneeded $(PACKAGE_NAME) $(PACKAGE_VERSION) \ 263 [list load `@CYGPATH@ $(PKG_LIB_FILE)` [string totitle $(PACKAGE_NAME)]]" 264 265valgrind: binaries libraries 266 $(TCLSH_ENV) $(PKG_ENV) $(VALGRIND) $(VALGRINDARGS) $(TCLSH_PROG) \ 267 `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) 268 269valgrindshell: binaries libraries 270 $(TCLSH_ENV) $(PKG_ENV) $(VALGRIND) $(VALGRINDARGS) $(TCLSH_PROG) $(SCRIPT) 271 272depend: 273 274#======================================================================== 275# $(PKG_LIB_FILE) should be listed as part of the BINARIES variable 276# mentioned above. That will ensure that this target is built when you 277# run "make binaries". 278# 279# The $(PKG_OBJECTS) objects are created and linked into the final 280# library. In most cases these object files will correspond to the 281# source files above. 282#======================================================================== 283 284$(PKG_LIB_FILE): $(PKG_OBJECTS) 285 -rm -f $(PKG_LIB_FILE) 286 ${MAKE_LIB} 287 $(RANLIB) $(PKG_LIB_FILE) 288 289$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) 290 -rm -f $(PKG_STUB_LIB_FILE) 291 ${MAKE_STUB_LIB} 292 $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) 293 294#======================================================================== 295# We need to enumerate the list of .c to .o lines here. 296# 297# In the following lines, $(srcdir) refers to the toplevel directory 298# containing your extension. If your sources are in a subdirectory, 299# you will have to modify the paths to reflect this: 300# 301# sample.$(OBJEXT): $(srcdir)/generic/sample.c 302# $(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/sample.c` -o $@ 303# 304# Setting the VPATH variable to a list of paths will cause the makefile 305# to look into these paths when resolving .c to .obj dependencies. 306# As necessary, add $(srcdir):$(srcdir)/compat:.... 307#======================================================================== 308 309VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win:$(srcdir)/macosx 310 311.c.@OBJEXT@: 312 $(COMPILE) -c `@CYGPATH@ $<` -o $@ 313 314tclsample.@OBJEXT@: sampleUuid.h 315 316$(srcdir)/manifest.uuid: 317 printf "git-" >$(srcdir)/manifest.uuid 318 (cd $(srcdir); git rev-parse HEAD >>$(srcdir)/manifest.uuid || \ 319 (printf "svn-r" >$(srcdir)/manifest.uuid ; \ 320 svn info --show-item last-changed-revision >>$(srcdir)/manifest.uuid) || \ 321 printf "unknown" >$(srcdir)/manifest.uuid) 322 323sampleUuid.h: $(srcdir)/manifest.uuid 324 echo "#define SAMPLE_VERSION_UUID \\" >$@ 325 cat $(srcdir)/manifest.uuid >>$@ 326 echo "" >>$@ 327 328#======================================================================== 329# Distribution creation 330# You may need to tweak this target to make it work correctly. 331#======================================================================== 332 333#COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar 334COMPRESS = tar zcvf $(PKG_DIR).tar.gz $(PKG_DIR) 335DIST_ROOT = /tmp/dist 336DIST_DIR = $(DIST_ROOT)/$(PKG_DIR) 337 338DIST_INSTALL_DATA = CPPROG='cp -p' $(INSTALL) -m 644 339DIST_INSTALL_SCRIPT = CPPROG='cp -p' $(INSTALL) -m 755 340 341dist-clean: 342 rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.* 343 344dist: dist-clean $(srcdir)/manifest.uuid 345 $(INSTALL_DATA_DIR) $(DIST_DIR) 346 347 # TEA files 348 $(DIST_INSTALL_DATA) $(srcdir)/Makefile.in \ 349 $(srcdir)/aclocal.m4 $(srcdir)/configure.ac \ 350 $(DIST_DIR)/ 351 $(DIST_INSTALL_SCRIPT) $(srcdir)/configure $(DIST_DIR)/ 352 353 $(INSTALL_DATA_DIR) $(DIST_DIR)/tclconfig 354 $(DIST_INSTALL_DATA) $(srcdir)/tclconfig/README.txt \ 355 $(srcdir)/manifest.uuid \ 356 $(srcdir)/tclconfig/tcl.m4 $(srcdir)/tclconfig/install-sh \ 357 $(DIST_DIR)/tclconfig/ 358 359 # Extension files 360 $(DIST_INSTALL_DATA) \ 361 $(srcdir)/ChangeLog \ 362 $(srcdir)/README.sha \ 363 $(srcdir)/license.terms \ 364 $(srcdir)/README \ 365 $(srcdir)/pkgIndex.tcl.in \ 366 $(DIST_DIR)/ 367 368 list='demos doc generic library macosx tests unix win'; \ 369 for p in $$list; do \ 370 if test -d $(srcdir)/$$p ; then \ 371 $(INSTALL_DATA_DIR) $(DIST_DIR)/$$p; \ 372 $(DIST_INSTALL_DATA) $(srcdir)/$$p/* $(DIST_DIR)/$$p/; \ 373 fi; \ 374 done 375 376 (cd $(DIST_ROOT); $(COMPRESS);) 377 378#======================================================================== 379# End of user-definable section 380#======================================================================== 381 382#======================================================================== 383# Don't modify the file to clean here. Instead, set the "CLEANFILES" 384# variable in configure.ac 385#======================================================================== 386 387clean: 388 -test -z "$(BINARIES)" || rm -f $(BINARIES) 389 -rm -f *.$(OBJEXT) core *.core 390 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 391 392distclean: clean 393 -rm -f *.tab.c 394 -rm -f $(CONFIG_CLEAN_FILES) 395 -rm -f config.cache config.log config.status 396 397#======================================================================== 398# Install binary object libraries. On Windows this includes both .dll and 399# .lib files. Because the .lib files are not explicitly listed anywhere, 400# we need to deduce their existence from the .dll file of the same name. 401# Library files go into the lib directory. 402# In addition, this will generate the pkgIndex.tcl 403# file in the install location (assuming it can find a usable tclsh shell) 404# 405# You should not have to modify this target. 406#======================================================================== 407 408install-lib-binaries: binaries 409 @$(INSTALL_DATA_DIR) "$(DESTDIR)$(pkglibdir)" 410 @list='$(lib_BINARIES)'; for p in $$list; do \ 411 if test -f $$p; then \ 412 echo " $(INSTALL_LIBRARY) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ 413 $(INSTALL_LIBRARY) $$p "$(DESTDIR)$(pkglibdir)/$$p"; \ 414 ext=`echo $$p|sed -e "s/.*\.//"`; \ 415 if test "x$$ext" = "xdll"; then \ 416 lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \ 417 if test -f $$lib; then \ 418 echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib"; \ 419 $(INSTALL_DATA) $$lib "$(DESTDIR)$(pkglibdir)/$$lib"; \ 420 fi; \ 421 fi; \ 422 fi; \ 423 done 424 @list='$(PKG_TCL_SOURCES)'; for p in $$list; do \ 425 if test -f $(srcdir)/$$p; then \ 426 destp=`basename $$p`; \ 427 echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \ 428 $(INSTALL_DATA) $(srcdir)/$$p "$(DESTDIR)$(pkglibdir)/$$destp"; \ 429 fi; \ 430 done 431 @if test "x$(SHARED_BUILD)" = "x1"; then \ 432 echo " Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \ 433 $(INSTALL_DATA) pkgIndex.tcl "$(DESTDIR)$(pkglibdir)"; \ 434 fi 435 436#======================================================================== 437# Install binary executables (e.g. .exe files and dependent .dll files) 438# This is for files that must go in the bin directory (located next to 439# wish and tclsh), like dependent .dll files on Windows. 440# 441# You should not have to modify this target, except to define bin_BINARIES 442# above if necessary. 443#======================================================================== 444 445install-bin-binaries: binaries 446 @$(INSTALL_DATA_DIR) "$(DESTDIR)$(bindir)" 447 @list='$(bin_BINARIES)'; for p in $$list; do \ 448 if test -f $$p; then \ 449 echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \ 450 $(INSTALL_PROGRAM) $$p "$(DESTDIR)$(bindir)/$$p"; \ 451 fi; \ 452 done 453 454Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 455 cd $(top_builddir) \ 456 && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status 457 458uninstall-binaries: 459 list='$(lib_BINARIES)'; for p in $$list; do \ 460 rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ 461 done 462 list='$(PKG_TCL_SOURCES)'; for p in $$list; do \ 463 p=`basename $$p`; \ 464 rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ 465 done 466 list='$(bin_BINARIES)'; for p in $$list; do \ 467 rm -f "$(DESTDIR)$(bindir)/$$p"; \ 468 done 469 470.PHONY: all binaries clean depend distclean doc install libraries test 471.PHONY: gdb gdb-test valgrind valgrindshell 472 473# Tell versions [3.59,3.63) of GNU make to not export all variables. 474# Otherwise a system limit (for SysV at least) may be exceeded. 475.NOEXPORT: 476