######### QUISP makefile    (for QUISP with ploticus, see Makefile_pl)
#########
######### Note: After building quisp, the executable may be moved to your cgi-bin and renamed 
######### however you like.   Eg.     dbcgi dbcgi.cnf    pricelist.cgi pricelist.cnf


######### SHSQL embedded sql database is included by default.  To omit SHSQL, comment out 
######### the first 2 lines below, and uncomment the following 2 lines.
DBFLAG = -DTDH_DB=2
DBLIBS = ../lib/libshsql.a
# DBFLAG = -DTDH_DB=0
# DBLIBS = 



CC = gcc
BIN = ../bin

CFLAGS = $(DBFLAG) $(PLFLAG) -Wall
LIBS = $(DBLIBS) $(PLLIBS) -lm

TDOBJ = variable.o value_subst.o value.o times.o tdhkit.o sqlbuild.o sinterp.o \
shell.o secondaryops.o reslimits.o glroutines.o functions.o fieldmap.o err.o \
dbinterface.o dbfunc.o dates.o containswords.o condex.o checksum.o

CGIOBJ = quisp.o oplist.o cgiops.o cgic.o 


default: quisp quisputil
all: quisp quisputil quisp_pl


# QUISP - CGI-based quick server pages system
quisp: $(CGIOBJ) $(TDOBJ) custom.o
	$(CC) $(CGIOBJ) $(TDOBJ) custom.o $(LIBS) -o  $(BIN)/quisp
	chmod 6755 $(BIN)/quisp
	rm -rf quisp.o cgiops.o


# QUISPUTIL - command line quisp processor
# oplist functionality added - scg 11/4/04
quisputil: quisputil.o $(TDOBJ) custom.o oplist.o
	cc quisputil.o $(TDOBJ) custom.o oplist.o $(LIBS) -o  $(BIN)/quisputil
	rm -rf quisputil.o


# QUISP_PL - quisp w/ embedded ploticus
quisp_pl:
	make clean
	make -f Makefile_pl

# STRIPPER - utility to strip out quisp #operators and @variables, ie. for spell checking
stripper: stripper.o glroutines.o
	cc stripper.o glroutines.o -o $(BIN)/stripper


clean:
	rm -rf *.o 
