building/distributing plugins separately (Re: make file help please)

2006-03-03 Thread Frederic Devernay
I am working on a plugin in a cygwin h120 sim and I am tired of 
waiting for make to find out that nothing else has changed apart from 
the plugin itself.


I think the clean way to develop a plugin would be to be able to build 
it from another directory than the rockbox build dir. Linux developpers 
may think about how kernel modules can be built from any directory, 
making it easier to distribute them separately.


Here's how I had to fiddle with rockbox's make variables to do so. As 
you see, there are many hacks in there, especially concerning the 
pluginlink.lds file. It would be nice if we could just define the SRC 
variable, the BUILDDIR (this makefile works with simulators too), and 
then include a standard Makefile...


BUILDDIR=/home/devernay/rockbox/iriver
include $(BUILDDIR)/Makefile

GCCOPTS += $(DELUXE) -O2

export OBJDIR=$(PWD)

SRC=asteroids.c
SUBDIRS=

all: $(SRC:.c=.rock)

clean:
$(RM) pluginlink.lds $(SRC:.c=.elf) $(SRC:.c=.map) \
  $(SRC:.c=.o) $(SRC:.c=.rock) *~ \#*\

install: all
@if [ -d $(BUILDDIR)/archos ]; then \
  echo Installing $(SRC:.c=.rock) in \
$(BUILDDIR)/archos/.rockbox/rocks \
  install -d $(BUILDDIR)/archos/.rockbox/rocks; \
  for f in $(SRC:.c=.rock); do \
install -m 755 $$f $(BUILDDIR)/archos/.rockbox/rocks/$$f; \
  done \
else \
  echo *** You must install $(SRC:.c=.rock) manually in the \
.rockbox/rocks directory on your player; \
fi

$(SRC:.c=.rock): vsm.c game.c rom.h
$(SILENT)ln -sf $(BUILDDIR)/apps/plugins/pluginlink.lds .
@$(MAKE) -C $(APPSDIR)/plugins VPATH=$(PWD) \
  SRC=$(SRC) SUBDIRS=$(SUBDIRS) BITMAPLIBS= V=1




Re: building/distributing plugins separately (Re: make file help please)

2006-03-03 Thread Daniel Stenberg

On Fri, 3 Mar 2006, Frederic Devernay wrote:

I think the clean way to develop a plugin would be to be able to build it 
from another directory than the rockbox build dir. Linux developpers may 
think about how kernel modules can be built from any directory, making it 
easier to distribute them separately.


I don't think anyone would mind fixes and changes that would make that easier!

--
 Daniel Stenberg -- http://www.rockbox.org/ -- http://daniel.haxx.se/