Static library makefile
Posted: Mon Feb 21, 2011 1:25 pm
Hi
I have pulled out some common function that I invariably use in my DS apps and I want to make a static library of these which I will call and link to in future apps. I have a couple of questions about the Makefiles I want to setup:
1. The makefile I and currently using to build this static library tries to build a full DS app. This, of course, fails at link time due to a missing main() etc. How do I change the makefile to compile and then archive the objects (rather than compile and link them)?
2. I always want to build 2 versions of my library that depend upon a pre-processor value (I use a #ifdef in the source). How to I: a) setup the makefile to produce 2 builds of the library, and b) define the pre-processor value that will be seen by the #ifdef in the code at compile time?
My current Makefile looks like this:
ARM7_SELECTED = ARM7_MP3_DSWIFI
BUILD := build
SOURCES := source gfx/bin
INCLUDES := source build gfx
MAKEFILE_VER := ver2
include C:\devkitPro\PAlib\lib\PA_Makefile
Thanks.
I have pulled out some common function that I invariably use in my DS apps and I want to make a static library of these which I will call and link to in future apps. I have a couple of questions about the Makefiles I want to setup:
1. The makefile I and currently using to build this static library tries to build a full DS app. This, of course, fails at link time due to a missing main() etc. How do I change the makefile to compile and then archive the objects (rather than compile and link them)?
2. I always want to build 2 versions of my library that depend upon a pre-processor value (I use a #ifdef in the source). How to I: a) setup the makefile to produce 2 builds of the library, and b) define the pre-processor value that will be seen by the #ifdef in the code at compile time?
My current Makefile looks like this:
ARM7_SELECTED = ARM7_MP3_DSWIFI
BUILD := build
SOURCES := source gfx/bin
INCLUDES := source build gfx
MAKEFILE_VER := ver2
include C:\devkitPro\PAlib\lib\PA_Makefile
Thanks.