1# Makefile.in --
2#
3#	This file is a Makefile for tkimg 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#========================================================================
17# Add additional lines to handle any additional AC_SUBST cases that
18# have been added in a customized configure script.
19#========================================================================
20
21PACKAGE_TCLNAME = @PACKAGE_TCLNAME@
22
23#========================================================================
24# Nothing of the variables below this line should need to be changed.
25# Please check the TARGETS section below to make sure the make targets
26# are correct.
27#========================================================================
28
29#========================================================================
30# The names of the source files is defined in the configure script.
31# The object files are used for linking into the final library.
32# This will be used when a dist target is added to the Makefile.
33# It is not important to specify the directory, as long as it is the
34# $(srcdir) or in the generic, win or unix subdirectory.
35#========================================================================
36
37PKG_SOURCES	= @PKG_SOURCES@
38PKG_OBJECTS	= @PKG_OBJECTS@
39
40PKG_STUB_SOURCES = @PKG_STUB_SOURCES@
41PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@
42
43#========================================================================
44# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with
45# this package that need to be installed, if any.
46#========================================================================
47
48PKG_TCL_SOURCES = @PKG_TCL_SOURCES@
49
50#========================================================================
51# This is a list of public header files to be installed, if any.
52#========================================================================
53
54PKG_HEADERS	= @PKG_HEADERS@
55
56#========================================================================
57# "PKG_LIB_FILE" refers to the library (dynamic or static as per
58# configuration options) composed of the named objects.
59#========================================================================
60
61PKG_LIB_FILE	= @PKG_LIB_FILE@
62PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@
63
64lib_BINARIES	= $(PKG_LIB_FILE) $(PKG_STUB_LIB_FILE)
65BINARIES	= $(lib_BINARIES)
66
67SHELL		= @SHELL@
68
69srcdir		= @srcdir@
70prefix		= @prefix@
71exec_prefix	= @exec_prefix@
72
73bindir		= @bindir@
74libdir		= @libdir@
75includedir	= @includedir@
76datarootdir     = @datarootdir@
77datadir		= @datadir@
78mandir		= @mandir@
79
80DESTDIR		=
81
82PKG_DIR		= $(PACKAGE_NAME)$(PACKAGE_VERSION)
83pkgdatadir	= $(datadir)/$(PKG_DIR)
84pkglibdir	= $(libdir)/$(PKG_DIR)
85pkgincludedir	= $(includedir)/$(PKG_DIR)
86
87top_builddir	= .
88
89INSTALL_OPTIONS =
90INSTALL		= $(SHELL) $(srcdir)/../tclconfig/install-sh -c ${INSTALL_OPTIONS}
91INSTALL_DATA_DIR = ${INSTALL} -d -m 755
92INSTALL_PROGRAM	= ${INSTALL} -m 755
93INSTALL_DATA	= ${INSTALL} -m 644
94INSTALL_SCRIPT	= ${INSTALL_PROGRAM}
95INSTALL_LIBRARY	= ${INSTALL_DATA}
96
97PACKAGE_NAME	= @PACKAGE_NAME@
98PACKAGE_VERSION	= @PACKAGE_VERSION@
99CC		= @CC@
100CFLAGS_DEFAULT	= @CFLAGS_DEFAULT@
101CFLAGS_WARNING	= @CFLAGS_WARNING@
102CLEANFILES	= @CLEANFILES@
103EXEEXT		= @EXEEXT@
104LDFLAGS_DEFAULT	= @LDFLAGS_DEFAULT@
105MAKE_LIB	= @MAKE_LIB@
106MAKE_SHARED_LIB	= @MAKE_SHARED_LIB@
107MAKE_STATIC_LIB	= @MAKE_STATIC_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_FLAGS	= @SHLIB_LD_FLAGS@
115SHLIB_LD_LIBS	= @SHLIB_LD_LIBS@
116STLIB_LD	= @STLIB_LD@
117TCL_BIN_DIR	= @TCL_BIN_DIR@
118TCL_DEFS	= @TCL_DEFS@
119TCL_SRC_DIR	= @TCL_SRC_DIR@
120TK_BIN_DIR	= @TK_BIN_DIR@
121TK_SRC_DIR	= @TK_SRC_DIR@
122
123# This is necessary for packages that use private Tcl headers
124TCL_TOP_DIR_NATIVE	= @TCL_TOP_DIR_NATIVE@
125
126# Not used, but retained for reference of what libs Tcl required
127TCL_LIBS	= @TCL_LIBS@
128TK_LIBS		= @TK_LIBS@
129
130#========================================================================
131# TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our
132# package without installing.  The other environment variables allow us
133# to test against an uninstalled Tcl.  Add special env vars that you
134# require for testing here (like TCLX_LIBRARY).
135#========================================================================
136
137EXTRA_PATH	= $(top_builddir):$(TCL_BIN_DIR):$(TK_BIN_DIR)
138TCLSH_ENV	= TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \
139		  TK_LIBRARY=`@CYGPATH@ $(TK_SRC_DIR)/library` \
140		  @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \
141		  PATH="$(EXTRA_PATH):$(PATH)" \
142		  TCLLIBPATH="$(libdir)"
143TCLSH_PROG	= @TCLSH_PROG@
144WISH_PROG	= @WISH_PROG@
145TCLSH		= $(TCLSH_ENV) $(TCLSH_PROG)
146WISH		= $(TCLSH_ENV) $(WISH_PROG)
147SHARED_BUILD	= @SHARED_BUILD@
148
149# The local includes must come first, because the TK_XINCLUDES can be
150# just a comment
151
152INCLUDES	= @PKG_INCLUDES@ \
153		  @TK_INCLUDES@ @TCL_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
165CONFIG_CLEAN_FILES = Makefile
166
167CPPFLAGS	= @CPPFLAGS@ -DPACKAGE_TCLNAME=\"$(PACKAGE_TCLNAME)\"
168LIBS		= @PKG_LIBS@ @LIBS@
169AR		= @AR@
170CFLAGS		= @CFLAGS@ -DTKIMGAPI=MODULE_SCOPE
171COMPILE		= $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
172
173.SUFFIXES: .c .$(OBJEXT)
174
175#========================================================================
176# Start of user-definable TARGETS section
177#========================================================================
178
179#========================================================================
180# TEA TARGETS.  Please note that the "libraries:" target refers to platform
181# independent files, and the "binaries:" target inclues executable programs and
182# platform-dependent libraries.  Modify these targets so that they install
183# the various pieces of your package.  The make and install rules
184# for the BINARIES that you specified above have already been done.
185#========================================================================
186
187all: binaries libraries doc
188
189#========================================================================
190# The binaries target builds executable programs, Windows .dll's, unix
191# shared/static libraries, and any other platform-dependent files.
192# The list of targets to build for "binaries:" is specified at the top
193# of the Makefile, in the "BINARIES" variable.
194#========================================================================
195
196binaries: $(BINARIES)
197
198libraries:
199
200doc:
201
202#	Currently no documentation to create, the HTML is part of the
203#	distribution.
204#	.................................................................
205#	@echo "If you have documentation to create, place the commands to"
206#	@echo "build the docs in the 'doc:' target.  For example:"
207#	@echo "        xml2nroff sample.xml > sample.n"
208#	@echo "        xml2html sample.xml > sample.html"
209
210install: all install-binaries install-libraries install-doc
211
212install-binaries: binaries install-lib-binaries install-bin-binaries
213
214#========================================================================
215# This rule installs platform-independent files, such as header files.
216#========================================================================
217
218install-libraries: libraries
219	@$(INSTALL_DATA_DIR) $(DESTDIR)$(includedir)
220	@echo "Installing header files in $(DESTDIR)$(includedir)"
221	@list='$(PKG_HEADERS)'; for i in $$list; do \
222	    echo "Installing $(srcdir)/$$i" ; \
223	    $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \
224	done;
225
226#========================================================================
227# Install documentation.  Unix manpages should go in the $(mandir)
228# directory.
229#========================================================================
230
231install-doc: doc
232
233#	@$(INSTALL_DATA_DIR) $(DESTDIR)$(mandir)/mann
234#	@echo "Installing documentation in $(DESTDIR)$(mandir)"
235#	@for i in doc/*.n; do \
236#	    echo "Installing $$i"; \
237#	    rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \
238#	    $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \
239#	done
240
241test:
242
243shell: binaries libraries
244	@$(TCLSH) $(SCRIPT)
245
246gdb:
247	$(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT)
248
249depend:
250
251#========================================================================
252# $(PKG_LIB_FILE) should be listed as part of the BINARIES variable
253# mentioned above.  That will ensure that this target is built when you
254# run "make binaries".
255#
256# The $(PKG_OBJECTS) objects are created and linked into the final
257# library.  In most cases these object files will correspond to the
258# source files above.
259#========================================================================
260
261$(PKG_LIB_FILE): $(PKG_OBJECTS)
262	-rm -f $(PKG_LIB_FILE)
263	${MAKE_LIB}
264	$(RANLIB) $(PKG_LIB_FILE)
265
266$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS)
267	-rm -f $(PKG_STUB_LIB_FILE)
268	${MAKE_STUB_LIB}
269	$(RANLIB_STUB) $(PKG_STUB_LIB_FILE)
270
271#========================================================================
272# We need to enumerate the list of .c to .o lines here.
273#
274# In the following lines, $(srcdir) refers to the toplevel directory
275# containing your extension.  If your sources are in a subdirectory,
276# you will have to modify the paths to reflect this:
277#
278# tkimg.$(OBJEXT): $(srcdir)/generic/tkimg.c
279# 	$(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/tkimg.c` -o $@
280#
281# Setting the VPATH variable to a list of paths will cause the makefile
282# to look into these paths when resolving .c to .obj dependencies.
283# As necessary, add $(srcdir):$(srcdir)/compat:....
284#========================================================================
285
286VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win
287
288.c.@OBJEXT@:
289	$(COMPILE) -c `@CYGPATH@ $<` -o $@
290
291#========================================================================
292# Create the pkgIndex.tcl file.
293# It is usually easiest to let Tcl do this for you with pkg_mkIndex, but
294# you may find that you need to customize the package.  If so, either
295# modify the -hand version, or create a pkgIndex.tcl.in file and have
296# the configure script output the pkgIndex.tcl by editing configure.ac.
297#========================================================================
298
299pkgIndex.tcl:
300	( echo pkg_mkIndex . $(PKG_LIB_FILE) \; exit; ) | $(TCLSH)
301
302pkgIndex.tcl-hand:
303	(echo 'package ifneeded $(PACKAGE_TCLNAME) $(PACKAGE_VERSION) \
304	    [list load [file join $$dir $(PKG_LIB_FILE)]]'\
305	) > pkgIndex.tcl
306
307#========================================================================
308# Distribution creation
309# You may need to tweak this target to make it work correctly.
310#========================================================================
311
312#COMPRESS	= tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar
313COMPRESS	= gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR)
314DIST_ROOT	= /tmp/dist
315DIST_DIR	= $(DIST_ROOT)/$(PKG_DIR)
316
317dist-clean:
318	rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.*
319
320dist: dist-clean doc
321	mkdir -p $(DIST_DIR)
322	cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/doc/license* \
323		$(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \
324		$(DIST_DIR)/
325	chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4
326	chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.ac
327
328	mkdir $(DIST_DIR)/tclconfig
329	cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \
330		$(DIST_DIR)/tclconfig/
331	chmod 664 $(DIST_DIR)/tclconfig/tcl.m4
332	chmod +x $(DIST_DIR)/tclconfig/install-sh
333
334	-list='htdocs/art demos generic library mac tests unix win tea.tests tools tools/rules'; \
335	for p in $$list; do \
336	    if test -d $(srcdir)/$$p ; then \
337		mkdir -p $(DIST_DIR)/$$p; \
338		cp -p $(srcdir)/$$p/*.* $(srcdir)/$$p/* $(DIST_DIR)/$$p/; \
339	    fi; \
340	done
341
342	-list='doc'; \
343	for p in $$list; do \
344	    if test -d $$p ; then \
345		mkdir -p $(DIST_DIR)/$$p; \
346		cp -p $$p/*.* $$p/* $(DIST_DIR)/$$p/; \
347	    fi; \
348	done
349	-mv $(DIST_DIR)/htdocs/art $(DIST_DIR)/doc/art
350	rm -rf $(DIST_DIR)/htdocs
351
352	(cd $(DIST_ROOT); $(COMPRESS);)
353
354dist_orig:
355	rm -rf $(PKG_DIR)*
356	ls -d $(srcdir)/* > __FILES
357	mkdir $(PKG_DIR)
358	cp -rf `cat __FILES | grep -v __FILES` $(PKG_DIR)
359	rm __FILES
360	find $(PKG_DIR) -name CVS -prune -exec rm -rf {} \;
361	cd $(PKG_DIR) ; $(TCLSH_PROG) PREPARE
362	-tar cf - $(PKG_DIR) | gzip --best > $(PKG_DIR).tar.gz
363	-tar cf - $(PKG_DIR) | bzip2 > $(PKG_DIR).tar.bz2
364	-zip -r $(PKG_DIR).zip $(PKG_DIR)
365	rm -rf $(PKG_DIR)
366
367#========================================================================
368# End of user-definable section
369#========================================================================
370
371#========================================================================
372# Don't modify the file to clean here.  Instead, set the "CLEANFILES"
373# variable in configure.ac
374#========================================================================
375
376clean:
377	-test -z "$(BINARIES)" || rm -f $(BINARIES)
378	-rm -f *.$(OBJEXT) core *.core
379	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
380
381distclean: clean
382	-rm -f *.tab.c init.c
383	-rm -f $(CONFIG_CLEAN_FILES)
384	-rm -f config.cache config.log config.status
385
386#========================================================================
387# Install binary object libraries.  On Windows this includes both .dll and
388# .lib files.  Because the .lib files are not explicitly listed anywhere,
389# we need to deduce their existence from the .dll file of the same name.
390# Library files go into the lib directory.
391# In addition, this will generate the pkgIndex.tcl
392# file in the install location (assuming it can find a usable tclsh shell)
393#
394# You should not have to modify this target.
395#========================================================================
396
397install-lib-binaries:
398	@$(INSTALL_DATA_DIR) $(DESTDIR)$(pkglibdir)
399	@list='$(lib_BINARIES)'; for p in $$list; do \
400	  if test -f $$p; then \
401	    echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \
402	    $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \
403	    stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \
404	    if test "x$$stub" = "xstub"; then \
405		echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \
406		$(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \
407	    else \
408		echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \
409		$(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \
410	    fi; \
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	$(INSTALL_DATA) tkimgConfig.sh $(DESTDIR)$(libdir)/Img
433
434#========================================================================
435# Install binary executables (e.g. .exe files and dependent .dll files)
436# This is for files that must go in the bin directory (located next to
437# wish and tclsh), like dependent .dll files on Windows.
438#
439# You should not have to modify this target, except to define bin_BINARIES
440# above if necessary.
441#========================================================================
442
443install-bin-binaries:
444	@$(INSTALL_DATA_DIR) $(DESTDIR)$(bindir)
445	@list='$(bin_BINARIES)'; for p in $$list; do \
446	  if test -f $$p; then \
447	    echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \
448	    $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \
449	  fi; \
450	done
451
452Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
453	cd $(top_builddir) \
454	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
455
456uninstall-binaries:
457	list='$(lib_BINARIES)'; for p in $$list; do \
458	  rm -f $(DESTDIR)$(pkglibdir)/$$p; \
459	done
460	list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
461	  p=`basename $$p`; \
462	  rm -f $(DESTDIR)$(pkglibdir)/$$p; \
463	done
464	list='$(bin_BINARIES)'; for p in $$list; do \
465	  rm -f $(DESTDIR)$(bindir)/$$p; \
466	done
467
468#========================================================================
469#
470# Target to regenerate header files and stub files from the *.decls tables.
471#
472#========================================================================
473
474genstubs:
475	$(TCLSH_PROG)	\
476		$(srcdir)/../tools/genStubs.tcl $(srcdir)	\
477		$(srcdir)/tkimg.decls
478
479#========================================================================
480#
481# Target to check that all exported functions have an entry in the stubs
482# tables.
483#
484#========================================================================
485
486tkimg_DECLS = \
487	$(srcdir)/tkimg.decls
488
489checkstubs:
490	-@for i in `nm -p $(tkimg_LIB_FILE) | awk '$$2 ~ /T/ { print $$3 }' \
491		| sort -n`; do \
492		match=0; \
493		for j in $(tkimg_DECLS); do \
494		    if [ `grep -c $$i $$j` -gt 0 ]; then \
495			match=1; \
496		    fi; \
497		done; \
498		if [ $$match -eq 0 ]; then echo $$i; fi \
499	done
500
501
502.PHONY: all binaries clean depend distclean doc install libraries test
503
504# Tell versions [3.59,3.63) of GNU make to not export all variables.
505# Otherwise a system limit (for SysV at least) may be exceeded.
506.NOEXPORT:
507