# local include files shared by graphics
LINC=	$(axiom_src_srcdir)/graph/include

# global include files shared by everyone
GINC=	$(axiom_src_srcdir)/include

build_libdir = $(abs_top_builddir)/src/lib

bin_PROGRAMS = view2D$(EXEEXT)

view2D_sources = buttons2d.c control2d.c graph2d.c main2d.c pot2d.c \
		process2d.c spadAction2d.c stuff2d.c viewport2D.c write2d.c

view2D_objects = $(view2D_sources:.c=.$(OBJEXT))

Gfun_objects = ../Gdraws/Gfun.$(OBJEXT) 

view2D_LDADD = -L$(build_libdir) -lspad

view2D_DEPENDENCIES = $(Gfun_objects) $(build_libdir)/libspad.a

subdir = src/graph/view2D/

AXIOM_CFLAGS  = ${CCF} ${AXIOM_X11_CFLAGS} -I${LINC} -I${GINC} -I$(srcdir) \
			$(axiom_includes)

GDRAW_OBJS = ../Gdraws/Gfun.$(OBJEXT)

HEADERS = $(srcdir)/header2.h   $(srcdir)/globals2.h      ${LINC}/view2D.h \
          ${LINC}/actions.h ${LINC}/viewCommand.h ${GINC}/view.h   ${LINC}/G.h

.PHONY: all all-ax all-view2D

all: all-ax

all-ax all-view2D: stamp
	@ echo finished $(builddir)

stamp: $(axiom_target_libdir)/view2D$(EXEEXT)
	-rm -f stamp
	$(STAMP) stamp

$(axiom_target_libdir)/view2D$(EXEEXT): $(view2D_objects) $(view2D_DEPENDENCIES)
	${CC} $(view2D_objects) $(Gfun_objects) -o $@ \
	    $(view2D_LDADD) $(AXIOM_X11_LDFLAGS) -lm 

.PRECIOUS: %.$(OBJEXT)

%.$(OBJEXT): $(HEADERS)

%.$(OBJEXT): $(srcdir)/%.c $(axiom_c_macros.h)
	${CC} -c $(CFLAGS) $(AXIOM_CFLAGS) -o $@ $<

mostlyclean-local:
	-rm -f $(view2D_objects)
	-rm -f stamp

clean-local: mostlyclean-local
	-rm -f $(axiom_target_libdir)/view2D$(EXEEXT)

distclean-local: clean-local
