#############################################################################
#
# Makefile for xisql application
#
# @(#) Makefile 1.1 1/17/94
#
#############################################################################

MAKE = make CC="$(CC)" AS="$(AS)" LD="$(LD)" AR="$(AR)" CPP="$(CPP)" SYSTYPE="$(SYSTYPE)" SYSBASE="$(SYSBASE)" BASENAME="$(BASENAME)" $(MFLAGS)

# compiler exectuables
# CPP   - C pre-processor
# AR    - Object archiver / librarian
CPP=/lib/cpp
AR=/bin/ar
CC=/usr/bin/cc

#
# What target name is, and where it is located
#
TARGET = 	xisql

#
# Where to get includes and libraries
#
XINCPATH = 	/usr/X11/include
INCPATH =	$${SYBASE}/include

LIBPATH =	$${SYBASE}/lib
#  un-comment the next two lines to try out the ct_debug API,
# and see all the stuff it can show you.
#DEBUG = 	-DDEBUG
#LIBPATH =	$${SYBASE}/devlib

NETLIBS = 	-lsybtcl -linsck
SYBLIBS =       -L$(LIBPATH) -lct -lcs -lcomn $(NETLIBS) -lintl
SYSLIBS =	-L/usr/X11/lib -lXaw -lXmu -lXt -lX11 -lXext -lm
LIBS = 		$(SYBLIBS) $(SYSLIBS)

#
# source and include files
#
SRC =		xisql.c window.c win_dbg.c win_lang.c win_msg.c \
		win_cap.c win_cmd.c win_con.c win_cur.c win_dyn.c \
		win_opt.c win_prop.c win_res.c win_rpc.c \
		cm.c cm_cb.c cm_cap.c cm_cur.c cm_disp.c cm_dyn.c \
		cm_lang.c cm_opt.c cm_prop.c cm_res.c cm_rpc.c \
		util.c

OBJ = 		$(SRC:.c=.o)

# HDR = 		xisql.h win.h cm.h
HDR = 		

DEFS = 		$(DEBUG) -Dlinux=1
INC =  		-I$(XINCPATH) -I. -I$(INCPATH)
CPPFLAGS = 	$(INC) $(DEFS)
GCCFLAGS =	-ansi -pedantic -Wall -Wtraditional -Wshadow -Wpointer-arith -pipe
CFLAGS = 	-O -g $(GCCFLAGS)
# LDFLAGS = -Bstatic -pg
# LDFLAGS = -static

SABER_XTRALIBS = /remote/pokey/conn4/gnu/install/lib/gcc-lib/sun4/2.4.5/libgcc.a
SABER_FLAGS =   $(CFLAGS) $(INC)

#
LINK.c = $(CC) $(LDFLAGS)

all:    $(TARGET)

#
# the following is a xcodecenter target for the xisql program. In 
# xcodecenter, just type "make xcodecenter"
#
xcodecenter: $(OBJ)
	#load $(SABER_FLAGS) $(OBJ) $(LIBS) $(SABER_XTRALIBS)

$(TARGET): $(OBJ)
	$(LINK.c) $(OBJ) $(LIBS) -o $@

purify: $(OBJ)
	purify $(LINK.c) $(OBJ) $(LIBS) -o $@

$(OBJ): $(HDR)

clean:
	rm -f *.o *.ln $(TARGET) *.out

sccs_clean:
	sccs clean

.PRECIOUS: $(TARGET)

#
# suffix rules for lint
#
.SUFFIXES:
.SUFFIXES:      .c $(SUFFIXES)
.c.o:
	$(CC) $(CFLAGS) $(CPPFLAGS) -c $<

