#**************************************************************
#The following two variables will have to be changed to point 
#to the library and the include directory respectively.

LIBDIR=-L/home/unisql/TargetDir/lib
INCDIR=-I/home/unisql/TargetDir/include 

#DO NOT CHANGE ANYTHING BEYOND THIS LINE
#**************************************************************


Compile: reco1.o reco2.o reco3.o reco4.o trans.o reset.o 

reco1.o: reco1.c
	gcc $(INCDIR) -c reco1.c
reco1.c: reco1.ec
	esqlx reco1.ec

reco2.o: reco2.c
	gcc $(INCDIR) -c reco2.c
reco2.c: reco2.ec
	esqlx reco2.ec

reset.o: reset.c
	gcc $(INCDIR) -c reset.c
reset.c: reset.ec
	esqlx reset.ec

reco3.o: reco3.c
	gcc $(INCDIR) -c reco3.c
reco3.c: reco3.ec
	esqlx reco3.ec

reco4.o: reco4.c
	gcc $(INCDIR) -c reco4.c
reco4.c: reco4.ec
	esqlx reco4.ec

trans.o: trans.c
	gcc $(INCDIR) -c trans.c
trans.c: trans.ec
	esqlx trans.ec

trans :
	gcc -o trans trans.o $(LIBDIR) -lesqlx -lsqlxone -lsqlxutil -lm

reco1 :
	gcc -o reco1 reco1.o $(LIBDIR) -lesqlx -lsqlxone -lsqlxutil -lm

reco2 :
	gcc -o reco2 reco2.o $(LIBDIR) -lesqlx -lsqlxone -lsqlxutil -lm

reco3 :
	gcc -o reco3 reco3.o $(LIBDIR) -lesqlx -lsqlxone -lsqlxutil -lm

reco4 :
	gcc -o reco4 reco4.o $(LIBDIR) -lesqlx -lsqlxone -lsqlxutil -lm

Runtrans : trans
	trans > transres.txt
	reset

Runreco1 : reco1
	reco1 > reco1.txt
	reset

Runreco2 : reco2
	reco2 > reco2.txt
	reset

Runreco3 : reco3
	reco3 > reco3.txt
	reset

Runreco4 : reco4
	reco4 > reco4.txt
	reset

Run: Runtrans Runreco1 Runreco2 Runreco3 Runreco4

Clean : 
	rm transres.txt reco1.txt reco2.txt reco3.txt reco4.txt 
