# Generated automatically from Makefile.in by configure.
# ------------------------------------------------------------------------
# 	Makefile for static version of BLT library
# ------------------------------------------------------------------------

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

BLT_LIBRARY =	/usr/lib/blt2.4
CC =		gcc
CFLAGS =	-O6 
DEFINES =	
DEF_BLTINIT =	-DBLT_LIBRARY=\"$(BLT_LIBRARY)\"
EXTRA_CFLAGS =	-Wall
LDFLAGS =	-Wl,-rpath,/usr/X11R6/lib
version =	24

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

bindir =	$(exec_prefix)/bin
exec_prefix =	/usr
incdir =	$(prefix)/include
libdir =	$(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/usr/X11R6/include

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

LIBRARIES =	$(lib_a)  -ltk8.2 -ltcl8.2 -L/usr/X11R6/lib -lX11 -lm -lnsl  -ldl

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

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

TREE_OBJS =     bltTree.o bltHiertable.o bltHtCmd.o bltHtText.o

TK_OBJS =	tkButton.o tkFrame.o tkScrollbar.o 

OBJS =		bltGraph.o bltGrAxis.o bltGrBar.o bltGrElem.o \
		bltGrGrid.o bltGrHairs.o bltGrLegd.o bltGrLine.o \
		bltGrMarker.o bltGrMisc.o bltGrPen.o bltGrPs.o \
	       	bltBeep.o bltBgexec.o bltBitmap.o bltBusy.o \
		bltContainer.o bltCutbuffer.o bltDebug.o \
                bltDnd.o bltUnixDnd.o \
		bltHierbox.o bltHtext.o bltSpline.o bltTable.o bltTabset.o \
		bltVector.o bltWatch.o bltWinop.o \
		bltCanvEps.o bltInit.o bltBind.o bltColor.o \
		bltConfig.o bltImage.o bltList.o bltChain.o \
		bltNsUtil.o bltParse.o bltPs.o bltText.o bltTile.o \
		bltUnixPipe.o bltUtil.o bltWindow.o \
		$(TREE_OBJS) $(TK_OBJS) $(N_OBJS) 

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

demo =		bltwish
headers =	blt.h
lib_a =		libBLT.a
libvers_a =	libBLT$(version).a

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

all: build_lib build_demo build_shared

build_lib: $(lib_a)

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

build_demo: $(demo)

$(demo): $(lib_a)
	$(RM) $(demo)
	$(CC) $(CC_SWITCHES) $(LDFLAGS) $(srcdir)/bltUnixMain.c -o $(demo) \
		$(LIBRARIES) 

$(lib_a):  $(OBJS)
	$(RM) $@
	$(AR) $@ $(OBJS)
	$(RANLIB) $@

install: install_dirs install_lib install_demo install_headers

install_demo: $(demo)
	$(INSTALL) -m 0755 bltwish $(bindir)

install_lib: $(lib_a)
	$(INSTALL_DATA) $(lib_a) $(libdir)/$(libvers_a)
	(cd $(libdir); $(RM) $(lib_a) ; $(LN_S) $(libvers_a) $(lib_a))
	$(RANLIB) $(libdir)/$(libvers_a)
	(cd shared; $(MAKE) install) 

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

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

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

clean:
	$(RM) $(OBJS) $(DEMO_OBJS) $(lib_a) $(demo)* *pure* .pure*
	(cd shared; $(MAKE) clean) 

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


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

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

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

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