1- .PHONY: static
1+ .PHONY: static package
22
33CXX_STD = CXX17
44PKG_CPPFLAGS = -DNO_FPRINTF_OUTPUT -I"../inst/include" -I"sundials" -include stan_sundials_printf_override.hpp
@@ -9,46 +9,44 @@ SHLIB_LDFLAGS = $(SHLIB_CXXLDFLAGS)
99SHLIB_LD = $(SHLIB_CXXLD)
1010
1111SUNDIALS_CVODES := \
12- $(wildcard cvodes/*.c) \
13- $(wildcard sundials/*.c) \
14- $(wildcard sunmatrix/band/[^f]*.c) \
15- $(wildcard sunmatrix/dense/[^f]*.c) \
16- $(wildcard sunlinsol/band/[^f]*.c) \
17- $(wildcard sunlinsol/dense/[^f]*.c) \
18- $(wildcard sunnonlinsol/newton/[^f]*.c) \
19- $(wildcard sunnonlinsol/fixedpoint/[^f]*.c)
12+ $(wildcard math/lib/sundials_*/src/ cvodes/*.c) \
13+ $(wildcard math/lib/sundials_*/src/ sundials/*.c) \
14+ $(wildcard math/lib/sundials_*/src/ sunmatrix/band/[^f]*.c) \
15+ $(wildcard math/lib/sundials_*/src/ sunmatrix/dense/[^f]*.c) \
16+ $(wildcard math/lib/sundials_*/src/ sunlinsol/band/[^f]*.c) \
17+ $(wildcard math/lib/sundials_*/src/ sunlinsol/dense/[^f]*.c) \
18+ $(wildcard math/lib/sundials_*/src/ sunnonlinsol/newton/[^f]*.c) \
19+ $(wildcard math/lib/sundials_*/src/ sunnonlinsol/fixedpoint/[^f]*.c)
2020
2121SUNDIALS_IDAS := \
22- $(wildcard idas/*.c) \
23- $(wildcard sundials/*.c) \
24- $(wildcard sunmatrix/band/[^f]*.c) \
25- $(wildcard sunmatrix/dense/[^f]*.c) \
26- $(wildcard sunlinsol/band/[^f]*.c) \
27- $(wildcard sunlinsol/dense/[^f]*.c) \
28- $(wildcard sunnonlinsol/newton/[^f]*.c) \
29- $(wildcard sunnonlinsol/fixedpoint/[^f]*.c)
22+ $(wildcard math/lib/sundials_*/src/idas/*.c)
3023
3124SUNDIALS_KINSOL := \
32- $(wildcard kinsol/*.c) \
33- $(wildcard sundials/*.c) \
34- $(wildcard sunmatrix/band/[^f]*.c) \
35- $(wildcard sunmatrix/dense/[^f]*.c) \
36- $(wildcard sunlinsol/band/[^f]*.c) \
37- $(wildcard sunlinsol/dense/[^f]*.c) \
38- $(wildcard sunnonlinsol/newton/[^f]*.c) \
39- $(wildcard sunnonlinsol/fixedpoint/[^f]*.c)
25+ $(wildcard math/lib/sundials_*/src/kinsol/*.c)
4026
4127SUNDIALS_NVECSERIAL := \
42- $(addprefix , nvector/serial/nvector_serial.c sundials/sundials_math .c)
28+ $(wildcard math/lib/sundials_*/src/ nvector/serial/nvector_serial.c)
4329
4430SOURCES = $(SUNDIALS_CVODES) $(SUNDIALS_IDAS) $(SUNDIALS_KINSOL) $(SUNDIALS_NVECSERIAL)
4531OBJECTS_C = $(SOURCES:.c=.o)
4632OBJECTS = $(OBJECTS_C:.cpp=.o)
4733
34+ $(SHLIB): static
35+ $(OBJECTS): package
36+
37+ package:
38+ @mkdir -p ../inst/include
39+ @cp -Rf stan/src ../inst/include/src
40+ @cp -Rf math/stan ../inst/include/stan
41+ @cp -Rf math/lib/sundials_*/include/* ../inst/include/
42+ @cp -Rf math/lib/sundials_*/src/sundials .
43+
4844static: $(OBJECTS)
4945 @mkdir -p ../lib
5046 $(AR) -rs ../lib/libStanHeaders.a $(OBJECTS)
5147
5248clean:
5349 rm -rf ../lib
5450 rm $(OBJECTS)
51+ rm -rf ../inst/include/
52+ rm -rf sundials
0 commit comments