#
# Makefile.  Generated from Makefile.in by configure.
#

#========================================================================
# All these assignments are substituted by configure
#========================================================================

PKG_OBJECTS= tclOO.obj tclOOCall.obj tclOODefineCmds.obj tclOOInfo.obj tclOOMethod.obj tclOOStubInit.obj TclOO.res.o
PKG_STUB_OBJECTS= tclOOStubLib.obj
PKG_HEADERS= generic/tclOO.h generic/tclOODecls.h
PKG_PRIVATE_HEADERS= generic/tclOOInt.h generic/tclOOIntDecls.h
PKG_LIB_FILE=TclOO02a0.dll
PKG_STUB_LIB_FILE=TclOOstub02a0.lib
SHELL=/bin/sh
srcdir=..
prefix=d:/tcltest
exec_prefix=d:/tcltest
libdir=${exec_prefix}/lib
includedir=${prefix}/include
mandir=${prefix}/man
INSTALL=/bin/install -c
INSTALL_PROGRAM=${INSTALL}
INSTALL_DATA=${INSTALL} -m 644
INSTALL_SCRIPT=${INSTALL}
PACKAGE_NAME=TclOO
PACKAGE_VERSION=0.2a0
CC=cl
CFLAGS_DEFAULT=-nologo -O2 -W2 -MD
CFLAGS_WARNING=
CLEANFILES= TclOO02a0.dll.manifest pkgIndex.tcl
EXEEXT=.exe
LDFLAGS_DEFAULT=-release
MAKE_LIB=${SHLIB_LD} ${SHLIB_LD_LIBS} ${LDFLAGS_DEFAULT} -out:$@ $(PKG_OBJECTS) 
ADD_MANIFEST=mt -manifest $@.manifest -outputresource:$@;2
MAKE_SHARED_LIB=${SHLIB_LD} ${SHLIB_LD_LIBS} ${LDFLAGS_DEFAULT} -out:$@ $(PKG_OBJECTS)
MAKE_STATIC_LIB=${STLIB_LD} -out:$@ $(PKG_OBJECTS)
MAKE_STUB_LIB=${STLIB_LD} -out:$@ $(PKG_STUB_OBJECTS)
OBJEXT=obj
RANLIB=:
RANLIB_STUB=:
SHLIB_CFLAGS=
SHLIB_LD=link -dll -nologo
SHLIB_LD_LIBS=${LIBS} "/d/tcltest/lib/tclstub85.lib"
STLIB_LD=link -lib -nologo
TCL_SRC_DIR=/d/SourceForge/tcl
TCL_BIN_DIR=/d/tcltest/lib
# Not actually used, but can help when tracing errors
#TCL_LIBS=user32.lib advapi32.lib ws2_32.lib
#MT=mt
TCLSH_PROG=/d/tcltest/bin/tclsh85.exe
INCLUDES= -I. -I"../generic" -I"/d/SourceForge/tcl/generic" -I"/d/SourceForge/tcl/win"
PKG_CFLAGS=
DEFS=-DPACKAGE_NAME=\"TclOO\" -DPACKAGE_TARNAME=\"tcloo\" -DPACKAGE_VERSION=\"0.2a0\" -DPACKAGE_STRING=\"TclOO\ 0.2a0\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -Dinline=__inline -DTCL_THREADS=1 -DUSE_TCL_STUBS=1 -DBUILD_tcloo=1  $(PKG_CFLAGS)
CPPFLAGS=
LIBS=  
AR=ar
CFLAGS= ${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} 
CYGPATH=echo
SDX=none
TCLSH_ENV=TCL_LIBRARY="`$(CYGPATH) $(TCL_SRC_DIR)/library`" \
	  LD_LIBRARY_PATH="$(EXTRA_PATH):$(LD_LIBRARY_PATH)" \
	  PATH="$(EXTRA_PATH):$(PATH)" \
	  TCLLIBPATH="$(TCLLIBPATH)"
RC=rc
RCFLAGS= --include "../generic" --define PACKAGE_NAME='\"$(PACKAGE_NAME)\"' --define PKG_LIB_FILE='\"$(PKG_LIB_FILE)\"' --define PACKAGE_VERSION='\"$(PACKAGE_VERSION)\"'
RES=res.o

