#69 Option needed to define object name

open
nobody
None
7
2012-07-13
2009-10-15
Andrej Sinicyn
No

It is very important to be able to define custom object name. With the current behavior it's impossible to compile any project, where there are at least two cpp files with identical names. Just overriding build command is insufficient.

This happens for example with ScummVM:

There are
base/main.cpp
and
backends/platform/sdl/main.cpp

Which results in following build lines (after I override the build command for the second file):

scummvm/main.o: $(GLOBALDEPS) ../../base/main.cpp
$(CPP) -c ../../base/main.cpp -o scummvm/main.o $(CXXFLAGS)

scummvm/main.o: $(GLOBALDEPS) ../../backends/platform/sdl/main.cpp
$(CPP) -c ../../backends/platform/sdl/main.cpp -o scummvm/main1.o $(CXXFLAGS)

So basically main1.o is build, main.o not, because the second line overrides it. But yet only main.o is included into the build and link chain and of course isn't found!

Discussion

  • Tony Reina
    Tony Reina
    2010-01-29

    How should the makefile look to correct the problem? Should we include the full path in the target:

    scummvm/base/main.o: ...

    scummvm/backends/platform/sdl/main.o: ...

    ?

     


Anonymous


Cancel   Add attachments