default: kapa
help:
	@echo "make options: kapa (default)"

include ../../Makefile.System
HOME 	=	$(ROOT)/src/kapa
LIB	=	$(HOME)/lib
BIN	=	$(HOME)/bin
LIB	=	$(HOME)/lib
EDIR	=	$(HOME)/event
GDIR	=	$(HOME)/graph
SDIR	=	$(HOME)/setup
INC	=	$(HOME)/include
include ../../Makefile.Common

# programs may add their own internal requirements here
FULL_CFLAGS   = $(BASE_CFLAGS)
FULL_CPPFLAGS = $(BASE_CPPFLAGS)
FULL_LDFLAGS  = -lkapa -ldvo -lFITS -lohana $(BASE_LDFLAGS)

LDDEPS  = $(DESTLIB)/libkapa.a $(DESTLIB)/libdvo.a $(DESTLIB)/libFITS.a $(DESTLIB)/libohana.a
INDEPS  = $(DESTINC)/kapa.h $(DESTINC)/dvo.h $(DESTINC)/gfitsio.h $(DESTINC)/ohana.h

kapa: $(BIN)/kapa.$(ARCH)
install: $(DESTBIN)/kapa

# local source / object files ########################
EOBJ = \
$(EDIR)/CheckPipe.$(ARCH).o               $(EDIR)/Stop.$(ARCH).o               \
$(EDIR)/EventLoop.$(ARCH).o         	  $(EDIR)/Reconfig.$(ARCH).o           \
$(EDIR)/SetFont.$(ARCH).o           	  $(EDIR)/PositionPicture.$(ARCH).o\
$(EDIR)/InterpretKeys.$(ARCH).o     	  $(EDIR)/Refresh.$(ARCH).o		\
$(EDIR)/SetSection.$(ARCH).o		  $(EDIR)/FlushDisplay.$(ARCH).o	\
$(EDIR)/Resize.$(ARCH).o

GOBJ = \
$(GDIR)/DrawObjects.$(ARCH).o             $(GDIR)/DrawFrame.$(ARCH).o       	\
$(GDIR)/DrawText.$(ARCH).o		  $(GDIR)/LoadObject.$(ARCH).o		\
$(GDIR)/ErasePlot.$(ARCH).o		  $(GDIR)/LoadBox.$(ARCH).o		\
$(GDIR)/SetLimits.$(ARCH).o               $(GDIR)/PSObjects.$(ARCH).o		\
$(GDIR)/DrawLabels.$(ARCH).o              $(GDIR)/LoadLabels.$(ARCH).o		\
$(GDIR)/cursor.$(ARCH).o 		  $(GDIR)/PSFrame.$(ARCH).o		\
$(GDIR)/LoadPtext.$(ARCH).o		  $(GDIR)/DrawPtext.$(ARCH).o		\
$(GDIR)/PSLabels.$(ARCH).o		  $(GDIR)/PSPtext.$(ARCH).o		\
$(GDIR)/PPMit.$(ARCH).o	          \

BDRAW = \
$(GDIR)/bDrawIt.$(ARCH).o	  	  $(GDIR)/bDrawFrame.$(ARCH).o          \
$(GDIR)/bDrawLabels.$(ARCH).o             $(GDIR)/bDrawObjects.$(ARCH).o        \
$(GDIR)/PNGit.$(ARCH).o \

SOBJ = \
$(SDIR)/CheckColors.$(ARCH).o             $(SDIR)/MakeGC.$(ARCH).o             \
$(SDIR)/CheckDisplayName.$(ARCH).o  	  $(SDIR)/MapWindow.$(ARCH).o          \
$(SDIR)/CheckFontName.$(ARCH).o     	  $(SDIR)/NameWindow.$(ARCH).o         \
$(SDIR)/CheckGeometry.$(ARCH).o     	  $(SDIR)/OpenDisplay.$(ARCH).o        \
$(SDIR)/CloseDisplay.$(ARCH).o      	  $(SDIR)/QuitX.$(ARCH).o              \
$(SDIR)/CreateWindow.$(ARCH).o      	  $(SDIR)/SetNormalHints.$(ARCH).o     \
$(SDIR)/DefineLayout.$(ARCH).o      	  $(SDIR)/SetUpDisplay.$(ARCH).o       \
$(SDIR)/SetUpWindow.$(ARCH).o        	  $(SDIR)/args.$(ARCH).o               \
$(SDIR)/GetColor.$(ARCH).o          	  $(SDIR)/SetWMHints.$(ARCH).o         \
$(SDIR)/LoadFont.$(ARCH).o          	  $(SDIR)/TopWindow.$(ARCH).o          \
$(SDIR)/Ximage.$(ARCH).o             \
$(SDIR)/MakeCursor.$(ARCH).o

OBJ  =  $(EOBJ) $(GOBJ) $(SOBJ) $(BDRAW)

# dependancy rules for include files ########################
$(OBJ): $(INC)/Ximage.h \
	$(INC)/constants.h \
	$(INC)/structures.h \
	$(INC)/prototypes.h

$(OBJ): $(INDEPS) $(LDDEPS)

$(BIN)/kapa.$(ARCH): $(OBJ)