#========================================================================
# None of these assignments are substituted by configure
#========================================================================

SRC_DIR=$(srcdir)
BINARIES=$(PKG_LIB_FILE) $(PKG_STUB_LIB_FILE)
DESTDIR=
PKG_DIR=$(PACKAGE_NAME)$(PACKAGE_VERSION)
PKG_KIT_ROOT=$(PKG_DIR)-$(PLATFORM)
PKG_KIT=$(PKG_KIT_ROOT).kit
pkglibdir=$(libdir)/$(PKG_DIR)
top_builddir=.
TCL_VERSION_REQ=8.5b1
EXTRA_PATH=$(top_builddir):$(TCL_BIN_DIR)
TCLLIBPATH = $(top_builddir)
TCLSH_PROGRAM="$(TCLSH_PROG)"
TCLSH=$(TCLSH_ENV) $(TCLSH_PROGRAM)
CONFIG_CLEAN_FILES="Makefile tclooConfig.sh"
COMPILE=$(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
VPATH=$(SRC_DIR)/generic:$(SRC_DIR)/unix:$(SRC_DIR)/win:$(SRC_DIR)/macosx:$(SRC_DIR)
TESTFLAGS=
KIT_PKG_ROOT=$(PKG_KIT_ROOT).vfs/lib/$(PACKAGE_NAME)
ITERATIONS=1000

#========================================================================
# This is something that is found by executing a Tcl script
#========================================================================

PLATFORM:=$(shell echo 'package require platform;puts [platform::generic]' | $(TCLSH))

#========================================================================
# Master rules
#========================================================================

all: package libraries
package: $(PKG_LIB_FILE) pkgIndex.tcl
libraries: $(PKG_STUB_LIB_FILE)
install: all install-package install-libraries install-headers install-doc
kit: sdx_valid $(PKG_KIT)

#========================================================================
# Basic installation rules
#========================================================================

install-package: package
	@mkdir -p $(DESTDIR)$(pkglibdir)
	$(INSTALL_PROGRAM) $(PKG_LIB_FILE) $(DESTDIR)$(pkglibdir)/$(PKG_LIB_FILE)
	$(RANLIB) $(DESTDIR)$(pkglibdir)/$(PKG_LIB_FILE)
	$(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir)/pkgIndex.tcl
	$(INSTALL_DATA) tclooConfig.sh $(DESTDIR)$(pkglibdir)/tclooConfig.sh
#	for p in $(SRC_DIR)/library/*.tcl ; do \
#	    destp=`basename $$p`; \
#	    echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \
#	    $(INSTALL_DATA) $$p $(DESTDIR)$(pkglibdir)/$$destp; \
#	done
install-headers:
	@echo "Installing header files in $(DESTDIR)$(includedir)"
	@mkdir -p $(DESTDIR)$(includedir)
	@list='$(PKG_HEADERS)'; for p in $$list; do \
	    echo "Installing $(SRC_DIR)/$$p" ; \
	    destp=`basename $$p`; \
	    $(INSTALL_DATA) $(SRC_DIR)/$$p $(DESTDIR)$(includedir)/$$destp ; \
	done;
install-private-headers:
	@echo "Installing private header files in $(DESTDIR)$(includedir)"
	@mkdir -p $(DESTDIR)$(includedir)
	@list='$(PKG_PRIVATE_HEADERS)'; for p in $$list; do \
	    echo "Installing $(SRC_DIR)/$$p" ; \
	    destp=`basename $$p`; \
	    $(INSTALL_DATA) $(SRC_DIR)/$$p $(DESTDIR)$(includedir)/$$destp ; \
	done;
install-libraries: libraries
	@echo "Installing $(PKG_STUB_LIB_FILE) in $(DESTDIR)$(pkglibdir)"
	@mkdir -p $(DESTDIR)$(pkglibdir)
	$(INSTALL_PROGRAM) $(PKG_STUB_LIB_FILE) $(DESTDIR)$(pkglibdir)
	$(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$(PKG_STUB_LIB_FILE)

#========================================================================
# Install documentation. Unix manpages should go in the $(mandir) directory.
#========================================================================

install-doc: doc
	@echo "Installing documentation in $(DESTDIR)$(mandir)"
	@mkdir -p $(DESTDIR)$(mandir)/mann
	@list='$(SRC_DIR)/doc/*.n'; for i in $$list; do \
	    echo "Installing $$i"; \
	    rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \
	    $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \
	done
	@mkdir -p $(DESTDIR)$(mandir)/man3
	@list='$(SRC_DIR)/doc/*.3'; for i in $$list; do \
	    echo "Installing $$i"; \
	    rm -f $(DESTDIR)$(mandir)/man3/`basename $$i`; \
	    $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/man3 ; \
	done

# A do-nothing target at the moment
doc:

#========================================================================
# Run the test suite or benchmarks for the package, or just start a shell
# primed to load the package.
#========================================================================

test: package libraries
	@echo $(TCLSH_PROGRAM) $(SRC_DIR)/tests/all.tcl $(TESTLOAD) $(TESTFLAGS)
	@$(TCLSH) `$(CYGPATH) $(SRC_DIR)/tests/all.tcl` $(TESTLOAD) $(TESTFLAGS)

benchmarks: package libraries
	@echo Benchmark Iterations = $(ITERATIONS)
	@list='$(SRC_DIR)/benchmarks/*.tcl'; for i in $$list; do \
	    echo "Benchmarking $$i"; \
	    time $(TCLSH) `$(CYGPATH) $$i` $(ITERATIONS); \
	done

shell: package libraries
	@echo $(TCLSH_PROGRAM) $(SCRIPT)
	@$(TCLSH) $(SCRIPT)

#========================================================================
# These rules say how to run tclsh in a hostile Windows environment, while
# still working on Unix.
#========================================================================

gdb.run:
	@echo "catch {puts \"target exec [file attributes [file normalize [lindex \$$argv 0]] -shortname]\";exit};puts \"target exec [file normalize [lindex \$$argv 0]]\"" >gdbhelper.tcl
	@$(TCLSH) gdbhelper.tcl "$(TCLSH_PROGRAM)" > gdb.run
	@rm gdbhelper.tcl
	@echo "set env TCL_LIBRARY=$(TCL_SRC_DIR)/library" >> gdb.run
	@echo "set env LD_LIBRARY_PATH=$(EXTRA_PATH):$(LD_LIBRARY_PATH)" >> gdb.run
	@echo "set env TCLLIBPATH=$(top_builddir)" >> gdb.run
	@sh -c 'test x$${OSTYPE} = xmsys && echo "set new-console off" >> gdb.run'

gdb: package libraries gdb.run
	@echo gdb $(TCLSH_PROGRAM) $(ARGS)
	@gdb --command=gdb.run $(ARGS)
	@rm gdb.run
gdbtest: package libraries gdb.run
	@echo "set args `$(CYGPATH) $(SRC_DIR)/tests/all.tcl` $(TESTLOAD) $(TESTFLAGS)" >>gdb.run
	@echo gdb $(TCLSH_PROGRAM) $(MANGLED)
	@gdb --command=gdb.run
	@rm gdb.run

#========================================================================
# The rules for actually doing the build of the package.
#========================================================================

$(PKG_LIB_FILE): $(PKG_OBJECTS)
	-rm -f $(PKG_LIB_FILE)
	${MAKE_LIB}
	${ADD_MANIFEST}
	$(RANLIB) $(PKG_LIB_FILE)
$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS)
	-rm -f $(PKG_STUB_LIB_FILE)
	${MAKE_STUB_LIB}
	$(RANLIB_STUB) $(PKG_STUB_LIB_FILE)
.c.obj:
	$(COMPILE) -c `$(CYGPATH) $<` -o $@
.rc.$(RES):
	$(RC) -o $@ $(RCFLAGS) "$<"
pkgIndex.tcl: Makefile
	-@echo Creating pkgIndex.tcl
	@( \
	echo 'if {[catch {package require Tcl $(TCL_VERSION_REQ)}]} return'; \
	echo 'package ifneeded $(PACKAGE_NAME) $(PACKAGE_VERSION) \
	    [list load [file join $$dir $(PKG_LIB_FILE)] $(PACKAGE_NAME)]' \
	) > pkgIndex.tcl
Makefile: $(SRC_DIR)/Makefile.in $(top_builddir)/config.status
	cd $(top_builddir) \
	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status

#========================================================================
# How to rebuild the package's stub table.
#========================================================================

genstubs: $(SRC_DIR)/tools/genStubs.tcl $(SRC_DIR)/generic/tclOO.decls
	@echo $(TCLSH_PROGRAM) $(SRC_DIR)/tools/genStubs.tcl $(SRC_DIR)/generic $(SRC_DIR)/generic/tclOO.decls
	@$(TCLSH) `$(CYGPATH) $(SRC_DIR)/tools/genStubs.tcl` `$(CYGPATH) $(SRC_DIR)/generic` `$(CYGPATH) $(SRC_DIR)/generic/tclOO.decls`

#========================================================================
# Build a starkit - this is experimental!
#========================================================================

sdx_valid:
	@test "$(SDX)" != "none" || ( echo "Cannot build kit; no sdx!"; false )
$(PKG_KIT): $(PKG_LIB_FILE)
	-@mkdir -p $(KIT_PKG_ROOT)/$(PLATFORM)
	cp $(PKG_LIB_FILE) $(KIT_PKG_ROOT)/$(PLATFORM)
	-@echo Creating $(KIT_PKG_ROOT)/pkgIndex.tcl
	@( \
	echo 'if {[catch {package require Tcl $(TCL_VERSION_REQ)}]} return'; \
	echo 'package ifneeded $(PACKAGE_NAME) $(PACKAGE_VERSION)' \
	    '[list load [file join $$dir $(PLATFORM) $(PKG_LIB_FILE)] $(PACKAGE_NAME)]' \
	) > $(KIT_PKG_ROOT)/pkgIndex.tcl
	$(SDX) wrap $(PKG_KIT)
	-@rm -rf $(PKG_KIT_ROOT).vfs $(PKG_KIT_ROOT).bat

#========================================================================
# How to clean up after a build.
#========================================================================

clean:
	-test -z "$(BINARIES)" || rm -f $(BINARIES)
	-rm -f *.$(OBJEXT) core *.core
	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean: clean
	-rm -f *.tab.c
	-rm -f $(CONFIG_CLEAN_FILES)
	-rm -f config.cache config.log config.status

#========================================================================
# Distribution creation (FROM sampleextension)
# You may need to tweak this target to make it work correctly.
#========================================================================

#COMPRESS	= tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar
COMPRESS	= gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR)
DIST_ROOT	= /tmp/dist
DIST_DIR	= $(DIST_ROOT)/$(PKG_DIR)

