swh:1:snp:d80eec3f654c152adbdd6e641362bcb340d39fe2
Tip revision: ac026fa5ed39aa62ced29206061424036d143c17 authored by Ben Goodrich on 13 August 2014, 15:43:55 UTC
run fix_includes.py from iwyu project on all .hpp files
run fix_includes.py from iwyu project on all .hpp files
Tip revision: ac026fa
models
##
# Models (to be passed through stanc)
##
MODEL_HEADER := src/stan/model/model_header.hpp
.PRECIOUS: %.cpp %.o
$(patsubst %.stan,%,$(wildcard $(addsuffix .stan,$(MAKECMDGOALS)))) : % : %.o bin/libstan.a %.stan
@echo ''
@echo '--- Linking C++ model ---'
$(LINK.c) -O$O $(OUTPUT_OPTION) $< $(LDLIBS)
src/%: src/%.o bin/libstan.a
@echo ''
@echo '--- Linking C++ model ---'
$(LINK.c) -O$O $(OUTPUT_OPTION) $< $(LDLIBS)
%.exe: %.o bin/libstan.a %.stan
@echo ''
@echo '--- Linking C++ model ---'
$(LINK.c) -O$O $(OUTPUT_OPTION) $< $(LDLIBS)
.PRECIOUS: %.cpp
%.cpp : %.stan $(MODEL_HEADER) test/test-models/stanc$(EXE)
@echo ''
@echo '--- Translating Stan model to C++ code ---'
$(WINE) test/test-models/stanc$(EXE) $< --o=$@
.PRECIOUS: models/speed/%.stan
models/speed/%.stan : src/models/speed/%.stan
@mkdir -p $(dir $@)
@echo ''
@echo '--- Copying model ---'
cp $< $@
@if test -f $(basename $<)*_generate_data.R; then \
echo '';\
echo '--- Copying generate script ---';\
cp $(wildcard $(basename $<)*_generate_data.R) $(dir $@);\
echo 'cp $(wildcard $(basename $<)*_generate_data.R) $(dir $@)';\
fi;
@if test -f $(basename $<)*.data.R; then \
echo '';\
echo '--- Copying data ---';\
cp $(wildcard $(basename $<)*.data.R) $(dir $@);\
echo 'cp $(wildcard $(basename $<)*.data.R) $(dir $@)';\
fi;
.PRECIOUS: models/%.stan models/%.data.R
models/%.stan : src/models/%.stan
@mkdir -p $(dir $@)
@echo ''
@echo '--- Copying model ---'
cp $< $@
@if test -f $(patsubst src/models/%.stan,src/models/%.data.R,$<); then \
echo '';\
echo '--- Copying data ---';\
cp $(addsuffix .data.R,$(basename $<)) $(addsuffix .data.R,$(basename $@));\
echo 'cp $(addsuffix .data.R,$(basename $<)) $(addsuffix .data.R,$(basename $@))';\
fi;
@if test -f $(patsubst src/models/%.stan,src/models/%.init.R,$<); then \
echo '';\
echo '--- Copying init ---';\
cp $(addsuffix .init.R,$(basename $<)) $(addsuffix .init.R,$(basename $@));\
echo 'cp $(addsuffix .init.R,$(basename $<)) $(addsuffix .init.R,$(basename $@))';\
fi;
$(MODEL_HEADER).d : $(MODEL_HEADER)
@if test -d $(dir $@); \
then \
(set -e; \
rm -f $@; \
$(CC) $(CFLAGS) -O$O $(TARGET_ARCH) -MM $< > $@.$$$$; \
sed -e 's,\($(notdir $(basename $(MODEL_HEADER)))\)\.o[ :]*,$@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$ ); \
fi
##
# Will generate dependencies.
##
ifneq (,$(filter-out clean%,$(MAKECMDGOALS)))
-include $(MODEL_HEADER).d
endif