User forums > Embedded development

Using an SDK - Dependency on multiple object files

(1/3) > >>

Vikingo:
Context: using SDCC to produce an .hex file for an nRF24LE1 (8051 compatible chip)

I'm using an SDK which has multiple source files for different functions (One source file for each function) and only one header file for a group of related functions (say: gpio.h includes several function declarations but then you have one source file for each function which gets compiled into it's own .rel file)

I'm able to manually specify the dependency but I'm looking for something a little bit more flexible.

Is there a simple way to specify the dependencies in C::B for my main code such that I only get the really used functions linked? and not the unused ones?

I searched the forums but couldn't find the answer.

Thanks
Alex

stahta01:
The answer depends on the Compiler and NOT on Code::Blocks.

Does SDCC support static libs for the MCU/CPU target?
If yes, I suggest trying that.

Tim S.

Vikingo:
ok, thanks for the refresh.

On a separate project, I was able to build the library by including all source files and compiling but not linking and then manually building the lib. Great!

I want to build/refresh the lib automatically. I thought that adding a post build step would be fine but I can't get all the compiled filenames ($linkobjects is not working)

The lib utility for SDCC can handle either all .rel files as parameters, or a text file with one line for each .rel file

So the questions are:

1 - How do I grab all object files (.rel) into a variable I can pass to my post build step?
2 - How can I build that list with a simple script into a .txt file?

Thanks
Alex

stahta01:
I suggest using CB build system; instead of fighting it.
Or, I suggest using a custom makefile.

If using the CB Build system try the following.
Lookup how to do targets inside a CB Project.
Have a target build the static library.
Have a second target use the static library.

Note: I have NOT done the above using SDCC; but, it should be possible.

Tim S.

stahta01:
If the SDK is open source or free download, post a link to it?

Edit: Posting the full CB "build log" will help me help you. http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Tim S.

Navigation

[0] Message Index

[#] Next page

Go to full version