diff --git a/make/stanc b/make/stanc index 55c585913e..d5c1cc06a3 100644 --- a/make/stanc +++ b/make/stanc @@ -30,8 +30,8 @@ endif # bin/stanc build rules - requires stan, stan_math submodules in place ifeq ($(CMDSTAN_SUBMODULES),1) ifneq ($(STANC3),) -# build stanc3 from local installation - bin/stanc$(EXE) : $(shell find $(STANC3)/src/ -type f -name '*.ml*') $(STANC#) + # build stanc3 from local installation + bin/stanc$(EXE) : $(call findfiles,$(STANC3)/src/,*.ml*) $(STANC#) @mkdir -p $(dir $@) cd $(STANC3) && echo "--- Rebuilding stanc ---\n" && dune build @install cp $(STANC3)/_build/default/src/stanc/stanc.exe $@ @@ -90,7 +90,7 @@ bin/stanc2$(EXE) : bin/cmdstan/stanc.o # libstanc build rules -STANC_TEMPLATE_INSTANTIATION_CPP := $(shell find $(STAN)src/stan/lang -type f -name '*_inst.cpp') $(shell find $(STAN)src/stan/lang -type f -name '*_def.cpp') +STANC_TEMPLATE_INSTANTIATION_CPP := $(call findfiles,$(STAN)src/stan/lang,*_inst.cpp) $(call findfiles,$(STAN)src/stan/lang,*_def.cpp) STANC_TEMPLATE_INSTANTIATION := $(STANC_TEMPLATE_INSTANTIATION_CPP:$(STAN)src/stan/%.cpp=bin/cmdstan/%.o) bin/cmdstan/libstanc.a : $(STANC_TEMPLATE_INSTANTIATION) diff --git a/make/tests b/make/tests index 87397c841b..e578252a38 100644 --- a/make/tests +++ b/make/tests @@ -44,7 +44,7 @@ endif # Target to verify header files within CmdStan has # enough include calls ## -HEADER_TESTS := $(addsuffix -test,$(shell find src/cmdstan -name '*.hpp' -type f)) +HEADER_TESTS := $(addsuffix -test,$(call findfiles,src/cmdstan,*.hpp)) ifeq ($(OS),Windows_NT) DEV_NULL = nul diff --git a/makefile b/makefile index a5268b6f07..c80acf42db 100644 --- a/makefile +++ b/makefile @@ -218,9 +218,9 @@ clean: clean-manual clean-deps: @echo ' removing dependency files' - $(shell find src $(STAN)src/stan $(MATH)stan -type f -name '*.d' -exec rm {} +) - $(shell find src $(STAN)src/stan $(MATH)stan -type f -name '*.d.*' -exec rm {} +) - $(shell find src $(STAN)src/stan $(MATH)stan -type f -name '*.dSYM' -exec rm {} +) + $(RM) $(call findfiles,src,*.d) $(call findfiles,src/stan,*.d) $(call findfiles,$(MATH)/stan,*.d) + $(RM) $(call findfiles,src,*.d.*) $(call findfiles,src/stan,*.d.*) $(call findfiles,$(MATH)/stan,*.d.*) + $(RM) $(call findfiles,src,*.dSYM) $(call findfiles,src/stan,*.dSYM) $(call findfiles,$(MATH)/stan,*.dSYM) clean-manual: $(RM) -r doc