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
)
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@
103 CFLAGS_DEFAULT
= @CFLAGS_DEFAULT@
104 CFLAGS_WARNING
= @CFLAGS_WARNING@
106 LDFLAGS_DEFAULT
= @LDFLAGS_DEFAULT@
107 MAKE_LIB
= @MAKE_LIB@
108 MAKE_STUB_LIB
= @MAKE_STUB_LIB@
111 RANLIB_STUB
= @RANLIB_STUB@
112 SHLIB_CFLAGS
= @SHLIB_CFLAGS@
113 SHLIB_LD
= @SHLIB_LD@
114 SHLIB_LD_LIBS
= @SHLIB_LD_LIBS@
115 STLIB_LD
= @STLIB_LD@
116 #TCL_DEFS = @TCL_DEFS@
117 TCL_BIN_DIR
= @TCL_BIN_DIR@
118 TCL_SRC_DIR
= @TCL_SRC_DIR@
119 #TK_BIN_DIR = @TK_BIN_DIR@
120 #TK_SRC_DIR = @TK_SRC_DIR@
122 # Not used, but retained for reference of what libs Tcl required
123 #TCL_LIBS = @TCL_LIBS@
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 #========================================================================
132 EXTRA_PATH
= $(top_builddir
):$(TCL_BIN_DIR
)
133 #EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR):$(TK_BIN_DIR)
134 TCLLIBPATH
= $(top_builddir
)
135 TCLSH_ENV
= TCL_LIBRARY
=`@CYGPATH@ $(TCL_SRC_DIR)/library`
136 PKG_ENV
= @LD_LIBRARY_PATH_VAR@
="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \
137 PATH
="$(EXTRA_PATH):$(PATH)" \
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@
-I.
-I
$(srcdir)/..
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
)
162 # Move pkgIndex.tcl to 'BINARIES' var if it is generated in the Makefile
163 CONFIG_CLEAN_FILES
= Makefile pkgIndex.tcl
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 #========================================================================
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"
219 install: all install-binaries install-libraries install-doc
221 install-binaries
: binaries install-lib-binaries install-bin-binaries
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 #========================================================================
228 install-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)" ; \
236 #========================================================================
237 # Install documentation. Unix manpages should go in the $(mandir)
239 #========================================================================
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" ; \
249 test: binaries libraries
250 @echo
"SQLite TEA distribution does not include tests"
252 shell: binaries libraries
256 $(TCLSH_ENV
) $(PKG_ENV
) $(GDB
) $(TCLSH_PROG
) $(SCRIPT
)
258 gdb-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)]]"
265 valgrind
: binaries libraries
266 $(TCLSH_ENV
) $(PKG_ENV
) $(VALGRIND
) $(VALGRINDARGS
) $(TCLSH_PROG
) \
267 `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS
)
269 valgrindshell
: binaries libraries
270 $(TCLSH_ENV
) $(PKG_ENV
) $(VALGRIND
) $(VALGRINDARGS
) $(TCLSH_PROG
) $(SCRIPT
)
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".
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 #========================================================================
284 $(PKG_LIB_FILE
): $(PKG_OBJECTS
)
285 -rm -f
$(PKG_LIB_FILE
)
287 $(RANLIB
) $(PKG_LIB_FILE
)
289 $(PKG_STUB_LIB_FILE
): $(PKG_STUB_OBJECTS
)
290 -rm -f
$(PKG_STUB_LIB_FILE
)
292 $(RANLIB_STUB
) $(PKG_STUB_LIB_FILE
)
294 #========================================================================
295 # We need to enumerate the list of .c to .o lines here.
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:
301 # sample.$(OBJEXT): $(srcdir)/generic/sample.c
302 # $(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/sample.c` -o $@
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 #========================================================================
309 VPATH
= $(srcdir):$(srcdir)/generic
:$(srcdir)/unix
:$(srcdir)/win
:$(srcdir)/macosx
312 $(COMPILE
) -c
`@CYGPATH@ $<` -o
$@
314 tclsample.@OBJEXT@
: sampleUuid.h
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
)
323 sampleUuid.h
: $(srcdir)/manifest.uuid
324 echo
"#define SAMPLE_VERSION_UUID \\" >$@
325 cat
$(srcdir)/manifest.uuid
>>$@
328 #========================================================================
329 # Distribution creation
330 # You may need to tweak this target to make it work correctly.
331 #========================================================================
333 #COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar
334 COMPRESS
= tar zcvf
$(PKG_DIR
).
tar.gz
$(PKG_DIR
)
335 DIST_ROOT
= /tmp
/dist
336 DIST_DIR
= $(DIST_ROOT
)/$(PKG_DIR
)
338 DIST_INSTALL_DATA
= CPPROG
='cp -p' $(INSTALL
) -m
644
339 DIST_INSTALL_SCRIPT
= CPPROG
='cp -p' $(INSTALL
) -m
755
342 rm -rf
$(DIST_DIR
) $(DIST_ROOT
)/$(PKG_DIR
).
tar.
*
344 dist: dist-clean
$(srcdir)/manifest.uuid
345 $(INSTALL_DATA_DIR
) $(DIST_DIR
)
348 $(DIST_INSTALL_DATA
) $(srcdir)/Makefile.in \
349 $(srcdir)/aclocal.m4
$(srcdir)/configure.ac \
351 $(DIST_INSTALL_SCRIPT
) $(srcdir)/configure
$(DIST_DIR
)/
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
/
360 $(DIST_INSTALL_DATA
) \
361 $(srcdir)/ChangeLog \
362 $(srcdir)/README.sha \
363 $(srcdir)/license.terms \
365 $(srcdir)/pkgIndex.tcl.in \
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/; \
376 (cd
$(DIST_ROOT
); $(COMPRESS
);)
378 #========================================================================
379 # End of user-definable section
380 #========================================================================
382 #========================================================================
383 # Don't modify the file to clean here. Instead, set the "CLEANFILES"
384 # variable in configure.ac
385 #========================================================================
388 -test -z
"$(BINARIES)" ||
rm -f
$(BINARIES
)
389 -rm -f
*.
$(OBJEXT
) core
*.core
390 -test -z
"$(CLEANFILES)" ||
rm -f
$(CLEANFILES
)
394 -rm -f
$(CONFIG_CLEAN_FILES
)
395 -rm -f config.cache config.log config.status
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)
405 # You should not have to modify this target.
406 #========================================================================
408 install-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"; \
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"; \
431 @if
test "x$(SHARED_BUILD)" = "x1"; then \
432 echo
" Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \
433 $(INSTALL_DATA
) pkgIndex.tcl
"$(DESTDIR)$(pkglibdir)"; \
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.
441 # You should not have to modify this target, except to define bin_BINARIES
442 # above if necessary.
443 #========================================================================
445 install-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"; \
454 Makefile
: $(srcdir)/Makefile.in
$(top_builddir
)/config.status
456 && CONFIG_FILES
=$@ CONFIG_HEADERS
= $(SHELL
) .
/config.status
459 list
='$(lib_BINARIES)'; for p in
$$list; do \
460 rm -f
"$(DESTDIR)$(pkglibdir)/$$p"; \
462 list
='$(PKG_TCL_SOURCES)'; for p in
$$list; do \
464 rm -f
"$(DESTDIR)$(pkglibdir)/$$p"; \
466 list
='$(bin_BINARIES)'; for p in
$$list; do \
467 rm -f
"$(DESTDIR)$(bindir)/$$p"; \
470 .PHONY
: all binaries
clean depend
distclean doc
install libraries
test
471 .PHONY
: gdb gdb-test valgrind valgrindshell
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.