#-*- Makefile -*-
include ../../gnuwin32/MkRules

all: ../../../bin/Rblas.dll

## suppress lots of warnings: this is a dummy
blas00.o: blas00.c
	$(CC) -O3 -I../../include  -c $< -o $@

## Rblas.dll imports xerbla_ from R.dll
ifeq ($(strip $(USE_ACML)),YES)
../../../bin/Rblas.dll: blas00.o ../../gnuwin32/dllversion.o
	@$(ECHO) -------- Building $@ --------
	$(DLL) -shared $(DLLFLAGS) -o $@ $^ Rblas.def \
	   -L../../../bin -lR  -L"$(ACML_PATH)" -lacml $(FLIBS)
else
ifeq ($(strip $(USE_ATLAS)),YES)
../../../bin/Rblas.dll: blas00.o ../../gnuwin32/dllversion.o
	@$(ECHO) -------- Building $@ --------
	$(DLL) -shared $(DLLFLAGS) -o $@ $^ Rblas.def \
	   -L../../../bin -lR  -L"$(ATLAS_PATH)" -lf77blas -latlas -lg2c
else
../../../bin/Rblas.dll: blas.o cmplxblas.o ../../gnuwin32/dllversion.o
	@$(ECHO) -------- Building $@ --------
	$(DLL) -shared $(DLLFLAGS) -o $@ $^ Rblas.def -L../../../bin -lR $(FLIBS)
endif
endif

distclean clean:
	@$(RM) ../../../bin/Rblas.dll *~ blas00.o blas00.d blas.o cmplxblas.o

