#
# Makefile for the wishpqx with libpq
#
# $Id: Makefile,v 1.2 1994/02/09 00:43:53 jimbo Exp jimbo $
#

# LibPQ (Postgres v4.1)
POSTGRES=/usr/local/postgres
PLIB=-L$(POSTGRES)/lib -lpq
PINC=-I$(POSTGRES)/include/tmp -I$(POSTGRES)/include

# Tcl, Tk, and Extended Tcl/Tk
# TLIB=-L/usr/local/lib -ltkx -ltk -ltclx -ltcl
TLIB=-L/usr/local/lib -ltk -ltkx -ltcl -ltclx
TINC=-I/usr/local/share/include
# define HAVE_PHOTO if you have the photo widget in your libtk.a
# PHOTO=-DHAVE_PHOTO

# X11
X11=/usr/X386
XINC=-I$(X11)/include
XLIB=-L$(X11)/lib -lX11
#XLIB=-lX11

CFLAGS=-O2 -pipe $(PHOTO) $(PINC) $(TINC) $(XINC)
LIBS=$(PLIB) $(TLIB) $(XLIB) -lm
OBJS=libpqcmds.o tkXAppInit.o
PGM=wishpqx
RM=/bin/rm -f
CC=cc -w
ARCH=`../bin/arch`
MV=/bin/mv
STRIP=/usr/bin/strip
DESTDIR=../bin/$(ARCH)

all: $(PGM)

$(PGM): $(OBJS)
	$(CC) $(CFLAGS) -o $(PGM) $(OBJS) $(LIBS) || $(RM) $(PGM)

install: all
	$(STRIP) $(PGM)
	$(MV) $(PGM) $(DESTDIR)/$(PGM)
clean:
	$(RM) $(PGM) $(OBJS)

libpqcmds.o: libpqcmds.h
