############################################################################
#
#  Program:         QUEST V1.05
#
#  Module:          Makefile
#
#  Purpose:         Top-level Makefile
#
#  Modified:        8/20/2009
#
############################################################################

include make.inc

# targets

all: lib 

lib: checkfc
	$(checkdir)
	(cd SRC; $(MAKE))

example: lib
	(cd EXAMPLE; $(MAKE))

clean:
	(cd SRC; $(MAKE) clean)
	(cd EXAMPLE; $(MAKE) clean)
	(rm -f $(DQMCLIB))

# commands for checking basic settings

checkfc:
ifeq ($(FC),) 
	$(error "need to specify Fortran compiler, FC=, in make.inc")
endif

checkdir:
ifeq ($(HOME),) 
	$(error "need to specify the program directory, HOME=, in make.inc")
endif

checklib: 
ifeq (libfile,)
	$(error "need to build the libaray first, make lib.")
endif


