#####
#	Makefile for CALPLOT/src/cmd
#
#	Uncomment the region for your machine
#	Indicate the plot drivers to be compiled
#
#####

#####
#####
CCMP          = gcc -g
LINK          = gcc 
RM            = rm -f 
MV            = mv 
DEST          = ../../../bin
LDFLAGS       = 
LDFLAG        = -lm
XDIR          = /usr/X11R6/lib
XVINC         = ../XVIG/include
XVLIB         = ../../../lib/calxvig.a
LIBDIR        = ../../../lib
XVIGLDR       = ../../../lib/calxvig.a  -lX11 -lm



ALL = plotdbg plotnps reframe plotxvig clean

#####
#	Do not change anything bellow here
#####

.c.o:
	$(CCMP) -c $<

docp:
	cp ../cmd/*.c .
	cp ../include/*.h .

all: $(ALL)

#####
#	define the object dependencies
#####

DBGOBJS = plotdriv.o  dbsubs.o

NPSOBJS = plotdriv.o plotgen.o lineclip.o  zzpoint.o txtlbl.o symvec.o \
	rline.o rlinevec.o plotnps.o

XVIGOBJS = plotdriv.o plotxvig.o            plotgen.o lineclip.o  \
	symvec.o rline.o           rlinevec.o

4014OBJS = plotdriv.o plotgen.o lineclip.o  zzpoint.o txtlbl.o symvec.o \
	rline.o rlinevec.o plot4014.o



REFOBJS = reframe.o dpsubs.o

# Make the executables #

plotdbg:	$(DBGOBJS)
	$(CCMP) $(DBGOBJS) -o plotdbg
	$(MV) plotdbg $(DEST)

plotnps:       $(NPSOBJS)
	$(CCMP) $(NPSOBJS) $(LDFLAG) -o plotnps
	$(MV) plotnps $(DEST)

plot4014:       $(4014OBJS)
	$(CCMP) $(4014OBJS)  $(LDFLAG)  -o plot4014
	$(MV) plot4014 $(DEST)

plotxvig.o:	plotxvig.c
	$(CCMP) -c -I$(XVINC) plotxvig.c
plotxvig:       $(XVIGOBJS)
	$(CCMP) $(XVIGOBJS)  $(XVIGLDR) -o plotxvig
	$(MV) plotxvig $(DEST)



reframe:	$(REFOBJS)
	$(CCMP) $(REFOBJS) -o reframe
	mv reframe $(DEST)

clean:
	$(RM) *.o 
	$(RM) *.c
	$(RM) *.h

