TOP=/home/avp/sandbox/kostas/installed
CHROMA=$(TOP)/chroma/scalar


CHROMA_CC=$(shell $(CHROMA)/bin/chroma-config --cxx)
CHROMA_CCFLAGS=-g $(shell $(CHROMA)/bin/chroma-config --cxxflags) \
              -I/home/avp/sandbox/kostas/tmp/chroma/lib/actions/ferm/fermacts \
               -I..
CHROMA_LDFLAGS=-g $(shell $(CHROMA)/bin/chroma-config --ldflags)
CHROMA_LIBS=$(shell $(CHROMA)/bin/chroma-config --libs) -llevel3

source = kno.cc \
         operator.cc \
         solver.cc

objects = ../dwf.o ../xmp/ymp.o

.PHONY: all clean realclean tar

all: $(source:%.cc=%)

clean:
	$(RM) $(source:%.cc=%.o) *~

realclean: clean
	$(RM) $(source:%.cc=%) dwf.solution

################
$(source:%.cc=%): % : %.o
	$(CHROMA_CC) $(CHROMA_LDFLAGS) -o $@ $< $(objects) $(CHROMA_LIBS)

$(source:%.cc=%.o): %.o : %.cc
	$(CHROMA_CC) $(CHROMA_CCFLAGS) -c -o $@ $<


$(source:%.cc=%.o): read-gauge.cc write-propagator.cc
$(source:%.cc=%): $(objects)


kno.o: qprop.cc converter.cc
operator.o: dirac.cc converter.cc
solver.o: cg5.cc converter.cc
