# This is the Makefile for plot2fig, a plot file to transfig translator.
CC=gcc
CFLAGS=-g
#----------------------------------------------------------------
# The toplevel make file uses these.
.PHONY: all install clean realclean

# $(DEV) indicates which graphics device this library supports.
DEV=fig
all : plot2$(DEV)

VERS=0.2
.c.o:
	$(CC) $(CFLAGS) -DVERS=\"$(VERS)\" -c $<

install : plot2$(DEV)
	install -c plot2$(DEV) $(BINDIR)
	install -c plot2$(DEV).man $(MANDIR)/plot2$(DEV).$(MANEXT)
clean :
	-rm -f *.o *~ \#* core test* diff TAGS CHECKSUMS
realclean : clean
	-rm -f plot2$(DEV) *.a
#----------------------------------------------------------------

plot2$(DEV) : plot.o lib$(DEV).a
	$(CC) $(CFLAGS) -o plot2$(DEV) plot.o lib$(DEV).a -lm
#
# Type `make libfig.a' to creaate the plot compatible library of
# functions for postscript output.
#
LSRC = openpl.c closepl.c space.c rotate.c dot.c point.c \
linemod.c line.c label.c alabel.c erase.c color.c move.c cont.c \
arc.c circle.c fontname.c fontsize.c fill.c draw_line.c

LOBJ = openpl.o closepl.o space.o rotate.o dot.o point.o \
linemod.o line.o label.o alabel.o erase.o color.o move.o cont.o \
arc.o circle.o fontname.o fontsize.o fill.o draw_line.o

lib$(DEV).a : $(LOBJ)
	ar ru lib$(DEV).a $?
	ranlib lib$(DEV).a

#
# Type `make TAGS' to update the TAGS file for use with GNU emacs.
#
TAGS : plot.c $(LSRC) libplot.h
	etags plot.c $(LSRC) libplot.h

#----------------------------------------------------------------
# Dependencies generated by gcc -MM *.c *.h:
#
alabel.o : alabel.c libplot.h extern.h
arc.o : arc.c libplot.h extern.h
circle.o : circle.c libplot.h extern.h
closepl.o : closepl.c libplot.h extern.h
color.o : color.c libplot.h extern.h
cont.o : cont.c libplot.h extern.h
dot.o : dot.c libplot.h extern.h
draw_line.o : draw_line.c libplot.h extern.h
erase.o : erase.c libplot.h extern.h
fill.o : fill.c libplot.h extern.h
fontname.o : fontname.c libplot.h extern.h
fontsize.o : fontsize.c libplot.h extern.h
label.o : label.c libplot.h extern.h
line.o : line.c libplot.h extern.h
linemod.o : linemod.c libplot.h extern.h
move.o : move.c libplot.h extern.h
openpl.o : openpl.c libplot.h extern.h
plot.o : plot.c libplot.h
point.o : point.c libplot.h extern.h
rotate.o : rotate.c libplot.h extern.h
space.o : space.c libplot.h extern.h
