#1979 - pollier - Mon Jan 27, 2003 12:43 am
Hello,
I use GCC for my C code compilation and everything is done from a complicated batch file I wrote which compiles every C and assembly file in a folder and links them in another folder, etc. It works nicely.
So, all of my .o files are saved for next time. However, my batch program always compiles every source file every time. Compile times are slowing. Other than using a fully-featured IDE, are there any (preferably command-line driven) source compiling manager apps out there, so that only files that have changed since last time are recompiled?
_________________
(Works for me!)
#1980 - Sweex - Mon Jan 27, 2003 12:54 am
So called "make" files. I use an nmake, which comes with Visual C++. DevKitAdvance (which you are probably using) comes with it's own make.exe . There must be information for writing make scripts with that program.
It might be hard at first, but it's definately the way to build your project and keep build-times low.
I'm sure a LOT of people here are using makefiles...
#2000 - t0ne - Mon Jan 27, 2003 3:44 pm
Yup, makefiles are the way to go.
Using a makefile you can manage your dependencies and it will only build what is necessary (read: modified).
#2045 - pollier - Tue Jan 28, 2003 5:47 am
Thanks for the advice, when I was doing win32 that was all taken care of for me. Now, I'm getting an error from my ld prog:
cannot open -lc: No such file or directory.
...any advice?
_________________
(Works for me!)
#2076 - t0ne - Tue Jan 28, 2003 10:08 pm
It can't find a library named libc.a.
You can use the -L option with ld to specify the paths it should search to find the libraries to link with. Alternatively use gcc instead and it should work out its paths based on your options like -mthumb-interwork.
#2080 - pollier - Wed Jan 29, 2003 1:30 am
Yeah, libc.a was in my bin folder.
Now another problem:
I get a huge number of undefined references in function
`If_Undefined_Reference__rename_main_or_AgbMain_to_each_other_in_your_C_file'
although the renaming isn't the problem.
Things like `__sp_irq' and `__sp_usr' are undefined references.
my linker line generated by gcc is as follows:
ld -X -o game.elf c:\Tools\GBA\GCC\bin/../lib/gcc-lib/thumb-elf/2.9-arm-000512/../../../crtbegin.o crt0.o -LC:/Tools/GBA/GCC/lib -Lc:\Tools\GBA\GCC\bin/../lib/gcc-lib/thumb-elf/2.9-arm-000512/../../.. output/main.o output/interrupt.o output/nmod.o output/crt0.o output/font.o output/sprite.o output/misc.o -nostartfiles -lgcc -lc -lgcc c:\Tools\GBA\GCC\bin/../lib/gcc-lib/thumb-elf/2.9-arm-000512/../../../crtend.o
As you can see, I'm using crtbegin.o and crtend.o even though I'm trying to stop this, but my -nostartfiles is going in the wrong place; that's not the problem, however--unless crtbegin.o and crtend.o somehow are causing undefined references? I'd like to cut out the crtbegin and crtend anyways; what arguments am I going to have to pass to what to get them off the list? And I wonder if that second '-lgcc' will do any damage...
Thanks for your help; this is getting overly complicated, isn't it?
_________________
(Works for me!)
#2099 - t0ne - Wed Jan 29, 2003 11:01 am
How are you calling gcc (what switches are you using).
Who's crt0.o and linkerscript are you using ... ummmm ... are you using devkitadvance or something else ?
In it's simplest form you can link with gcc with something like this (using devkitadv)
Code: |
gcc -mthumb-interwork -o myproject.elf mycode.o mycode2.o |
or slightly more real-world makefile something like this:
Code: |
$(CC) -mthumb-interwork -o $(PROJECT).elf $(OBJS)
|
#2118 - pollier - Wed Jan 29, 2003 8:46 pm
[oops] My linkerscript include argument was missing. Stupid me. I think I've got it figured out now; thanks, everyone!
_________________
(Works for me!)