SRCDIR = ./
LIBDIR = ./

all: ${LIBDIR}penplot.a

################# penplot.a ###############################
PEN_PLOT_OBJS   = $(PEN_PLOT_C_SRC:.c=.o) $(PEN_PLOT_F_OBJS)
PEN_PLOT_C_SRC  = ${SRCDIR}ex.c ${SRCDIR}penplot2.c
PEN_PLOT_F_OBJS = ${SRCDIR}export.o \
                  ${SRCDIR}contur.o \
                  ${SRCDIR}penplot1.o \
                  ${SRCDIR}dash1.o \
                  ${SRCDIR}manyplot.o \
                  ${SRCDIR}letter.o 

${SRCDIR}penplot1.o:${SRCDIR}penplot1.f ${SRCDIR}penplot.com
${SRCDIR}ex.o:${SRCDIR}ex.c
${SRCDIR}penplot2.o:${SRCDIR}penplot2.c
${SRCDIR}dash1.o:${SRCDIR}dash1.f ${SRCDIR}penplot.com
${SRCDIR}manyplot.o:${SRCDIR}manyplot.f ${SRCDIR}penplot.com
${SRCDIR}letter.o:${SRCDIR}letter.f ${SRCDIR}penplot.com
${SRCDIR}contur.o:${SRCDIR}contur.f
${SRCDIR}export.o:${SRCDIR}export.f ${SRCDIR}penplot.com

${LIBDIR}penplot.a: $(PEN_PLOT_OBJS)
	$(AR) $@ $?
	$(RANLIB) $@
	echo "Done building $@"

clean:
	-rm ${SRCDIR}ex.o ${SRCDIR}penplot2.o \
	$(PEN_PLOT_F_OBJS)  \
	${LIBDIR}penplot.a
