## Makefile (D. Strubbe Dec 2011)
##

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

default: library
all: library

# NOTE: this target is 'flavorless'; the result is the same whether -DCPLX is used or not.
library: libBGW_wfn.a wfn_rho_vxc_io_m.mod peinfo_m.mod typedefs_m.mod nrtype_m.mod intrinsics_m.mod

wfn_rho_vxc_io_m.mod: $(COMMON)/wfn_rho_vxc_io_m.mod
	ln -sf $^ .

# Other codes are not expected to use any of the modules below, but some compilers require
# them to be present in order to use wfn_rho_vxc_io_m.mod since it depends on them.
peinfo_m.mod: $(COMMON)/peinfo_m.mod
	ln -sf $^ .

typedefs_m.mod: $(COMMON)/typedefs_m.mod
	ln -sf $^ .

nrtype_m.mod: $(COMMON)/nrtype_m.mod
	ln -sf $^ .

intrinsics_m.mod: $(COMMON)/intrinsics_m.mod
	ln -sf $^ .

libBGW_wfn.a : $(GLOBALOBJS) $(COMMON)/wfn_rho_vxc_io.o $(COMMON)/check_inversion.o $(COMMON)/sort.o
	$(AR) ru $@ $^
