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 ActiveState SRL.
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# Edit the following few lines when writing a new extension
17#========================================================================
18
19#========================================================================
20# Nothing of the variables below this line need to be changed.  Please
21# check the TARGETS section below to make sure the make targets are
22# correct.
23#========================================================================
24
25#========================================================================
26# The names of the source files is defined in the configure script.
27# The object files are used for linking into the final library.
28# This will be used when a dist target is added to the Makefile.
29# It is not important to specify the directory, as long as it is the
30# $(srcdir) or in the generic, win or unix subdirectory.
31#========================================================================
32
33PKG_SOURCES	= @PKG_SOURCES@
34PKG_OBJECTS	= @PKG_OBJECTS@
35
36#========================================================================
37# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with
38# this package that need to be installed, if any.
39#========================================================================
40
41PKG_TCL_SOURCES = @PKG_TCL_SOURCES@
42
43#========================================================================
44# This is a list of public header files to be installed, if any.
45#========================================================================
46
47PKG_HEADERS	= @PKG_HEADERS@
48
49PKG_EXTRA_FILES =
50
51PKG_MAN_PAGES	=
52
53PKG_MANIFEST	= @PKG_MANIFEST@
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) pkgIndex.tcl
65
66SHELL		= @SHELL@
67
68srcdir		= @srcdir@
69prefix		= @prefix@
70exec_prefix	= @exec_prefix@
71
72bindir		= @bindir@
73libdir		= @libdir@
74datadir		= @datadir@
75datarootdir     = @datarootdir@
76mandir		= @mandir@
77includedir	= @includedir@
78
79DESTDIR		=
80
81TREECTRL_DIR	= $(libdir)/treectrl$(PACKAGE_PATCHLEVEL)
82PKG_DIR		= $(PACKAGE_NAME)$(PACKAGE_PATCHLEVEL)
83pkgdatadir	= $(datadir)/$(PKG_DIR)
84pkglibdir	= $(TREECTRL_DIR)/$(PKG_DIR)
85pkgincludedir	= $(includedir)/$(PKG_DIR)
86
87top_builddir	= .
88
89INSTALL		= @INSTALL@
90INSTALL_PROGRAM	= @INSTALL_PROGRAM@
91INSTALL_DATA	= @INSTALL_DATA@
92INSTALL_SCRIPT	= @INSTALL_SCRIPT@
93
94PACKAGE_NAME	= @PACKAGE_NAME@
95PACKAGE_VERSION	= @PACKAGE_VERSION@
96PACKAGE_PATCHLEVEL	= @PACKAGE_PATCHLEVEL@
97CC		= @CC@
98CFLAGS_DEFAULT	= @CFLAGS_DEFAULT@
99CFLAGS_WARNING	= @CFLAGS_WARNING@
100CC_OBJNAME	= @CC_OBJNAME@
101CLEANFILES	= @CLEANFILES@
102EXEEXT		= @EXEEXT@
103LDFLAGS_DEFAULT	= @LDFLAGS_DEFAULT@
104MAKE_LIB	= @MAKE_LIB@
105MAKE_SHARED_LIB	= @MAKE_SHARED_LIB@
106MAKE_STATIC_LIB	= @MAKE_STATIC_LIB@
107MAKE_STUB_LIB	= @MAKE_STUB_LIB@
108OBJEXT		= @OBJEXT@
109RANLIB		= @RANLIB@
110RANLIB_STUB	= @RANLIB_STUB@
111SHLIB_CFLAGS	= @SHLIB_CFLAGS@
112SHLIB_LD	= @SHLIB_LD@
113SHLIB_LD_LIBS	= @SHLIB_LD_LIBS@
114STLIB_LD	= @STLIB_LD@
115TCL_DEFS	= @TCL_DEFS@
116TCL_SRC_DIR	= @TCL_SRC_DIR@
117TCL_BIN_DIR	= @TCL_BIN_DIR@
118TK_SRC_DIR	= @TK_SRC_DIR@
119TK_BIN_DIR	= @TK_BIN_DIR@
120# Not used, but retained for reference of what libs Tcl required
121TCL_LIBS	= @TCL_LIBS@
122TK_LIBS		= @TK_LIBS@
123
124#========================================================================
125# TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our
126# package without installing.  The other environment variables allow us
127# to test against an uninstalled Tcl.  Add special env vars that you
128# require for testing here (like TCLX_LIBRARY).
129#========================================================================
130
131EXTRA_PATH	= $(top_builddir):$(TCL_BIN_DIR):$(TK_BIN_DIR)
132TCLSH_ENV	= TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \
133		  TK_LIBRARY=`@CYGPATH@ $(TK_SRC_DIR)/library` \
134		  TREECTRL_LIBRARY=`@CYGPATH@ $(srcdir)/library` \
135		  @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \
136		  PATH="$(EXTRA_PATH):$(PATH)" \
137		  TCLLIBPATH="$(top_builddir)"
138TCLSH_PROG	= @TCLSH_PROG@
139WISH_PROG	= @WISH_PROG@
140TCLSH		= $(TCLSH_ENV) $(TCLSH_PROG)
141WISH		= $(TCLSH_ENV) $(WISH_PROG)
142
143# The local includes must come first, because the TK_XINCLUDES can be
144# just a comment
145INCLUDES	= @PKG_INCLUDES@ \
146		  @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@
147
148PKG_CFLAGS	= @PKG_CFLAGS@
149
150DEFS		= @DEFS@ $(PKG_CFLAGS)
151
152CONFIG_CLEAN_FILES = Makefile $(PKG_MANIFEST)
153
154CPPFLAGS	= @CPPFLAGS@
155LIBS		= @PKG_LIBS@ @LIBS@
156AR		= @AR@
157CFLAGS		= @CFLAGS@
158COMPILE		= $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
159
160#========================================================================
161# Start of user-definable TARGETS section
162#========================================================================
163
164#========================================================================
165# TEA TARGETS.  Please note that the "libraries:" target refers to platform
166# independent files, and the "binaries:" target inclues executable programs and
167# platform-dependent libraries.  Modify these targets so that they install
168# the various pieces of your package.  The make and install rules
169# for the BINARIES that you specified above have already been done.
170#========================================================================
171
172all: binaries libraries doc
173
174#========================================================================
175# The binaries target builds executable programs, Windows .dll's, unix
176# shared/static libraries, and any other platform-dependent files.
177# The list of targets to build for "binaries:" is specified at the top
178# of the Makefile, in the "BINARIES" variable.
179#========================================================================
180
181binaries: $(BINARIES)
182
183libraries:
184
185doc-x:
186	@echo "If you have documentation to create, place the commands to"
187	@echo "build the docs in the 'doc:' target.  For example:"
188	@echo "        xml2nroff sample.xml > sample.n"
189	@echo "        xml2html sample.xml > sample.html"
190
191doc:
192	@echo "No docs to build"
193
194install: all install-binaries install-libraries
195
196install-binaries: binaries install-lib-binaries install-bin-binaries
197	@mkdir -p $(DESTDIR)$(pkglibdir)
198	$(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir)
199	@list='$(PKG_EXTRA_FILES)'; for p in $$list; do \
200	  if test -f $(srcdir)/$$p; then \
201	    destp=`basename $$p`; \
202	    echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \
203	    $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkglibdir)/$$destp; \
204	  fi; \
205	done
206
207#========================================================================
208# This rule installs platform-independent files, such as header files.
209#========================================================================
210
211install-libraries: libraries
212
213#========================================================================
214# Install documentation.  Unix manpages should go in the $(mandir)
215# directory.
216#========================================================================
217
218install-doc-x:
219	@mkdir -p $(DESTDIR)$(mandir)/mann
220	@echo "Installing documentation in $(DESTDIR)$(mandir)"
221	@for i in $(srcdir)/doc/*.n; do \
222	    echo "Installing $$i"; \
223	    rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \
224	    $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \
225	done
226
227install-doc: install-doc-x
228	mkdir -p $(DESTDIR)$(pkglibdir)/htmldoc
229	cp $(srcdir)/doc/*.html $(DESTDIR)$(pkglibdir)/htmldoc
230
231test: binaries libraries
232	$(WISH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) | cat
233
234shell: binaries libraries
235	@$(WISH) $(SCRIPT)
236
237demo: binaries libraries
238	@$(WISH) `@CYGPATH@ $(srcdir)/demos/demo.tcl` | cat
239
240gdb:
241	$(TCLSH_ENV) gdb --silent --args $(WISH_PROG) $(srcdir)/demos/demo.tcl
242
243depend:
244
245#========================================================================
246# $(PKG_LIB_FILE) should be listed as part of the BINARIES variable
247# mentioned above.  That will ensure that this target is built when you
248# run "make binaries".
249#
250# The $(PKG_OBJECTS) objects are created and linked into the final
251# library.  In most cases these object files will correspond to the
252# source files above.
253#
254# NOTE regarding the manifest(s):  When building on a non-Windows box the
255# shelliconNN.dll.manifest file should not exist.  When building with
256# MingW GCC the manifest will also not exist.  Only when building with
257# a Microsoft compiler that auto-generates a manifest (to pick the correct
258# MSVCRT runtime) will $@.manifest exist; in this case mt.exe should
259# also exist.  If mt.exe is used there is actually no need for shellicon.rc
260# to include shellicon.dll.manifest since mt.exe will clobber that resource
261# with the merged manifests.
262#========================================================================
263
264$(PKG_LIB_FILE): $(PKG_OBJECTS)
265	-rm -f $(PKG_LIB_FILE)
266	${MAKE_LIB}
267	$(RANLIB) $(PKG_LIB_FILE)
268
269#========================================================================
270# In the following lines, $(srcdir) refers to the toplevel directory
271# containing your extension.  If your sources are in a subdirectory,
272# you will have to modify the paths to reflect this:
273#
274# tkpkg.$(OBJEXT): $(srcdir)/src/win/tkpkg.c
275# 	$(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/tkpkg.c` -o $@
276#
277# Setting the VPATH variable to a list of paths will cause the
278# makefile to look into these paths when resolving .c to .obj
279# dependencies.
280#========================================================================
281
282# I added leading $(srcdir) because autoconf 2.53 strips it off
283VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win
284
285.c.@OBJEXT@:
286	$(COMPILE) -c `@CYGPATH@ $<` $(CC_OBJNAME)
287
288.rc.@RES@:
289	@RC@ @RC_OUT@ $@ @RC_INCLUDE@ "`@CYGPATH@ $(srcdir)`" @RC_DEPARG@
290
291#========================================================================
292# Create the pkgIndex.tcl file.
293#========================================================================
294
295pkgIndex.tcl:
296	(\
297	echo 'if {[catch {package require Tcl @TK_VERSION@}]} return';\
298	echo 'set script "load \"[file join $$dir $(PKG_LIB_FILE)]\" $(PACKAGE_NAME)"';\
299	echo 'package ifneeded $(PACKAGE_NAME) $(PACKAGE_PATCHLEVEL) $$script'\
300	) > pkgIndex.tcl
301
302#========================================================================
303# Distribution creation
304# You may need to tweak this target to make it work correctly.
305#========================================================================
306
307#COMPRESS	= tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar
308COMPRESS	= gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR)
309DIST_ROOT	= /tmp/dist
310DIST_DIR	= $(DIST_ROOT)/$(PKG_DIR)
311
312dist-clean:
313	rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.*
314
315dist: dist-clean
316	mkdir -p $(DIST_DIR)
317	cp -p $(srcdir)/shellicon.c \
318		$(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.ac \
319		$(srcdir)/*.in $(DIST_DIR)/
320	chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4
321	chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.ac
322
323	cp -p $(srcdir)/*.[ch] $(DIST_DIR)/
324
325	mkdir $(DIST_DIR)/tclconfig
326	cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \
327		$(DIST_DIR)/tclconfig/
328	chmod 664 $(DIST_DIR)/tclconfig/tcl.m4
329	chmod +x $(DIST_DIR)/tclconfig/install-sh
330
331	list='demos doc generic library mac tests unix win'; \
332	for p in $$list; do \
333	    if test -d $(srcdir)/$$p ; then \
334		mkdir $(DIST_DIR)/$$p; \
335		cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \
336	    fi; \
337	done
338
339	(cd $(DIST_ROOT); $(COMPRESS);)
340
341#========================================================================
342# End of user-definable section
343#========================================================================
344
345#========================================================================
346# Don't modify the file to clean here.  Instead, set the "CLEANFILES"
347# variable in configure.in
348#========================================================================
349
350clean:
351	-test -z "$(BINARIES)" || rm -f $(BINARIES)
352	-rm -f *.$(OBJEXT) core *.core
353	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
354
355distclean: clean
356	-rm -f *.tab.c
357	-rm -f $(CONFIG_CLEAN_FILES)
358	-rm -f config.cache config.log config.status
359
360#========================================================================
361# Install binary object libraries.  On Windows this includes both .dll and
362# .lib files.  Because the .lib files are not explicitly listed anywhere,
363# we need to deduce their existence from the .dll file of the same name.
364# Library files go into the lib directory.
365# In addition, this will generate the pkgIndex.tcl
366# file in the install location (assuming it can find a usable tclsh shell)
367#
368# You should not have to modify this target.
369#========================================================================
370
371install-lib-binaries:
372	@mkdir -p $(DESTDIR)$(pkglibdir)
373	@list='$(lib_BINARIES)'; for p in $$list; do \
374	  if test -f $$p; then \
375	    echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \
376	    $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \
377	    echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \
378	    $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \
379	    ext=`echo $$p|sed -e "s/.*\.//"`; \
380	    if test "x$$ext" = "xdll"; then \
381		lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \
382		if test -f $$lib; then \
383		    echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib"; \
384	            $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib; \
385		fi; \
386	    fi; \
387	  fi; \
388	done
389	@list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
390	  if test -f $(srcdir)/$$p; then \
391	    destp=`basename $$p`; \
392	    echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \
393	    $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkglibdir)/$$destp; \
394	  fi; \
395	done
396
397#========================================================================
398# Install binary executables (e.g. .exe files and dependent .dll files)
399# This is for files that must go in the bin directory (located next to
400# wish and tclsh), like dependent .dll files on Windows.
401#
402# You should not have to modify this target, except to define bin_BINARIES
403# above if necessary.
404#========================================================================
405
406install-bin-binaries:
407	@mkdir -p $(DESTDIR)$(bindir)
408	@list='$(bin_BINARIES)'; for p in $$list; do \
409	  if test -f $$p; then \
410	    echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \
411	    $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \
412	  fi; \
413	done
414
415.SUFFIXES: .c .$(OBJEXT)
416.SUFFIXES: .@RES@
417.SUFFIXES: .rc
418
419Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
420	cd $(top_builddir) \
421	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
422
423uninstall-binaries:
424	list='$(lib_BINARIES)'; for p in $$list; do \
425	  rm -f $(DESTDIR)$(pkglibdir)/$$p; \
426	done
427	list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
428	  p=`basename $$p`; \
429	  rm -f $(DESTDIR)$(pkglibdir)/$$p; \
430	done
431	list='$(bin_BINARIES)'; for p in $$list; do \
432	  rm -f $(DESTDIR)$(bindir)/$$p; \
433	done
434
435.PHONY: all binaries clean depend distclean doc install libraries test
436
437# Tell versions [3.59,3.63) of GNU make to not export all variables.
438# Otherwise a system limit (for SysV at least) may be exceeded.
439.NOEXPORT:
440