Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion make/cpplint
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ PYTHON ?= python

.PHONY: cpplint
cpplint:
@$(PYTHON) $(CPPLINT)/cpplint.py --output=vs7 --counting=detailed --root=src --extension=hpp,cpp --filter=-runtime/indentation_namespace,-build/c++11,-readability/namespace,-legal/copyright,-whitespace/indent,-runtime/reference,-build/header_guard,-build/include_order,-build/include_what_you_use,-runtime/string,-build/namespaces $(shell find src/stan -name '*.hpp' -o -name '*.cpp')
@$(PYTHON) $(CPPLINT)/cpplint.py --output=vs7 --counting=detailed --root=src --extension=hpp,cpp --filter=-runtime/indentation_namespace,-build/c++11,-readability/namespace,-legal/copyright,-whitespace/indent,-runtime/reference,-build/header_guard,-build/include_order,-build/include_what_you_use,-runtime/string,-build/namespaces $(call findfiles,src/stan,*.hpp) $(call findfiles,src/stan,*.cpp)
2 changes: 1 addition & 1 deletion make/libstanc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
################################################################################
# libstanc build rules

STANC_TEMPLATE_INSTANTIATION_CPP := $(shell find src/stan/lang -type f -name '*_inst.cpp') $(shell find src/stan/lang -type f -name '*_def.cpp')
STANC_TEMPLATE_INSTANTIATION_CPP := $(call findfiles,src/stan/lang,*_inst.cpp) $(call findfiles,src/stan/lang,*_def.cpp)
STANC_TEMPLATE_INSTANTIATION := $(STANC_TEMPLATE_INSTANTIATION_CPP:src/%.cpp=test/%.o)

test/libstanc.a : $(STANC_TEMPLATE_INSTANTIATION)
Expand Down
14 changes: 7 additions & 7 deletions make/tests
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ endif
# needed by subset of unit tests that test stan compiler
# all these tests are under stan/test/unit/lang
##
STANC_TESTS_HEADERS := $(shell find src/test/unit/lang -type f -name '*_test.cpp')
STANC_TESTS_HEADERS := $(call findfiles,src/test/unit/lang,*_test.cpp)
STANC_TESTS_O := $(patsubst src/%.cpp,%.o,$(STANC_TESTS_HEADERS))
STANC_TESTS := $(patsubst src/%.cpp,%$(EXE),$(STANC_TESTS_HEADERS))

Expand All @@ -64,7 +64,7 @@ $(STANC_TESTS) : LDLIBS += $(LDLIBS_STANC)
# Target to verify header files within Stan has
# enough include calls
##
HEADER_TESTS := $(addsuffix -test,$(shell find src/stan -name '*.hpp' -type f))
HEADER_TESTS := $(addsuffix -test,$(call findfiles,src/stan,*.hpp))

ifeq ($(OS),Windows_NT)
DEV_NULL = nul
Expand Down Expand Up @@ -160,15 +160,15 @@ test/test-models/stanc$(EXE) : %$(EXE) : %.o
@mkdir -p $(dir $@)
$(LINK.cpp) $< $(LDLIBS) $(OUTPUT_OPTION)

TEST_MODELS = $(shell find src/test/test-models -type f -name '*.stan')
TEST_MODELS = $(call findfiles,src/test/test-models,*.stan)
$(patsubst src/%.stan,%.hpp,$(TEST_MODELS)) : test/test-models/%.hpp : src/test/test-models/%.stan test/test-models/stanc$(EXE)
@mkdir -p $(dir $@)
$(WINE) test/test-models/stanc$(EXE) $< --o=$@

##
# Generate C++ from Stan standalone functions
##
TEST_FUNCTIONS = $(shell find src/test/test-models -type f -name '*.stanfuncs')
TEST_FUNCTIONS = $(call findfiles,src/test/test-models,*.stanfuncs)
$(patsubst src/%.stanfuncs,%.hpp,$(TEST_FUNCTIONS)) : test/test-models/%.hpp : src/test/test-models/%.stanfuncs test/test-models/stanc$(EXE)
@mkdir -p $(dir $@)
$(WINE) test/test-models/stanc$(EXE) $< --o=$@
Expand All @@ -193,18 +193,18 @@ test/unit/lang/stanc_helper_test.o: change-file-permissions
# Add additional dependencies for tests that should translate Stan to hpp, but
# isn't included in the source using `#include`.
##
test/unit/lang/parser_generator_test$(EXE): $(patsubst src/%.stan,%.hpp,$(shell find src/test/test-models/good/parser-generator -type f -name '*.stan'))
test/unit/lang/parser_generator_test$(EXE): $(patsubst src/%.stan,%.hpp,$(call findfiles,src/test/test-models/good/parser-generator,*.stan))

##
# Compile models depends on every model within
# src/test/test-models/good/*.stan being able to
# be code-generated to a *.hpp, then passed through
# the compiler using the -fsyntax-only flag
##
test/integration/compile_models_test$(EXE): $(patsubst src/%.stan,%.hpp-test,$(shell find src/test/test-models/good -type f -name '*.stan'))
test/integration/compile_models_test$(EXE): $(patsubst src/%.stan,%.hpp-test,$(call findfiles,src/test/test-models/good,*.stan))

##
# Same trick as above for models, but for standalone functions, using
# "src/test/test-models/good-standalone-functions/*.stanfuncs"
##
test/integration/compile_standalone_functions_test$(EXE): $(patsubst src/%.stanfuncs,%.hpp-test,$(shell find src/test/test-models/good-standalone-functions -type f -name '*.stanfuncs'))
test/integration/compile_standalone_functions_test$(EXE): $(patsubst src/%.stanfuncs,%.hpp-test,$(call findfiles,src/test/test-models/good-standalone-functions,*.stanfuncs))
8 changes: 4 additions & 4 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ help:
##
# Clean up.
##
MODEL_SPECS := $(shell find src/test -type f -name '*.stan')
MODEL_SPECS := $(call findfiles,src/test,*.stan)
.PHONY: clean clean-demo clean-dox clean-models clean-all clean-deps
clean:
$(RM) $(shell find src -type f -name '*.dSYM') $(shell find src -type f -name '*.d.*')
$(RM) $(call findfiles,src,*.dSYM) $(call findfiles,src,*.d.*)
$(RM) $(wildcard $(MODEL_SPECS:%.stan=%.hpp))
$(RM) $(wildcard $(MODEL_SPECS:%.stan=%$(EXE)))
$(RM) $(wildcard $(MODEL_SPECS:%.stan=%.o))
Expand All @@ -122,12 +122,12 @@ clean-dox:

clean-deps:
@echo ' removing dependency files'
$(shell find . -type f -name '*.d' -exec rm {} +)
$(RM) $(call findfiles,.,*.d)

clean-all: clean clean-dox clean-deps clean-libraries
$(RM) -r test bin
@echo ' removing .o files'
$(shell find src -type f -name '*.o' -exec rm {} +)
$(RM) $(call findfiles,src,*.o)

##
# Submodule related tasks
Expand Down