From d55d874be81b7e134f88612fe662e78e3c7deba7 Mon Sep 17 00:00:00 2001 From: rok-cesnovar Date: Sat, 14 Mar 2020 22:07:19 +0100 Subject: [PATCH] cleanup of gnu find --- make/stanc | 4 ++-- make/tests | 2 +- makefile | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/make/stanc b/make/stanc index 2cd8272f69..0112a65697 100644 --- a/make/stanc +++ b/make/stanc @@ -29,7 +29,7 @@ endif ifeq ($(CMDSTAN_SUBMODULES),1) ifneq ($(STANC3),) - bin/stanc$(EXE) : $(shell find $(STANC3)/src/ -type f -name '*.ml*') $(STANC#) + 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 $@ @@ -65,7 +65,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