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-2004 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.
17 #========================================================================
18 # The names of the source files is defined in the configure script.
19 # The object files are used for linking into the final library.
20 # This will be used when a dist target is added to the Makefile.
21 # It is not important to specify the directory, as long as it is the
22 # $(srcdir) or in the generic, win or unix subdirectory.
23 #========================================================================
25 PKG_SOURCES = @PKG_SOURCES@
26 PKG_OBJECTS = @PKG_OBJECTS@
28 PKG_STUB_SOURCES = @PKG_STUB_SOURCES@
29 PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@
31 #========================================================================
32 # PKG_TCL_SOURCES identifies Tcl runtime files that are associated with
33 # this package that need to be installed, if any.
34 #========================================================================
36 PKG_TCL_SOURCES = @PKG_TCL_SOURCES@
38 #========================================================================
39 # This is a list of header files to be installed
40 # itk.h includes itclInt.h, which needs itclIntDecls.h,
41 # so we must install them.
42 #========================================================================
44 PKG_HEADERS = @PKG_HEADERS@
46 #========================================================================
47 # Nothing of the variables below this line need to be changed. Please
48 # check the TARGETS section below to make sure the make targets are
50 #========================================================================
52 #========================================================================
53 # Change the name of the variable "exampleA_LIB_FILE" to match the one
54 # used in the configure script. This is the parameterized name of the
55 # library that we are building.
56 #========================================================================
58 PKG_LIB_FILE = @PKG_LIB_FILE@
59 PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@
61 lib_BINARIES = $(PKG_LIB_FILE) $(PKG_STUB_LIB_FILE)
62 BINARIES = $(lib_BINARIES)
68 exec_prefix = @exec_prefix@
74 includedir = @includedir@
78 PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION)
79 pkgdatadir = $(datadir)/$(PKG_DIR)
80 pkglibdir = $(libdir)/$(PKG_DIR)
81 pkgincludedir = $(includedir)/$(PKG_DIR)
86 INSTALL_PROGRAM = @INSTALL_PROGRAM@
87 INSTALL_DATA = @INSTALL_DATA@
88 INSTALL_SCRIPT = @INSTALL_SCRIPT@
90 PACKAGE_NAME = @PACKAGE_NAME@
91 PACKAGE_VERSION = @PACKAGE_VERSION@
93 CFLAGS_DEFAULT = @CFLAGS_DEFAULT@
94 CFLAGS_WARNING = @CFLAGS_WARNING@
95 CLEANFILES = @CLEANFILES@
97 LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@
99 MAKE_SHARED_LIB = @MAKE_SHARED_LIB@
100 MAKE_STATIC_LIB = @MAKE_STATIC_LIB@
101 MAKE_STUB_LIB = @MAKE_STUB_LIB@
103 RANLIB_LIB = @RANLIB@
104 RANLIB_STUB = @RANLIB_STUB@
105 SHLIB_CFLAGS = @SHLIB_CFLAGS@
106 SHLIB_LD = @SHLIB_LD@
107 SHLIB_LD_FLAGS = @SHLIB_LD_FLAGS@
108 SHLIB_LD_LIBS = @SHLIB_LD_LIBS@
109 STLIB_LD = @STLIB_LD@
110 TCL_DEFS = @TCL_DEFS@
111 TCL_BIN_DIR = @TCL_BIN_DIR@
112 TCL_SRC_DIR = @TCL_SRC_DIR@
113 # This is necessary for packages that use private Tcl headers
114 TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@
116 # Not used, but retained for reference of what libs Tcl required
117 TCL_LIBS = @TCL_LIBS@
119 #========================================================================
120 # TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our
121 # package without installing. The other environment variables allow us
122 # to test against an uninstalled Tcl. Add special env vars that you
123 # require for testing here (like TCLX_LIBRARY).
124 #========================================================================
126 EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR)
127 TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \
128 ITCL_LIBRARY=`@CYGPATH@ $(srcdir)/library` \
129 @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \
130 PATH="$(EXTRA_PATH):$(PATH)" \
131 TCLLIBPATH="$(top_builddir)"
132 TCLSH_PROG = @TCLSH_PROG@
133 TCLSH = $(TCLSH_ENV) $(TCLSH_PROG)
134 SHARED_BUILD = @SHARED_BUILD@
136 INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@
138 PKG_CFLAGS = @PKG_CFLAGS@
140 DEFS = @DEFS@ $(PKG_CFLAGS) \
141 -DITCL_LIBRARY=\"$(pkglibdir)\" -DUSE_NON_CONST
143 CONFIG_CLEAN_FILES = @CONFIG_CLEAN_FILES@ Makefile itclConfig.sh pkgIndex.tcl
145 CPPFLAGS = @CPPFLAGS@
146 LIBS = @PKG_LIBS@ @LIBS@
148 ITCL_CFLAGS = @CFLAGS@
149 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(ITCL_CFLAGS)
151 #========================================================================
152 # Start of user-definable TARGETS section
153 #========================================================================
155 #========================================================================
156 # TEA TARGETS. Please note that the "libraries:" target refers to platform
157 # independent files, and the "binaries:" target inclues executable programs and
158 # platform-dependent libraries. Modify these targets so that they install
159 # the various pieces of your package. The make and install rules
160 # for the BINARIES that you specified above have already been done.
161 #========================================================================
163 all: binaries libraries doc
165 #========================================================================
166 # The binaries target builds executable programs, Windows .dll's, unix
167 # shared/static libraries, and any other platform-dependent files.
168 # The list of targets to build for "binaries:" is specified at the top
169 # of the Makefile, in the "BINARIES" variable.
170 #========================================================================
172 binaries: $(BINARIES)
178 install: all install-binaries install-libraries install-doc
180 install-binaries: binaries install-lib-binaries install-bin-binaries
182 #========================================================================
183 # This rule installs platform-independent files, such as header files.
184 #========================================================================
186 install-libraries: libraries
187 @mkdir -p $(DESTDIR)$(includedir)
188 @echo "Installing header files in $(DESTDIR)$(includedir)"
189 @list='$(PKG_HEADERS)'; for i in $$list; do \
190 echo "Installing $(srcdir)/$$i" ; \
191 $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \
194 #========================================================================
195 # Install documentation. Unix manpages should go in the $(mandir)
197 #========================================================================
200 @mkdir -p $(DESTDIR)$(mandir)/mann
201 @echo "Installing man pages in $(DESTDIR)$(mandir)"
202 @cd $(srcdir)/doc; for i in *.n; do \
203 echo "Installing $$i"; \
204 rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \
205 sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
206 $$i > $(DESTDIR)$(mandir)/mann/$$i; \
207 chmod 444 $(DESTDIR)$(mandir)/mann/$$i; \
210 test: binaries libraries
211 $(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` -load "package require Itcl" $(TESTFLAGS)
213 shell: binaries libraries
217 $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT)
221 #========================================================================
222 # $(PKG_LIB_FILE) should be listed as part of the BINARIES variable
223 # mentioned above. That will ensure that this target is built when you
224 # run "make binaries".
226 # The $(PKG_OBJECTS) objects are created and linked into the final
227 # library. In most cases these object files will correspond to the
228 # source files above.
229 #========================================================================
231 $(PKG_LIB_FILE): $(PKG_OBJECTS)
232 -rm -f $(PKG_LIB_FILE)
234 $(RANLIB_LIB) $(PKG_LIB_FILE)
236 $(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS)
237 -rm -f $(PKG_STUB_LIB_FILE)
239 $(RANLIB_STUB) $(PKG_STUB_LIB_FILE)
241 #========================================================================
242 # We need to enumerate the list of .c to .o lines here.
244 # In the following lines, $(srcdir) refers to the toplevel directory
245 # containing your extension. If your sources are in a subdirectory,
246 # you will have to modify the paths to reflect this:
248 # exampleA.$(OBJEXT): $(srcdir)/generic/exampleA.c
249 # $(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/exampleA.c` -o $@
251 # Setting the VPATH variable to a list of paths will cause the makefile
252 # to look into these paths when resolving .c to .obj dependencies.
253 # As necessary, add $(srcdir):$(srcdir)/compat:....
254 #========================================================================
256 VPATH = $(srcdir)/unix:$(srcdir)/generic:$(srcdir)/win
259 $(COMPILE) -c `@CYGPATH@ $<` -o $@
261 #========================================================================
262 # Distribution creation
263 # You may need to tweak this target to make it work correctly.
264 #========================================================================
266 #COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar
267 COMPRESS = gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR)
268 DIST_ROOT = /tmp/dist
269 DIST_DIR = $(DIST_ROOT)/$(PKG_DIR)
272 rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.*
276 cp -p $(srcdir)/license* $(srcdir)/aclocal.m4 $(srcdir)/configure \
277 $(srcdir)/*.in $(DIST_DIR)/
278 chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4
279 chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in
281 mkdir $(DIST_DIR)/tclconfig
282 cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \
283 $(DIST_DIR)/tclconfig/
284 chmod 664 $(DIST_DIR)/tclconfig/tcl.m4
285 chmod +x $(DIST_DIR)/tclconfig/install-sh
287 list='doc generic library tests tests/old win win/rc'; \
288 for p in $$list; do \
289 if test -d $(srcdir)/$$p ; then \
290 mkdir $(DIST_DIR)/$$p; \
291 for q in $(srcdir)/$$p/*; do \
292 if test -f $$q ; then \
293 cp -p $$q $(DIST_DIR)/$$p/; \
299 list='CHANGES ChangeLog INCOMPATIBLE README TODO'; \
300 for p in $$list; do \
301 if test -f $(srcdir)/../$$p ; then \
302 cp -p $(srcdir)/../$$p $(DIST_DIR)/; \
306 (cd $(DIST_ROOT); $(COMPRESS);)
308 #========================================================================
309 # End of user-definable section
310 #========================================================================
312 #========================================================================
313 # Don't modify the file to clean here. Instead, set the "CLEANFILES"
314 # variable in configure.in
315 #========================================================================
318 -test -z "$(BINARIES)" || rm -f $(BINARIES)
319 -rm -f *.o core *.core
321 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
325 -rm -f $(CONFIG_CLEAN_FILES)
326 -rm -f config.cache config.log config.status
328 #========================================================================
329 # Install binary object libraries. On Windows this includes both .dll and
330 # .lib files. Because the .lib files are not explicitly listed anywhere,
331 # we need to deduce their existence from the .dll file of the same name.
332 # Additionally, the .dll files go into the bin directory, but the .lib
333 # files go into the lib directory. On Unix platforms, all library files
334 # go into the lib directory. In addition, this will generate the pkgIndex.tcl
335 # file in the install location (assuming it can find a usable tclsh8.2 shell)
337 # You should not have to modify this target.
338 #========================================================================
340 install-lib-binaries:
341 @mkdir -p $(DESTDIR)$(pkglibdir)
342 @list='$(lib_BINARIES)'; for p in $$list; do \
343 if test -f $$p; then \
344 echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \
345 $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \
346 stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \
347 if test "x$$stub" = "xstub"; then \
348 echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \
349 $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \
351 echo " $(RANLIB_LIB) $(DESTDIR)$(pkglibdir)/$$p"; \
352 $(RANLIB_LIB) $(DESTDIR)$(pkglibdir)/$$p; \
354 ext=`echo $$p|sed -e "s/.*\.//"`; \
355 if test "x$$ext" = "xdll"; then \
356 lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \
357 if test -f $$lib; then \
358 echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib"; \
359 $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib; \
364 @list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
365 if test -f $(srcdir)/$$p; then \
366 destp=`basename $$p`; \
367 echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \
368 $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkglibdir)/$$destp; \
371 $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir)
372 $(INSTALL_DATA) itclConfig.sh $(DESTDIR)$(libdir)
374 #========================================================================
375 # Install binary executables (e.g. .exe files)
377 # You should not have to modify this target.
378 #========================================================================
380 install-bin-binaries:
381 @mkdir -p $(DESTDIR)$(bindir)
382 @list='$(bin_BINARIES)'; for p in $$list; do \
383 if test -f $$p; then \
384 echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \
385 $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \
389 .SUFFIXES: .c .$(OBJEXT)
391 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
393 && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
396 list='$(lib_BINARIES)'; for p in $$list; do \
397 rm -f $(DESTDIR)$(pkglibdir)/$$p; \
399 list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
401 rm -f $(DESTDIR)$(pkglibdir)/$$p; \
403 list='$(bin_BINARIES)'; for p in $$list; do \
404 rm -f $(DESTDIR)$(bindir)/$$p; \
407 .PHONY: all binaries clean depend distclean doc install libraries test
409 # Tell versions [3.59,3.63) of GNU make to not export all variables.
410 # Otherwise a system limit (for SysV at least) may be exceeded.