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