Hello,
It's difficult to follow, let me try to explain why...
----- Mail original -----
De: "Hans-Christoph Steiner" hans@at.or.at À: "IOhannes m zmoelnig" zmoelnig@iem.at Cc: "pd-dev" pd-dev@iem.at Envoyé: Lundi 17 Octobre 2011 18:33:45 Objet: Re: [PD-dev] makefile template
On Oct 17, 2011, at 12:08 PM, IOhannes m zmoelnig wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2011-10-17 17:11, Patrice Colet wrote:
Hello IOhannes,
all I could say is this:
$ make -p -n | grep CXX make: *** No targets specified and no makefile found. Stop. LINK.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c CXX = g++
what do you mean by that? why does it mean that you have to manually add a "CXX=g++" line to your Makefile?
no it just mean that g++ is the default compiler assigned to CXX variable in my environment, implicitly set by make as you mentioned below, maybe I misunderstood your question in precedent mail.
here (on linux), i get approximately the same. note that there is a line "CXX = g++" is the following output, though this is set implicitely by make and not explicitely in the makefile.
MinGW does not include a 'cc.exe' only a 'gcc.exe'. CC defaults to 'cc', so for what we are doing, it makes sense to do CC=gcc. It looks like MinGW's default CXX is g++ and MinGW includes a 'g++.exe' so there is no need to set CXX in the Makefile.
Yes indeed, I've commented out CC=gcc for having compilation running fine.
There another thing very unlikely in template/Makefile, if do a 'make clean', it removes all the sources as well as objects and binaries so for not loosing sources I have to remove these lines:
-rm -f -- $(SOURCES:.cpp=.o) $(SOURCES_LIB:.cpp=.o) $ (SHARED_SOURCE:.cpp=.o) -rm -f -- $(SOURCES:.cpp=.$(EXTENSION))
then you did something weird :-) i had the same problem after changing CC to CXX and replacing myobject.c with myobject.cpp
the template/Makefile is full of assumptions that the sources end with ".c"; to compile .cpp files, you will have to replace all the pattern substitutions throughout the makefile from %.c to %.cpp mainly you will find this in constructs like "$(SOURCES:.c=.o)" which need to be changed to "$(SOURCES:.cpp=.o)"
that's what I did, after changing all .c to .cpp and CC to CXX it compiles.
Yes, that's what's causing everything to get deleted. Basically ".c=.o" means replace a ".c" ending with ".o". If there isn't a ".c" ending, it just passes the values thru unchanged. Since the myobject.cpp doesn't end in ".c", it passes thru unchanged, and therefore 'make clean' is deleting myobject.cpp rather than myobject.o.
that's right, if I replace .c with .cpp in clean method, make doesn't remove .cpp files anymore, but it still removes the .tcl files
so I come with another question :D
how .tcl files could remain after clean method?
Also I still have same question about pd includes, but more accurately...
gui externals needs m_imp.h, because of this:
sys_vgui("eval [read [open {%s/%s.tcl}]]\n", proll_class->c_externdir->s_name, proll_class->c_name->s_name); sys_vgui("::patco::proll::setup %s\n", proll_receive_symbol->s_name);
c_externdir->s_name and c_name->s_name are declared in m_imp.h but it's not in pd/include, there only is m_pd.h.
So do I have to add this file to my project or, do I have to modify the Makefile to look for it? For the moment I keep a copy of m_imp.h in my project it's easier to handle ^^.
I will send a message to pd-list when the external will be ready for a test on other platforms, this one might be worth to be included into pdx distribution.