Linker Command File Conditional On Including Files

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Linker Command File Conditional On Including Files

2,566件の閲覧回数
Ioline
Contributor I

It is easy to have a linker file include a .bin file, however, is there anyway to have an INCLUDE statement subject to a switch outside the LCF?  To put it another way, can a switch be created in C to tell the lcf to include or not include a file?

ラベル(1)
0 件の賞賛
返信
3 返答(返信)

1,256件の閲覧回数
SimonMarsden_de
Contributor II
Sorry, I don't know the answer to your question, but I have a suggestion which might help.

The CodeWarrior assembler also has an incbin statement, so you could add a small assembler file to your project along the lines of:

        .data
        .globl  _myData
_myData:
 #ifdef foo
       .incbin 'file1.bin'
#else
       .incbin 'file2.bin'
#endif


From C, the data would be refered to by the symbol 'myData' without the leading underscore.


Hope this helps


Simon
0 件の賞賛
返信

1,256件の閲覧回数
Ioline
Contributor I

Simon, thanks for your response.  I tried your suggestion and for some reason it says that the binary file does not exist or cannot be opened.  Any thoughts?

0 件の賞賛
返信

1,256件の閲覧回数
Ioline
Contributor I
Update:  Still not working...
0 件の賞賛
返信