![]() |
|
#1
|
|||
|
|||
Trying to build object files. problem with make fileHi. I have been trying to build the object files for a project but they are not been compiled correctly. I had the project compiling correctly with the standard linux gcc compiler but have changed to ST version of it and now am not getting the correct format of object files.
This compiler has been used to correctly compile our linux kernel so i dont think there is a problem there. this is an example of the make file Code:
but this is producing an object file that just has the expanded cpp file in it not machine code as i would expect. Thanks in advance for any help. I'm truly stuck at the moment. Make files make my eyes water! |
|||
|
#2
|
|||
|
|||
Re: Trying to build object files. problem with make fileQuote:
The -E flag tells the compiler to stop after the preprocessing stage and not to compile anything. 1. Where did the -E come from? 2. What happens if you leave it off? 3. Since CXX is used to indentify the compiler used for .cpp files. Shouldn't you really have something like Code:
Note that the kernel doesn't probably doesn't have any ,cpp files, so the improperly defined CXX is known as "no harm, no foul" as far as compiling the kernel is concerned. Regards, Dave |
|
#3
|
|||
|
|||
Re: Trying to build object files. problem with make fileDave thanks great explanation.. I had just found the problem myself but was unsure why -E was the issue or what it meant.
Thanks a lot mate. you have truly earned your outstanding member title today. starting to get my head around makefiles.. |
|
#4
|
||||
|
||||
Re: Trying to build object files. problem with make fileQuote:
Here's a useful tip: Execute each of the cross tools in your cross tools directory. In my case, since I'm building for a powerpc 440 target, I have something like: /opt/powerpc-linux-elf/bin/powerpc-linux-elf-gcc and -ar -as -ld -objcopy -objdump -strip ...etc. Usually one sets the CROSS_COMPILE environment variable to be the "prefix" before each of the tool names. So, in my case, it would be: export CROSS_COMPILE=powerpc-linux-elf- One would also add to ones path the "bin" directory where the tools are located. Once you can run the tools from any directory by typing the prefix (until tab autocompletes the line to the last hypen) double tab to get an entire list of the tools available. Execute each one in turn by invoking the --help as follows: powerpc-linux-elf-gcc --help > ppc-gcc-help.txt ...and keep going until you've got all of the help from each of the tools in their own files named appropriately so that you can tell which is which. The help contents are typically the most commonly used invocations of the tool and can be invaluable resources. Print these out or save them in a PDF or some common reference. I like to nail them to my forehead for quick reference, because I usually bring my head with me whilst traveling, but not always. You will also probably want to take a look at the man pages or info pages for GCC to find out which target switches can be used for your particular ARM variant. Look for mtune= MxB |
Recent GIDBlog
Review: Gel laptop cooling pad by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MAKE file assistance | emp | C++ Forum | 13 | 28-Feb-2008 12:40 |
| File function | jamesbond000 | C Programming Language | 3 | 28-Mar-2007 23:32 |
| Please Help Me To Build My Calendar!!! | suriacute85 | Java Forum | 0 | 05-Oct-2006 20:39 |
| Mozilla Thunderbird | dsmith | Computer Software Forum - Linux | 9 | 01-Mar-2005 12:56 |
| Yet another CD burner problem: Lite-On LSC-24082K | Erwin | Computer Hardware Forum | 1 | 22-May-2004 12:28 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The