## Makefile (D. Strubbe Nov 2009)
##

PREFIX=../..
include $(PREFIX)/Common/common-rules.mk

SRC     = kgrid.f90 kgrid_routines.f90
OBJ     = $(SRC:.f90=.o)

# object files from Common directory
COMMONOBJS = $(COMMON)/misc.o $(COMMON)/sort.o $(COMMON)/blas.o $(COMMON)/lapack.o $(COMMON)/symmetries.o $(GLOBALOBJS)
EXTRAOBJS = $(COMMON)/blas.o $(COMMON)/lapack.o $(GLOBALOBJS)

LIBS = $(LAPACKLIB)

default: kgrid

kgrid: kgrid.x

kgrid.x: $(COMMONOBJS) $(OBJ) $(SPGLIB)/libsymspg.a
	$(LINK) $(FOPTS) -o $@ $^ $(LIBS)
	$(INSTALL_CMD)

kgrid.o : $(GLOBALMODS) $(COMMON)/misc_m.mod $(COMMON)/symmetries_m.mod kgrid_routines_m.mod
kgrid_routines.o kgrid_routines_m.mod : $(GLOBALMODS) $(COMMON)/misc_m.mod

