#12774 - dagamer34 - Wed Nov 26, 2003 2:24 am
Right now i am looking at the makefile generated from the GBA AppWizard and am wondering how, if possible, to execute the SDL commandline version of vba when done building?
The emulator is in the devkit directory, so i added this line to the end of the makefile.
$(DEVDIR)\vba :$(PROJECT).gba
Is this correct?
_________________
Little kids and Playstation 2's don't mix. :(
#12775 - tepples - Wed Nov 26, 2003 3:46 am
This is what I do:
In your makefile, make a target called 'run', put it first so that it's the default target, and have it depend on your finished binary. Then make 'run' a .PHONY target so that it gets re-"built" every time you run 'make'.
like this:
Code: |
# 8< cut >8
EMU = e:\gbadev\vboy\visualboyadvance.exe
ROM = tod.gba
.PHONY: run
run: $(ROM)
$(EMU) $(ROM)
# 8< cut >8 |
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#12786 - dagamer34 - Wed Nov 26, 2003 3:49 pm
I got it to work correctly!!
Now i have one other problem. What is the order of execution for the targets??? I want to use a commandline exe to fix my rom's header BEFORE it runs in vba. Right now it fixes it after I close vba. Here is the code I put in.
Code: |
EMU = C:\Consoles\GBA\DevKits\visualboyadvance.exe
ROM = $(PROJECT).gba
ROMFIX = C:\Consoles\GBA\DevKits\GBARM.exe
.PHONY: run
.PHONY: run2
run2: $(ROM)
$(ROMFIX) -v $(ROM)
-@echo -------------------------------------------
-@echo Fixing rom now
-@echo -------------------------------------------
run: $(ROM)
$(EMU) $(ROM)
-@echo -------------------------------------------
-@echo Playing in vba now
-@echo -------------------------------------------
|
This code is placed right after my defined list of .O files. I have moved it everywhere and the vba STILL executes before GBARM (the header fixing tool i am using).
_________________
Little kids and Playstation 2's don't mix. :(
#12788 - poslundc - Wed Nov 26, 2003 4:20 pm
I'm no makefile expert, but I believe the following will work:
Code: |
run: $(ROM)
$(ROMFIX) -v $(ROM)
$(EMU) $(ROM)
|
I applaud your attempts to make your makefile scalable, but do you really need to use a variable for your rom-fix program?
Dan.
#12789 - dagamer34 - Wed Nov 26, 2003 4:21 pm
Never mind. I fixed it. It depended on the order of the defined paths.
One last problem and i won't bother you all anymore.
I am trying to compile tutorial number 4a from Pern Projects and i keep getting an undefined reference to 'sin' and 'cos'. Now it compiles correctly when NOT using MSVC++ but doesn't when i do use it.
I do include math.h and have even changed my include and lib directories but no difference. Could someone help me?
_________________
Little kids and Playstation 2's don't mix. :(
#12793 - tepples - Wed Nov 26, 2003 5:58 pm
dagamer34 wrote: |
I got it to work correctly!!
Now i have one other problem. What is the order of execution for the targets??? |
For the record, the first target is run by default, and any target's dependencies are run in essentially random but topologically-sorted order.
Quote: |
I want to use a commandline exe to fix my rom's header BEFORE it runs in vba. |
My makefiles run gbafix right after objcopy, as part of the 'test.gba' target.
Quote: |
i keep getting an undefined reference to 'sin' and 'cos'. Now it compiles correctly when NOT using MSVC++ but doesn't when i do use it. |
Perhaps your normal makefile is including -lm, but the MSVC project file isn't. You shouldn't be using sin() and cos() in GBA code anyway because they bring in the large and slow floating-point library. Instead, you should be generating a fixed-point cosine lookup table on the PC side and compiling it into your GBA program.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#12809 - dagamer34 - Wed Nov 26, 2003 10:38 pm
I know i shouldn't be using those functions HOWEVER this is for testing purposes only. I already have a table for real-time use.
And where would i put the "-lm" flag?
_________________
Little kids and Playstation 2's don't mix. :(
#12810 - tepples - Thu Nov 27, 2003 12:08 am
Normally, the -lm flag goes after all other object files and libraries (except before -lgcc -lc -lgcc if you're calling ld directly).
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.