[CCC DEV] Supporting multiple platforms
Adam Sampson
ats at offog.org
Fri Jun 18 15:04:48 BST 2010
Matt Jadud <jadudm at gmail.com> writes:
> * The deb-pkg build script works a bit better. It's a kludge, but it
> creates a package that leaves sensible things in
> /usr/local/occam/arduino.
Any particular reason for the wacky prefix? Packages must not touch
/usr/local -- it should install stuff into /usr as per normal. If it
can't use /usr for some reason, then it should use /opt/occam to be
FHS-compliant.
Otherwise it looks like it's doing the right things, although the
standard Debian package infrastructure (debhelper et al.) will do nearly
everything you're doing by hand there anyway, so most of that can be
migrated into a regular debian/rules file eventually.
> Or, perhaps, occbuild should just get smarter about the Arduino?
Yes -- the plan is to add an --upload command that knows how to upload
to Arduino and Lego devices, then "plumb foo.occ" can go away in favour
of "avr-occbuild --program foo.occ; avr-occbuild --upload foo". The
search path stuff you're doing in there won't be necessary once the AVR
modules are built and installed in the standard way.
How we handle variations between different boards that have the same
architecture (i.e. avr) is an interesting question -- the config files
idea seems like a reasonable one.
> * The *.conf file lets me add a --search path for the
> platform-specific code. This way, things like "plumbing.module" can
> end up in occam/arduino/lib, while "iom328p.inc" can end up in
> occam/arduino/lib/platforms/arduino.
I'd rather not do that by search path twiddling -- that's awfully
fragile. If you want to split things into subdirectories, then it's
usually better to have a top-level header that explicitly includes the
things it needs from the subdirectories (i.e. #INCLUDE
"platform/arduino/foo.inc").
iom328p.inc isn't really platform-specific -- it's just an automatic
conversion of the AVR header, and if we had two different boards that
used the ATmega328P they'd both need it, so it should be in a common
directory (along with the equivalents for the other AVRs you're
using). The platform-specific files will be things like the pin number
definitions, I guess.
--
Adam Sampson <ats at offog.org> <http://offog.org/>
More information about the developers
mailing list