Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] make target question

Brian Moyle wrote:

Can someone explain the purpose behind the "Make Target"'s view? Is it essentially to tell the builder where to start the build process? (i.e., where to pick up the default Makefile when executing "make"?).

When I first tried the CDT, I expected the "make target" to be used as a make target (you can probably see why I might be confused).

Yes indeed this is what happens, or at least it is what happens for me.

Right-clicking on a make target named "hello" and then selecing "Build", I fully expected to see something like "make -k hello", but instead I see "make -k clean all" in the C-Build View. The former would actually be a way of using the built-in make rules to build a target when no makefile exists.

For instance, I could create a new "hello" project, create a simple hello.c source file, use the default "hello" make target provided by the CDT, and then select "Build". No makefile generation necessary, since building "hello" from "hello.c" is already part of the default make rules.

I also noticed I can't seem to tell the CDT not to include the word "all" in my custom build commands. In other words, modifying the properties for the "hello" project, and setting the build command to "make -k hello" results in a "make -k hello all" reflected in the C-Build view. Make complains about the "all" target, since I have no makefile.

Am I just wasting my time here, or is it worth trying to use make's build-in target rules for simple projects?

In my current configuration I defined a non-existant target tomato and then when I selected it in the Make Targets view and
right clicked and said build I got:

make CPULIST=x86/ppc CPULIST=x86 tomato
make -j 1 -Cx86 -fMakefile tomato
make[1]: Entering directory `C:/QNXsdk/workspace/workspace/mqueue/x86'
make -j 1 -Co -fMakefile tomato && make -j 1 -Co-g -fMakefile tomato
c:\QNXsdk\host\win32\x86\usr\bin\make.exe[2]: *** No rule to make target `tomato'. Stop.
make[1]: *** [tomato] Error 2

[There are some other pieces in there the QNX builder contributes, but not important]

Then if I moved to the top of my project and said build I got:

make CPULIST=x86/ppc CPULIST=x86 clean all
make -j 1 -Cx86 -fMakefile clean
...

Seems to work for me. Is what you are seeing different?


Thanks,
Thomas




Back to the top