<div dir="ltr"><div><div><div>Alright, I left the GNUMakefile as it is and copied it into my program directory. It gives the following error:<br><br>make: Circular run <- run dependency dropped.<br><br>Running model:<br><br>Running run:<br>/bin/sh: ./run: No such file or directory<br>make: *** [run] Error 127<br><br></div>Can you help me here?<br><br></div>Thanks again for your help<br><br></div>Ulf<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 24, 2015 at 1:13 PM, Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
On 24 July 2015 at 10:18, Ulf Mertens wrote:<br>
| Hi,<br>
|<br>
| I just looked into the GNUMakefile. I think I just have to only change those<br>
| two lines, right?<br>
|<br>
| sources :=         $(wildcard *.cpp)<br>
| programs :=       $(sources:.cpp=)<br>
<br>
</span>The idea here is that each .cpp leads to one executable, and its build is<br>
triggered by a change in it.  (<br>
<span class=""><br>
| If I understand it correctly, it only works for .cpp files. So it has be<br>
| changed to something like this?<br>
|<br>
| sources :=        $(wildcard *.cpp)<br>
| header :=          $(wildcard *.h)<br>
| programs :=      $(sources:.cpp= header:.h=)<br>
<br>
</span>The header files are implicit.  You could just enumerate the files by hand.:<br>
Or, as eg in examples/threads/GNUmakefile, just write the rule:<br>
<br>
<br>
all:                    boostEx<br>
<br>
boostEx:                boostEx.cpp<br>
                        $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^ $(LDLIBS)<br>
                        strip $@<br>
<br>
where strip of course optional too.  'boostEx' could depend on more than one<br>
.cpp; just list additonal ones.<br>
<div class="HOEnZb"><div class="h5"><br>
Dirk<br>
<br>
--<br>
<a href="http://dirk.eddelbuettel.com" rel="noreferrer" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a><br>
</div></div></blockquote></div><br></div>