# Generated automatically from Makefile.in by configure.

# ------------------------------------------------------------------------
# 	Makefile for static version of BLT library
# ------------------------------------------------------------------------

# ------------------------------------------------------------------------
# 	C Compiler options 
# ------------------------------------------------------------------------

BLT_LIBRARY =	/usr/lib/blt2.5
TCLLIBPATH   =	/home/pcmacdon/usr/lib/tcl8.5
CC =		gcc
CFLAGS =	-O6 
DEFINES =	
EXTRA_CFLAGS =	-Wall
LDFLAGS =	 -Wl,-rpath,/home/pcmacdon/usr/lib
version =	25

# ------------------------------------------------------------------------
# 	Source and targer installation directories 
# ------------------------------------------------------------------------

bindir =	$(exec_prefix)/bin
exec_prefix =	/home/pcmacdon/usr
incdir =	$(prefix)/include
libdir = 	/home/pcmacdon/usr/lib
scriptdir =	$(exec_prefix)/lib

prefix =	/usr
srcdir =	.

instdirs =	$(prefix) $(exec_prefix) $(bindir) $(libdir) $(incdir)

# ------------------------------------------------------------------------
# 	Directories containing Tcl and Tk include files and libraries
# ------------------------------------------------------------------------

INCLUDES =	-I. -I$(srcdir)  -I/home/pcmacdon/usr/include

# ------------------------------------------------------------------------
#       Libraries directives for Tcl, Tk, X11, and BLT
# ------------------------------------------------------------------------

LIBS =		 -L/home/pcmacdon/usr/lib -ltk8.5 -ltcl8.5 -lX11 -lm -lnsl  -ldl
TCL_ONLY_LIBS = -L/home/pcmacdon/usr/lib -ltcl8.5 -lm -lnsl  -ldl

# ------------------------------------------------------------------------
# 	You don't need to edit anything beyond this point
# ------------------------------------------------------------------------

N_OBJS =	bltTed.o
V3_OBJS =	bltTri.o bltGrMt.o 

TK_OBJS =	tkButton.o tkFrame.o bltScrollbar.o 

GRAPH_OBJS =	bltGrAxis.o \
		bltGrBar.o \
		bltGrElem.o \
		bltGrGrid.o \
		bltGrHairs.o \
		bltGrLegd.o \
		bltGrLine.o \
		bltGrMarker.o \
		bltGrMisc.o \
		bltGrPen.o \
		bltGrPs.o \
		bltGraph.o 


ifeq ($(ARCH),WIN32)

DND_OBJS = 
IMAGE_OBJS =    bltWinImage.o
PIPE_OBJS =     bltWinPipe.o \
		bltWinUtil.o \
		bltWinDde.o \
		bltWinDraw.o \
		bltWinPrnt.o

else

DND_OBJS =      bltUnixDnd.o
IMAGE_OBJS =    bltUnixImage.o
PIPE_OBJS =	bltUnixPipe.o

endif

TCL_ONLY_OBJS =	bltAlloc.o \
		bltArrayObj.o \
		bltBgexec.o \
		bltChain.o \
		bltDebug.o \
		bltHash.o \
		bltList.o \
		bltNsUtil.o \
		bltParse.o \
		bltPool.o \
		bltSpline.o \
		bltSwitch.o \
		bltTree.o \
		bltTreeCmd.o \
                $(PIPE_OBJS) \
		bltUtil.o \
		bltVector.o \
		bltVecMath.o \
		bltVecCmd.o \
		bltVecObjCmd.o \
		bltStubLib.o \
		bltStubInit.o \
		bltWatch.o  

OBJS =		$(GRAPH_OBJS) \
		$(TCL_ONLY_OBJS) \
		bltBeep.o \
		bltBind.o \
		bltBitmap.o \
		bltBusy.o \
		bltCanvEps.o \
		bltColor.o \
		bltConfig.o \
		bltContainer.o \
		bltCutbuffer.o \
		bltDragdrop.o \
		bltHierbox.o \
		bltHtext.o \
		bltImage.o \
		$(IMAGE_OBJS) \
		bltPs.o \
		bltTable.o \
		bltTabnotebook.o \
		bltTabset.o \
		bltText.o \
		bltTile.o \
		bltTreeView.o \
		bltTreeViewCmd.o \
		bltTreeViewEdit.o \
		bltTreeViewColumn.o \
		bltTreeViewStyle.o \
		$(DND_OBJS) \
		bltWindow.o \
		bltObjConfig.o \
		bltWinop.o \
		$(TK_OBJS) $(N_OBJS) 

# GNU Make-specific macro
SRCS =		$(patsubst %.o,$(srcdir)/%.c,$(OBJS)) 

bltwish =	bltwish
bltsh =		bltsh
headers =	$(srcdir)/blt.h \
		$(srcdir)/bltBind.h \
		$(srcdir)/bltChain.h \
		bltHash.h \
		$(srcdir)/bltList.h \
		$(srcdir)/bltPool.h \
		$(srcdir)/bltTree.h \
		$(srcdir)/bltDecls.h \
		$(srcdir)/bltVector.h 

lib_a =		libBLT.a
libvers_a =	libBLT$(version).a
tcl_only_lib_a =  libBLTlite.a
tcl_only_libvers_a = libBLTlite$(version).a

