FS#9648 - makefile for new multifile plugins requires hackish extra code for unknown reason

Attached to Project: Rockbox
Opened by Joshua Simmons (mud) - Monday, 15 December 2008, 10:16 GMT
Last edited by Björn Stenberg (zagor) - Thursday, 20 August 2009, 22:32 GMT
Task Type Bugs
Category Build environment
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


I'm not even sure that this is a bug, it may be something I'm doing wrong or a misunderstanding on my part. But regardless, here it is:

This was tested from subversion revision r19442.

When making a new multi-file plugin, I can't just copy the structure of the sudoku.make file from the sudoku plugin. These extra lines are needed at the end of the .make for some unknown reason:
$(call PRINTS,LD $(@F))
$(SILENT)$(CC) $(PLUGINFLAGS) -o $*.elf \
$(filter %.o, $^) \
$(filter %.a, $^) \
ifdef SIMVER
$(SILENT)cp $*.elf $@
$(SILENT)$(OC) -O binary $*.elf $@

If this blob is not present, then the plugin does not get linked or built into a .rock. (there is no error message, it just builds the object files for the plugin and fails to do anything else with them. No .rock file is made for the plugin.).

Attached is a patch containing an extremely simple plugin, named goban, that exhibits this behavior (it is basically a copy of the helloworld plugin made into a multi-file style plugin for demonstration). It appears to me that it should be doing everything necessary to be built as a plugin, but it doesn't work. Notice that the goban.make has exactly the same structure as sudoku's sudoku.make file, and yet sudoku correctly becomes a .rock plugin while this test plugin does not.

By the way, the extra blob above was found in reversi's makefile.

Steps to reproduce:
1) Apply the attached patch
2) Build rockbox (I tested with e200 normal and simulator)
3) make zip and extract it
4) Notice that there exists no goban.rock file in .rockbox/rocks/games/
5) View apps/plugins/sudoku/sudoku.make and compare it with apps/plugins/goban/goban.make. Notice that the structure is identical and yet one works correctly while the other fails silently. This makes it very treacherous to start new multi-file plugins by copying the structure of existing plugins.
This task depends upon

Closed by  Björn Stenberg (zagor)
Thursday, 20 August 2009, 22:32 GMT
Reason for closing:  Wont Fix
Additional comments about closing:  Not being allowed to call plugin sources "main.c" is a bit annoying, but something we can live with.
Comment by Thomas Schott (scotty) - Monday, 15 December 2008, 11:55 GMT
Just rename main.c to goban.c (in SOURCES too).
Comment by Joshua Simmons (mud) - Tuesday, 16 December 2008, 04:18 GMT
Wow, that's annoying. I guess that works though, thanks.