[ADMB Users] using tpl2cpp with gnu make

John Sibert sibert at hawaii.edu
Fri Mar 8 11:04:02 PST 2013


Under circumstances that I do not entirely understand, gnu make will 
remove the cpp file if you use tpl2cpp with implicit rules such as these

%.cpp:%.tpl;
     tpl2cpp $*

%.htp:%.tpl;
     tpl2cpp $*

Usually it doesn't matter, but there are situations where you really 
need to have the cpp file, such as when using a debugger or finding an 
obscure syntax error in the tpl.

You can prevent this behavior by using declaring certain targets to be 
".PRECIOUS". Simply insert the following line near the top of your makefile
.PRECIOUS: %.cpp %.htp

-- 
John Sibert
Emeritus Researcher, SOEST
University of Hawaii at Manoa
Honolulu HI (GMT-10)
808-294-3842

Visit the ADMB project http://admb-project.org/




More information about the Users mailing list