# This makefile builds QUISP with ploticus support
#
# NOTE: A "make clean" __MUST__ be done before building quisp_pl if most recent build was non-ploticus quisp.



######### To include embedded PLOTICUS support...
######### Best to use the version of ploticus bundled in the quisp_pl download..
PLFLAG = -DENABLE_PL
PLLIBS = ../lib/libploticus.a  -lpng -lz
# or perhaps something like this:
# PLLIBS = /home/scg/ploticus/src/libploticus.a  /home/scg/lib/libpng.a  /home/scg/lib/libz.a 


######### 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 = 


######### Done.  Now type:  make clean;  make
#########
######### 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



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_pl


# QUISP_PL - quisp with built-in ploticus graphics
quisp_pl: $(CGIOBJ) $(TDOBJ) custom.o
	$(CC) $(CGIOBJ) $(TDOBJ) custom.o $(LIBS) -o  $(BIN)/quisp_pl
	chmod 6755 $(BIN)/quisp_pl
	rm quisp.o cgiops.o



clean:
	rm *.o 
