c't

c't-Projekte - Mailinglisten


[Voriger (Datum)] [Nächster (Datum)] [Voriger (Thread)] [Nächster (Thread)]
[Nach Datum][Nach Thread]

Re: [ct-bot] make-Target für Bibliothek

Absender: Timo Sandmann
Datum: Di, 17.05.2011 22:18:10
In-reply-to: <1305652707.2322.17.camel@wbam-laptop>
References: <1305221409.10999.72.camel@wbam-laptop> <1305652707.2322.17.camel@wbam-laptop>


Hi Simon,

das neue Makefile scheint einen Bug zu haben, es funktioniert für PC-Code, der Buildprozess für MCU scheitert aber:

ar: creating archive libctbot.a
ranlib libctbot.a
ranlib: warning for library: libctbot.a the table of contents is empty (no object file members in the library define global symbols)

Linking: ct-Bot.elf
avr-gcc --output ct-Bot.elf -mmcu=atmega32 -Wl,--section-start=.bootloader=0x7C00    -L /usr/local/avr ct-Bot.o bot-logic/behaviour_avoid_border.o bot-logic/behaviour_avoid_col.o bot-logic/behaviour_calibrate_pid.o bot-logic/behaviour_calibrate_sharps.o bot-logic/behaviour_cancel_behaviour.o bot-logic/behaviour_catch_pillar.o bot-logic/behaviour_classify_objects.o bot-logic/behaviour_delay.o bot-logic/behaviour_drive_area.o bot-logic/behaviour_drive_chess.o bot-logic/behaviour_drive_distance.o bot-logic/behaviour_drive_square.o bot-logic/behaviour_drive_stack.o bot-logic/behaviour_follow_line_enhanced.o bot-logic/behaviour_follow_line.o bot-logic/behaviour_follow_object.o bot-logic/behaviour_follow_wall.o bot-logic/behaviour_get_utilization.o bot-logic/behaviour_goto_obstacle.o bot-logic/behaviour_goto_pos.o bot-logic/behaviour_goto.o bot-logic/behaviour_gotoxy.o bot-logic/behaviour_hang_on.o bot-logic/behaviour_line_shortest_way.o bot-logic/behaviour_measure_distance.o bot-logic/behaviour_olympic.o bot-logic/behaviour_pathplaning.o bot-logic/behaviour_remotecall.o bot-logic/behaviour_scan.o bot-logic/behaviour_scan_beacons.o bot-logic/behaviour_servo.o bot-logic/behaviour_simple.o bot-logic/behaviour_solve_maze.o bot-logic/behaviour_transport_pillar.o bot-logic/behaviour_turn.o bot-logic/behaviour_ubasic.o bot-logic/bot-logic.o bot-logic/tokenizer.o bot-logic/ubasic_call.o bot-logic/ubasic_cvars.o bot-logic/ubasic_ext_proc.o bot-logic/ubasic.o libctbot.a -lm
libctbot.a: could not read symbols: Archive has no index; run ranlib to add one
make: *** [ct-Bot.elf] Error 1


Ich glaube, du verwendest ar und ranlib für die falsche Architektur, nämlich vom Build und nicht für das Target (AVR).
Außerdem sollte das Makefile bei make clean auch die Library löschen.


Der main()-Patch ist jetzt im SVN. Ich werde daran aber wahrscheinlich noch eine Kleinigkeit ändern, weil ich finde pre_behaviour() und post_behaviour() sind in init.c (vom Namen her) nicht ideal aufgehoben. Wenn mir ein passender Name eingefallen ist, werde ich die Funktionen entsprechend verschieben. 

Grüße,
Timo


Am 17.05.2011 um 19:18 schrieb Simon Siemens:
> Hi Timo,
> 
> anbei der verbesserte Patch. Damit wird ct-Bot.elf nun mit Hilfe von
> libctbot.a gebaut, wenn man make verwendet. Der neue Patch behebt auch
> zwei kleine Fehler im alten Patch.
> 
> Herzliche Grüße,
> 
> Simon