On 24 July 2015 at 10:18, Ulf Mertens wrote:
| Hi,
| 
| I just looked into the GNUMakefile. I think I just have to only change those
| two lines, right?
| 
| sources :=         $(wildcard *.cpp)
| programs :=       $(sources:.cpp=)

The idea here is that each .cpp leads to one executable, and its build is
triggered by a change in it.  (
 
| If I understand it correctly, it only works for .cpp files. So it has be
| changed to something like this?
| 
| sources :=        $(wildcard *.cpp)
| header :=          $(wildcard *.h)
| programs :=      $(sources:.cpp= header:.h=)

The header files are implicit.  You could just enumerate the files by hand.:
Or, as eg in examples/threads/GNUmakefile, just write the rule:


all:                    boostEx

boostEx:                boostEx.cpp
                        $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^ $(LDLIBS) 
                        strip $@

where strip of course optional too.  'boostEx' could depend on more than one
.cpp; just list additonal ones.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to