.PHONY: static

PKG_CPPFLAGS=-DNO_FPRINTF_OUTPUT -I"../inst/include" -include stan_sundials_printf_override.hpp

SUNDIALS_CVODES = cvodes/cvodea.c     cvodes/cvodes_bandpre.c  cvodes/cvodes.c       cvodes/cvodes_direct.c  cvodes/cvodes_ls.c   cvodes/cvodes_nls_sim.c   cvodes/cvodes_nls_stg.c cvodes/cvodea_io.c  cvodes/cvodes_bbdpre.c   cvodes/cvodes_diag.c  cvodes/cvodes_io.c      cvodes/cvodes_nls.c  cvodes/cvodes_nls_stg1.c  cvodes/cvodes_spils.c sundials/sundials_band.c       sundials/sundials_linearsolver.c  sundials/sundials_nonlinearsolver.c      sundials/sundials_sparse.c sundials/sundials_dense.c      sundials/sundials_math.c          sundials/sundials_nvector.c              sundials/sundials_spbcgs.c sundials/sundials_direct.c     sundials/sundials_matrix.c        sundials/sundials_nvector_senswrapper.c  sundials/sundials_sptfqmr.c sundials/sundials_iterative.c  sundials/sundials_mpi.c           sundials/sundials_pcg.c                  sundials/sundials_version.c sunmatrix/band/sunmatrix_band.c sunmatrix/dense/sunmatrix_dense.c sunnonlinsol/newton/sunnonlinsol_newton.c sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c sunlinsol/dense/sunlinsol_dense.c
SUNDIALS_IDAS = idas/idaa.c     idas/idas_bbdpre.c  idas/idas_direct.c  idas/idas_io.c  idas/idas_nls.c      idas/idas_nls_stg.c idas/idaa_io.c  idas/idas.c         idas/idas_ic.c      idas/idas_ls.c  idas/idas_nls_sim.c  idas/idas_spils.c
SUNDIALS_NVECSERIAL = nvector/serial/nvector_serial.c
SOURCES = $(SUNDIALS_CVODES) $(SUNDIALS_IDAS) $(SUNDIALS_NVECSERIAL)
OBJECTS = $(SOURCES:.c=.o)

static: $(OBJECTS)
	@mkdir -p ../lib
	$(AR) -rs ../lib/libStanHeaders.a $(OBJECTS)
				
clean:
	rm -rf ../lib
	rm $(OBJECTS)

