# Generated automatically from Makefile.in by configure.
# Makefile.in
#
# This makefile builds tcLex, a lexer generator, as a dynamically
# loadable Tcl extension.  This makefile is suitable for use on
# Unix systems.
#


#
# Project setting -- version and stuff
#
# PROJECT	  -- name of the project. Used in the file and package names
# PROJECT_VERSION -- version of the project, in major.minor format
# VERSION_DEFINE  -- symbol used in code that hold the version number

PROJECT		= tcLex
PROJECT_VERSION	= 1.2
VERSION_DEFINE	= TCLEX_VERSION

# Object files
OBJS		= tcLex.o \
			tcLexRE.o

# MANS		= tclex.n

#-------------------------------------------------
INSTALL         = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA    = ${INSTALL} -m 644
CC              = cc
SHLIB_CFLAGS    = -fPIC
SHLIB_SUFFIX    = .so
SHLIB_LD        = cc -shared
TCL_PREFIX      = /usr
TCL_CFLAGS      = 
TCL_SRC_DIR	= /home/david/src/tcl8.0-8.0.4

INCLUDES        = -I$(TCL_SRC_DIR)/generic -I$(TCL_PREFIX)/include

DLL             = $(PROJECT)$(SHLIB_SUFFIX)
PROJECTDIR	= $(TCL_PREFIX)/lib/$(PROJECT)$(PROJECT_VERSION)

CFLAGS          = $(TCL_CFLAGS) $(SHLIB_CFLAGS) $(INCLUDES) \
		  -D$(VERSION_DEFINE)=\"$(PROJECT_VERSION)\"

MAN_INSTALL_DIR = $(TCL_PREFIX)/man/mann

all: $(DLL) pkgIndex.tcl

$(DLL): $(OBJS)
	$(SHLIB_LD) -o $@ $(OBJS)

pkgIndex.tcl:
	(if test -f $(PROJECTDIR)/pkgIndex.tcl; \
	    then grep -v $(PROJECT_VERSION) $(PROJECTDIR)/pkgIndex.tcl; \
	else true; fi;) | \
	echo 'package ifneeded $(PROJECT) $(PROJECT_VERSION) [list load [file join $$dir $(DLL).$(PROJECT_VERSION)] $(PROJECT)]' > pkgIndex.tcl

install: all
	if test ! -d $(PROJECTDIR); then mkdir $(PROJECTDIR); fi
	$(INSTALL_PROGRAM) $(DLL) $(PROJECTDIR)/$(DLL).$(PROJECT_VERSION)
	$(INSTALL_DATA) pkgIndex.tcl $(PROJECTDIR)/pkgIndex.tcl
#	$(INSTALL_DATA) $(MANS) $(MAN_INSTALL_DIR)/

test: all
	true

clean: 
	rm -f *.o core pkgIndex.tcl

distclean: clean
	rm -f Makefile config.* $(DLL)