CC_SWITCHES =	$(EXTRA_CFLAGS) $(CFLAGS) $(DEFINES) $(INCLUDES)
INSTALL =	/usr/bin/install -c
INSTALL_DATA =	${INSTALL} -m 644
INSTALL_ROOT =  
RANLIB =	ranlib
SHELL =		/bin/sh
AR =		ar rc
RM =		rm -f
LINT =		lint
LINTFLAGS =	-axhbns
XREF =		cxref
XREFFLAGS =	-dltR
LN_S =		ln -s

all: $(bltsh) $(bltwish) build_shared
#all: $(bltwish) build_shared

build_shared:
	(cd shared; $(MAKE) CFLAGS="$(CFLAGS)" all) 

$(bltwish): $(lib_a) $(srcdir)/bltUnixMain.c
	$(RM) $(bltwish)
	$(CC) $(CC_SWITCHES) $(LDFLAGS) -o $(bltwish) \
		-DTCLLIBPATH=\"$(TCLLIBPATH)\" \
		$(srcdir)/bltUnixMain.c $(lib_a) $(LIBS) 

$(bltsh): $(tcl_only_lib_a) $(srcdir)/bltUnixMain.c
	$(RM) $(bltsh)
	$(CC) $(CC_SWITCHES) $(LDFLAGS) -DTCL_ONLY -o $(bltsh) \
		-DTCLLIBPATH=\"$(TCLLIBPATH)\" \
		$(srcdir)/bltUnixMain.c $(tcl_only_lib_a) $(TCL_ONLY_LIBS) 

$(lib_a): $(OBJS) $(srcdir)/bltInit.c
	$(CC) -c $(CC_SWITCHES) -DBLT_LIBRARY=\"$(BLT_LIBRARY)\" \
		$(srcdir)/bltInit.c
	$(RM) $@
	$(AR) $@ $(OBJS) bltInit.o
	$(RANLIB) $@

$(tcl_only_lib_a):  $(TCL_ONLY_OBJS) $(srcdir)/bltInit.c
	$(CC) -c $(CC_SWITCHES) -DTCL_ONLY -DBLT_LIBRARY=\"$(BLT_LIBRARY)\" \
		$(srcdir)/bltInit.c
	$(RM) $@
	$(AR) $@ $(TCL_ONLY_OBJS) bltInit.o
	$(RANLIB) $@

install: mkdirs install-lib install-demo install-headers

install-demo: $(bltwish) $(bltsh)
	$(INSTALL) -m 0755 $(bltwish) $(INSTALL_ROOT)$(bindir)
	$(INSTALL) -m 0755 $(bltsh) $(INSTALL_ROOT)$(bindir)

install-lib: $(lib_a) $(tcl_only_lib_a)
	$(INSTALL_DATA) $(lib_a) $(INSTALL_ROOT)$(libdir)/$(libvers_a)
	(cd $(INSTALL_ROOT)$(libdir); $(RM) $(lib_a) ; $(LN_S) $(libvers_a) $(lib_a))
	$(RANLIB) $(INSTALL_ROOT)$(libdir)/$(libvers_a)
	$(INSTALL_DATA) $(tcl_only_lib_a) $(INSTALL_ROOT)$(libdir)/$(tcl_only_libvers_a)
	(cd $(INSTALL_ROOT)$(libdir); $(RM) $(tcl_only_lib_a) ; $(LN_S) $(tcl_only_libvers_a) $(tcl_only_lib_a))
	$(RANLIB) $(INSTALL_ROOT)$(libdir)/$(tcl_only_libvers_a)
	(cd shared; $(MAKE) install) 

mkdirs:
	@for i in $(instdirs) ; do \
          if test -d $(INSTALL_ROOT)$$i ; then \
            : ; \
          else \
            echo " mkdir $(INSTALL_ROOT)$$i" ; \
            mkdir $(INSTALL_ROOT)$$i ; \
          fi ; \
        done

install-headers:
	@for i in $(headers) ; do \
	    echo "installing $$i..." ; \
	    $(INSTALL_DATA) -m 0444 $$i $(INSTALL_ROOT)$(incdir) ; \
	done

lint:
	$(LINT) $(LINTFLAGS) $(DEFINES) $(INCLUDES) $(SRCS)

libBLTstub.a:
	$(CC) -I$(srcdir)  -I/home/pcmacdon/usr/include -c $(srcdir)/bltStubLib.c
	$(AR) libBLTstub.a bltStubLib.o
	$(RANLIB) libBLTstub.a


genstubs:
	tclsh $(TCLLIBPATH)/tools/genStubs.tcl $(srcdir) blt.decl

xref:
	$(XREF) $(XREFFLAGS) $(DEFINES) $(INCLUDES) $(SRCS)

clean:
	$(RM) $(OBJS) bltInit.o $(lib_a) $(tcl_only_lib_a) \
		$(bltsh)* $(bltwish)* *pure* .pure*
	(cd shared; $(MAKE) clean) 

distclean: clean
	$(RM) $(srcdir)/*.bak $(srcdir)/*\~ $(srcdir)/"#"*  Makefile
	$(RM) bltConfig.h Makefile TAGS

.c.o:
	$(CC) -c $(CC_SWITCHES) $<

PUREFLAGS=
pure: $(lib_a)
	$(PURIFYHOME)/purify $(PUREFLAGS) $(CC) $(CC_SWITCHES) \
		$(srcdir)/bltUnixMain.c -o bltwish $(lib_a) $(LIBS)

QUANTIFYFLAGS=
quant: $(lib_a)
	$(QUANTIFYHOME)/quantify $(QUANTIFYFLAGS) $(CC) $(CC_SWITCHES) \
		$(srcdir)/bltUnixMain.c -o bltwish $(lib_a) $(LIBS)
