星期一, 5月 08, 2006

Working log : on merging 2 sample codes.

要把播放和tuner的sample code合在一起,這兩個原來是在不同的sample project。
final target和Makefile是在play 的project。

所以 - 先reference tuner的sample project,把需要的 .c 列入Makefile中,並且把.o 改成.c ,也列入Makefile。
make結果:找不到 那些.o 的source file
回去看一下tuner的.o file ... 真是豬頭,都沒給source,真是拜託,就是i2c tuner register 設定,要保密成這樣?。

直接把 .o 列入? 不知道可不可以,因為play 的Makefile是多target 共用,所以沒辦法為特定target列.o dependency。

只好把這些豬頭.o 檔archive起來:
arm-elf-ar rcs libpigh.a hardware/*.o tmselect/*.o nt2005usrmode/*.o
完成用ar的t option看看是不是所有.o 都有加進去。

play 的Makefile有很麻煩的加頭/加尾判定,所以沒辦法把這個豬頭library 直接加到lib variable中。

所以?
手動把這個libpigh.a copy到play project的lib folder中,這樣。
在Makefile的link option中加入 libpigh.a 就可以(這個多事的Make scripe會自動把lib和a去掉)。

make ..結果
link時error :undefined reference to `pthread_mutex_trylock`
collect2: ld return 1 exit status
這個大概是pthread的問題,在Makefile的LDFLAG加入 -lptherad .OK。


開始修改source code:include file,將需要的(ref tuner main.c file) copy 到play sample folder中。

沒有留言:

網誌存檔