dist-clean:
	rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.*

dist: dist-clean
	mkdir -p $(DIST_DIR)
	cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/license* \
		$(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \
		$(DIST_DIR)/
	chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4
	chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in

	for i in $(srcdir)/*.[ch]; do \
	    if [ -f $$i ]; then \
		cp -p $$i $(DIST_DIR)/ ; \
	    fi; \
	done;

	mkdir $(DIST_DIR)/tclconfig
	cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \
		$(DIST_DIR)/tclconfig/
	chmod 664 $(DIST_DIR)/tclconfig/tcl.m4
	chmod +x $(DIST_DIR)/tclconfig/install-sh

	list='demos generic library mac tests unix win'; \
	for p in $$list; do \
	    if test -d $(srcdir)/$$p ; then \
		mkdir $(DIST_DIR)/$$p; \
		cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \
	    fi; \
	done
	mkdir $(DIST_DIR)/doc
	for p in $(srcdir)/doc/*.?; do \
	    soelim -I $(srcdir)/doc $$p >$(DIST_DIR)/doc/`basename $$p`; \
	done

	(cd $(DIST_ROOT); $(COMPRESS);)

#========================================================================
# Magic declarations to make.
#========================================================================

.SUFFIXES: .c .$(OBJEXT) .rc .$(RES)
.PHONY: all package clean depend distclean doc install libraries test kit
.PHONY: sdx_valid doc dist dist-clean benchmarks shell genstubs gdb gdbtest
