From: <jac...@us...> - 2013-03-23 06:54:13
|
Revision: 3076 http://openlcb.svn.sourceforge.net/openlcb/?rev=3076&view=rev Author: jacobsen Date: 2013-03-23 06:54:05 +0000 (Sat, 23 Mar 2013) Log Message: ----------- gmake works from command line at top or library level Modified Paths: -------------- trunk/prototypes/C/OlcbStarLibraries/Makefile trunk/prototypes/C/OlcbStarLibraries/standard.mk Added Paths: ----------- trunk/prototypes/C/Makefile trunk/prototypes/C/OlcbStarLibraries/Arduino.html trunk/prototypes/C/arduino.mk trunk/prototypes/C/standard.mk Removed Paths: ------------- trunk/prototypes/C/Arduino.html Deleted: trunk/prototypes/C/Arduino.html =================================================================== --- trunk/prototypes/C/Arduino.html 2013-03-23 06:52:16 UTC (rev 3075) +++ trunk/prototypes/C/Arduino.html 2013-03-23 06:54:05 UTC (rev 3076) @@ -1,219 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> -<HTML> -<HEAD> - <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> - <TITLE>OpenLCB Arduino Support</TITLE> - <META NAME="GENERATOR" CONTENT="OpenOffice.org 3.3 (Unix)"> - <META NAME="AUTHOR" CONTENT="Bob Jacobsen"> - <META NAME="CREATED" CONTENT="20090816;10132800"> - <META NAME="CHANGEDBY" CONTENT="Bob Jacobsen"> - <META NAME="CHANGED" CONTENT="20120214;7085000"> - <META NAME="CHANGEDBY" CONTENT="Bob Jacobsen"> - <META NAME="CHANGEDBY" CONTENT="David Harris"> - <META NAME="CHANGEDBY" CONTENT="Bob Jacobsen"> - <STYLE TYPE="text/css"> - <!-- - H2.cjk { font-family: "SimSun" } - H2.ctl { font-family: "Arial Unicode MS" } - H3.cjk { font-family: "SimSun" } - H3.ctl { font-family: "Arial Unicode MS" } - --> - </STYLE> -</HEAD> -<BODY LANG="en-US" BGCOLOR="#e6e6ff" DIR="LTR"> -<H1><FONT COLOR="#000000"><IMG SRC="../../web/logo-ajs-dph.png" NAME="OpenLCB" ALIGN=RIGHT WIDTH=337 HEIGHT=135 BORDER=2></FONT>OpenLCB -Arduino Support</H1> -<P>This page describes the OpenLCB Arduino software. See also the -<A HREF="../Hobbyists.html">Hobbyists</A> page.</P> -<P>The OpenLCB software requires Arduino version 1.0 or later.</P> -<H2 CLASS="western">Hardware</H2> -<P>There are several versions of CAN hardware available or under -development for the Arduino. All of these use the Microchip -MCP2515/MCP2551 chip set, so are compatible with the standard CAN -library. -</P> -<UL> - <LI><P STYLE="margin-bottom: 0cm"><A HREF="../C">LEDuino</A> - an - Arduino form-factor board that contains built-in CAN, DCC and - LocoNet interfaces. (Requires setting the CS setting in the CAN - library to B,2) - </P> - <LI><P STYLE="margin-bottom: 0cm"><A HREF="http://www.spcoast.com/wiki/index.php/Railroad_Shield">RailroadShield</A> - - an Arduino shield that carries CAN, DCC, RS-485 (NCE, XPressNet, - C/MRI) and LocoNet interfaces. (Requires setting the CS setting in - the CAN library to B,1) - </P> - <LI><P><A HREF="http://www.sparkfun.com/products/10039">SparkFun CAN - shield</A> - separate shield with a CAN interface, uSD card holder, - serial LCD connector and connector for an EM406 GPS module. - (Requires setting the CS setting in the CAN library to B,1) - </P> -</UL> -<H2 CLASS="western">Arduino Sketches</H2> -<P>Version 18 or later of the <A HREF="http://Arduino.cc/">Arduino -IDE</A> allows you to set the location of the “sketch book” in -the preferences. Perhaps the easiest way to compile and run the -example OpenLCB sketches: Open Arduino, go to the preferences, and -set the sketchbook directory to this one. Save the preferences, quit -Arduino, and start it again. You can then go to the File menu, select -Sketchbook → libraries → OlcbArduinoCAN → some sketch you'd -like to build and run.</P> -<DL> - <DD> - <TABLE WIDTH=860 BORDER=1 CELLPADDING=4 CELLSPACING=4> - <COL WIDTH=267> - <COL WIDTH=563> - <TR VALIGN=TOP> - <TD WIDTH=267 BGCOLOR="#9999cc"> - <H3 CLASS="western" STYLE="margin-top: 0cm">OlcbBasicNode</H3> - </TD> - <TD WIDTH=563 BGCOLOR="#9999cc"> - <P>Two consumer, two producer sample node with configuration and - blue/gold programming support. - </P> - </TD> - </TR> - <TR VALIGN=TOP> - <TD WIDTH=267 BGCOLOR="#9999cc"> - <H3 CLASS="western" STYLE="margin-top: 0cm">OlcbEightConsumer</H3> - </TD> - <TD WIDTH=563 BGCOLOR="#9999cc"> - <P>Eight consumer sample node with configuration and blue/gold - programming support. - </P> - </TD> - </TR> - <TR VALIGN=TOP> - <TD WIDTH=267 BGCOLOR="#9999cc"> - <H3 CLASS="western" STYLE="margin-top: 0cm">RailroadShieldNode</H3> - </TD> - <TD WIDTH=563 BGCOLOR="#9999cc"> - <P>One consumer, one producer sample node with configuration and - blue/gold programming support. Uses the first of the built-in - green buttons for input and output. - </P> - <P>Note 1: You need to set the CS selection to B,1 in the - CAN/utility/config.h file of the CAN library. - </P> - <P>Note 2: The 2nd built-in button is on Arduino pin 10, which is - the CS bit on other CAN interfaces. If this sketch is updated to - use that bit, it ceases to function after a little while, so - there's probably another reference to the CS bit in the CAN - library that we haven't found yet. - </P> - </TD> - </TR> - <TR VALIGN=TOP> - <TD WIDTH=267 BGCOLOR="#9999cc"> - <H3 CLASS="western" STYLE="margin-top: 0cm">OlcbEightConsumer</H3> - </TD> - <TD WIDTH=563 BGCOLOR="#9999cc"> - <P>Eight consumer sample node with configuration and blue/gold - programming support. - </P> - </TD> - </TR> - <TR VALIGN=TOP> - <TD WIDTH=267 BGCOLOR="#9999cc"> - <H3 CLASS="western" STYLE="margin-top: 0cm">OlcbServoNode</H3> - </TD> - <TD WIDTH=563 BGCOLOR="#9999cc"> - <P>Three consumer sample node to drive a servo to one of three - positions. - </P> - </TD> - </TR> - <TR VALIGN=TOP> - <TD WIDTH=267 BGCOLOR="#9999cc"> - <H3 CLASS="western" STYLE="margin-top: 0cm">OlcbDisplay</H3> - </TD> - <TD WIDTH=563 BGCOLOR="#9999cc"> - <P>Display OpenLCB messages on a LCD display. - </P> - </TD> - </TR> - <TR VALIGN=TOP> - <TD WIDTH=267 BGCOLOR="#9999cc"> - <H3 CLASS="western" STYLE="margin-top: 0cm">CAN2EtherNetClient, - CAN2EtherNetServer</H3> - </TD> - <TD WIDTH=563 BGCOLOR="#9999cc"> - <P>Provide an ASCII format Ethernet-CAN interface as either a - Telnet client or server. - </P> - </TD> - </TR> - <TR VALIGN=TOP> - <TD WIDTH=267 BGCOLOR="#9999cc"> - <H3 CLASS="western" STYLE="margin-top: 0cm">CAN2USBuino</H3> - </TD> - <TD WIDTH=563 BGCOLOR="#9999cc"> - <P>Provide an ASCII-format CAN-USB interface. Useful as an - adapter for e.g. a PC program. - </P> - </TD> - </TR> - <TR VALIGN=TOP> - <TD WIDTH=267 BGCOLOR="#9999cc"> - <H3 CLASS="western" STYLE="margin-top: 0cm">CAN2USBuinoFilters</H3> - </TD> - <TD WIDTH=563 BGCOLOR="#9999cc"> - <P>An ASCII-format CAN-USB interface with filtering; work in - progress. - </P> - </TD> - </TR> - <TR VALIGN=TOP> - <TD WIDTH=267 BGCOLOR="#9999cc"> - <H3 CLASS="western" STYLE="margin-top: 0cm">OlcbClockGenerator, - OlcbFastClockDisplayNode</H3> - </TD> - <TD WIDTH=563 BGCOLOR="#9999cc"> - <P>A fast clock time generator and display module for OpenLCB - (Work in progress) - </P> - </TD> - </TR> - <TR VALIGN=TOP> - <TD WIDTH=267 BGCOLOR="#9999cc"> - <H3 CLASS="western" STYLE="margin-top: 0cm">OlcbLocoNet</H3> - </TD> - <TD WIDTH=563 BGCOLOR="#9999cc"> - <P>(Work in progress) - </P> - </TD> - </TR> - <TR VALIGN=TOP> - <TD WIDTH=267 BGCOLOR="#9999cc"> - <H3 CLASS="western" STYLE="margin-top: 0cm">OlcbNmraDcc</H3> - </TD> - <TD WIDTH=563 BGCOLOR="#9999cc"> - <P>(Work in progress) - </P> - </TD> - </TR> - </TABLE> -</DL> -<H2 CLASS="western">Library</H2> -<P>The platform-independent library code lives in the -<A HREF="libraries/OlcbCommonCAN/index.html">libraries/OlcbCommonCAN -directory</A>.</P> -<H2 CLASS="western">Getting the Code</H2> -<P>The content of this development area, including code, documents -and web pages, is kept in the <A HREF="https://sourceforge.net/projects/openlcb/develop">OpenLCB</A> -<A HREF="https://sourceforge.net/">SourceForge.net</A> <A HREF="http://openlcb.svn.sourceforge.net/viewvc/openlcb/trunk">SVN -repository</A> in the “trunk/prototypes/C” directory. To check it -out, please do:</P> -<PRE STYLE="margin-left: 2cm; margin-bottom: 0.5cm"><B>svn co https://openlcb.svn.sourceforge.net/svnroot/openlcb/trunk/prototypes/C C</B></PRE><P STYLE="margin-bottom: 0cm"> -For more information on the SVN source code management tool, please -see the <A HREF="http://subversion.tigris.org/">SVN website</A> and -the <A HREF="http://svnbook.red-bean.com/">online SVN book</A>.</P> -<P STYLE="margin-bottom: 0cm"><BR> -</P> -<HR> -<P STYLE="margin-bottom: 0cm">This web sites contains trademarks and -copyrighted information. Please see the <A HREF="/Licensing.html">Licensing</A> -page.</P> -<P STYLE="margin-bottom: 0cm">This is SVN $Revision$ of <SDFIELD TYPE=DATETIME SDVAL="40041.4309143519" SDNUM="1033;1033;MM/DD/YY">08/16/09</SDFIELD>.</P> -</BODY> -</HTML> \ No newline at end of file Copied: trunk/prototypes/C/Makefile (from rev 3052, trunk/prototypes/C/Makefile) =================================================================== --- trunk/prototypes/C/Makefile (rev 0) +++ trunk/prototypes/C/Makefile 2013-03-23 06:54:05 UTC (rev 3076) @@ -0,0 +1,16 @@ + +# Top-level Makefile for OpenLCB C/C++ implementations + +# Arduino sketch directories but not the OlcbStarLibraries directory +SUBDIRS := $(filter-out OlcbStarLibraries, $(foreach V,$(wildcard */Makefile),$(V:/Makefile=))) + +%.all: + make -C $(@:.all=) all + +# make sure Arduino sketches build OK first +all: $(foreach v,$(SUBDIRS),$(v).all) + # make new OpenLCB C++ library (no tests exist) + cd libraries/OpenLCB; make lib + # make the OlcbStarLibraries directory, including tests + cd OlcbStarLibraries; make + Copied: trunk/prototypes/C/OlcbStarLibraries/Arduino.html (from rev 3052, trunk/prototypes/C/Arduino.html) =================================================================== --- trunk/prototypes/C/OlcbStarLibraries/Arduino.html (rev 0) +++ trunk/prototypes/C/OlcbStarLibraries/Arduino.html 2013-03-23 06:54:05 UTC (rev 3076) @@ -0,0 +1,219 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>OpenLCB Arduino Support</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 3.3 (Unix)"> + <META NAME="AUTHOR" CONTENT="Bob Jacobsen"> + <META NAME="CREATED" CONTENT="20090816;10132800"> + <META NAME="CHANGEDBY" CONTENT="Bob Jacobsen"> + <META NAME="CHANGED" CONTENT="20120214;7085000"> + <META NAME="CHANGEDBY" CONTENT="Bob Jacobsen"> + <META NAME="CHANGEDBY" CONTENT="David Harris"> + <META NAME="CHANGEDBY" CONTENT="Bob Jacobsen"> + <STYLE TYPE="text/css"> + <!-- + H2.cjk { font-family: "SimSun" } + H2.ctl { font-family: "Arial Unicode MS" } + H3.cjk { font-family: "SimSun" } + H3.ctl { font-family: "Arial Unicode MS" } + --> + </STYLE> +</HEAD> +<BODY LANG="en-US" BGCOLOR="#e6e6ff" DIR="LTR"> +<H1><FONT COLOR="#000000"><IMG SRC="../../web/logo-ajs-dph.png" NAME="OpenLCB" ALIGN=RIGHT WIDTH=337 HEIGHT=135 BORDER=2></FONT>OpenLCB +Arduino Support</H1> +<P>This page describes the OpenLCB Arduino software. See also the +<A HREF="../Hobbyists.html">Hobbyists</A> page.</P> +<P>The OpenLCB software requires Arduino version 1.0 or later.</P> +<H2 CLASS="western">Hardware</H2> +<P>There are several versions of CAN hardware available or under +development for the Arduino. All of these use the Microchip +MCP2515/MCP2551 chip set, so are compatible with the standard CAN +library. +</P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="../C">LEDuino</A> - an + Arduino form-factor board that contains built-in CAN, DCC and + LocoNet interfaces. (Requires setting the CS setting in the CAN + library to B,2) + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="http://www.spcoast.com/wiki/index.php/Railroad_Shield">RailroadShield</A> + - an Arduino shield that carries CAN, DCC, RS-485 (NCE, XPressNet, + C/MRI) and LocoNet interfaces. (Requires setting the CS setting in + the CAN library to B,1) + </P> + <LI><P><A HREF="http://www.sparkfun.com/products/10039">SparkFun CAN + shield</A> - separate shield with a CAN interface, uSD card holder, + serial LCD connector and connector for an EM406 GPS module. + (Requires setting the CS setting in the CAN library to B,1) + </P> +</UL> +<H2 CLASS="western">Arduino Sketches</H2> +<P>Version 18 or later of the <A HREF="http://Arduino.cc/">Arduino +IDE</A> allows you to set the location of the “sketch book” in +the preferences. Perhaps the easiest way to compile and run the +example OpenLCB sketches: Open Arduino, go to the preferences, and +set the sketchbook directory to this one. Save the preferences, quit +Arduino, and start it again. You can then go to the File menu, select +Sketchbook → libraries → OlcbArduinoCAN → some sketch you'd +like to build and run.</P> +<DL> + <DD> + <TABLE WIDTH=860 BORDER=1 CELLPADDING=4 CELLSPACING=4> + <COL WIDTH=267> + <COL WIDTH=563> + <TR VALIGN=TOP> + <TD WIDTH=267 BGCOLOR="#9999cc"> + <H3 CLASS="western" STYLE="margin-top: 0cm">OlcbBasicNode</H3> + </TD> + <TD WIDTH=563 BGCOLOR="#9999cc"> + <P>Two consumer, two producer sample node with configuration and + blue/gold programming support. + </P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=267 BGCOLOR="#9999cc"> + <H3 CLASS="western" STYLE="margin-top: 0cm">OlcbEightConsumer</H3> + </TD> + <TD WIDTH=563 BGCOLOR="#9999cc"> + <P>Eight consumer sample node with configuration and blue/gold + programming support. + </P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=267 BGCOLOR="#9999cc"> + <H3 CLASS="western" STYLE="margin-top: 0cm">RailroadShieldNode</H3> + </TD> + <TD WIDTH=563 BGCOLOR="#9999cc"> + <P>One consumer, one producer sample node with configuration and + blue/gold programming support. Uses the first of the built-in + green buttons for input and output. + </P> + <P>Note 1: You need to set the CS selection to B,1 in the + CAN/utility/config.h file of the CAN library. + </P> + <P>Note 2: The 2nd built-in button is on Arduino pin 10, which is + the CS bit on other CAN interfaces. If this sketch is updated to + use that bit, it ceases to function after a little while, so + there's probably another reference to the CS bit in the CAN + library that we haven't found yet. + </P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=267 BGCOLOR="#9999cc"> + <H3 CLASS="western" STYLE="margin-top: 0cm">OlcbEightConsumer</H3> + </TD> + <TD WIDTH=563 BGCOLOR="#9999cc"> + <P>Eight consumer sample node with configuration and blue/gold + programming support. + </P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=267 BGCOLOR="#9999cc"> + <H3 CLASS="western" STYLE="margin-top: 0cm">OlcbServoNode</H3> + </TD> + <TD WIDTH=563 BGCOLOR="#9999cc"> + <P>Three consumer sample node to drive a servo to one of three + positions. + </P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=267 BGCOLOR="#9999cc"> + <H3 CLASS="western" STYLE="margin-top: 0cm">OlcbDisplay</H3> + </TD> + <TD WIDTH=563 BGCOLOR="#9999cc"> + <P>Display OpenLCB messages on a LCD display. + </P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=267 BGCOLOR="#9999cc"> + <H3 CLASS="western" STYLE="margin-top: 0cm">CAN2EtherNetClient, + CAN2EtherNetServer</H3> + </TD> + <TD WIDTH=563 BGCOLOR="#9999cc"> + <P>Provide an ASCII format Ethernet-CAN interface as either a + Telnet client or server. + </P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=267 BGCOLOR="#9999cc"> + <H3 CLASS="western" STYLE="margin-top: 0cm">CAN2USBuino</H3> + </TD> + <TD WIDTH=563 BGCOLOR="#9999cc"> + <P>Provide an ASCII-format CAN-USB interface. Useful as an + adapter for e.g. a PC program. + </P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=267 BGCOLOR="#9999cc"> + <H3 CLASS="western" STYLE="margin-top: 0cm">CAN2USBuinoFilters</H3> + </TD> + <TD WIDTH=563 BGCOLOR="#9999cc"> + <P>An ASCII-format CAN-USB interface with filtering; work in + progress. + </P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=267 BGCOLOR="#9999cc"> + <H3 CLASS="western" STYLE="margin-top: 0cm">OlcbClockGenerator, + OlcbFastClockDisplayNode</H3> + </TD> + <TD WIDTH=563 BGCOLOR="#9999cc"> + <P>A fast clock time generator and display module for OpenLCB + (Work in progress) + </P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=267 BGCOLOR="#9999cc"> + <H3 CLASS="western" STYLE="margin-top: 0cm">OlcbLocoNet</H3> + </TD> + <TD WIDTH=563 BGCOLOR="#9999cc"> + <P>(Work in progress) + </P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=267 BGCOLOR="#9999cc"> + <H3 CLASS="western" STYLE="margin-top: 0cm">OlcbNmraDcc</H3> + </TD> + <TD WIDTH=563 BGCOLOR="#9999cc"> + <P>(Work in progress) + </P> + </TD> + </TR> + </TABLE> +</DL> +<H2 CLASS="western">Library</H2> +<P>The platform-independent library code lives in the +<A HREF="libraries/OlcbCommonCAN/index.html">libraries/OlcbCommonCAN +directory</A>.</P> +<H2 CLASS="western">Getting the Code</H2> +<P>The content of this development area, including code, documents +and web pages, is kept in the <A HREF="https://sourceforge.net/projects/openlcb/develop">OpenLCB</A> +<A HREF="https://sourceforge.net/">SourceForge.net</A> <A HREF="http://openlcb.svn.sourceforge.net/viewvc/openlcb/trunk">SVN +repository</A> in the “trunk/prototypes/C” directory. To check it +out, please do:</P> +<PRE STYLE="margin-left: 2cm; margin-bottom: 0.5cm"><B>svn co https://openlcb.svn.sourceforge.net/svnroot/openlcb/trunk/prototypes/C C</B></PRE><P STYLE="margin-bottom: 0cm"> +For more information on the SVN source code management tool, please +see the <A HREF="http://subversion.tigris.org/">SVN website</A> and +the <A HREF="http://svnbook.red-bean.com/">online SVN book</A>.</P> +<P STYLE="margin-bottom: 0cm"><BR> +</P> +<HR> +<P STYLE="margin-bottom: 0cm">This web sites contains trademarks and +copyrighted information. Please see the <A HREF="/Licensing.html">Licensing</A> +page.</P> +<P STYLE="margin-bottom: 0cm">This is SVN $Revision$ of <SDFIELD TYPE=DATETIME SDVAL="40041.4309143519" SDNUM="1033;1033;MM/DD/YY">08/16/09</SDFIELD>.</P> +</BODY> +</HTML> \ No newline at end of file Modified: trunk/prototypes/C/OlcbStarLibraries/Makefile =================================================================== --- trunk/prototypes/C/OlcbStarLibraries/Makefile 2013-03-23 06:52:16 UTC (rev 3075) +++ trunk/prototypes/C/OlcbStarLibraries/Makefile 2013-03-23 06:54:05 UTC (rev 3076) @@ -11,8 +11,6 @@ all: $(foreach v,$(SUBDIRS),$(v).all) # make Arduino C library (no tests exist) cd libraries/OlcbArduinoCAN; make lib - # make new OpenLCB C++ library (no tests exist) - cd libraries/OpenLCB; make lib # build common C library and test cd libraries/OlcbTestCAN; make run Modified: trunk/prototypes/C/OlcbStarLibraries/standard.mk =================================================================== --- trunk/prototypes/C/OlcbStarLibraries/standard.mk 2013-03-23 06:52:16 UTC (rev 3075) +++ trunk/prototypes/C/OlcbStarLibraries/standard.mk 2013-03-23 06:54:05 UTC (rev 3076) @@ -39,8 +39,7 @@ %.hex: %.elf $(OBJCOPY) -j .text -j .data -O ihex $< $@ -# assumes only one PDE or INO file -PDE := $(foreach V,$(wildcard *.pde),$(V:.pde=)) +# assumes only one INO file INO := $(foreach V,$(wildcard *.ino),$(V:.ino=)) # copy header files, if any, to temp build directory @@ -49,7 +48,6 @@ all: $(foreach V,$(wildcard *.h),${TMPDIR}/$(V)) -cp ${INO}.ino ${TMPDIR}/${INO}.cpp - -cp ${PDE}.pde ${TMPDIR}/${PDE}.cpp cd ${TMPDIR}; ${ARDUINO_ROOT}hardware/tools/avr/bin/avr-g++ -c -g ${CC_OPTIONS_ARDUINO} ${INCLUDE_ARDUINO} ${INCLUDE_OPTIONS} *.cpp # rm -r ${TMPDIR} Copied: trunk/prototypes/C/arduino.mk (from rev 3052, trunk/prototypes/C/arduino.mk) =================================================================== --- trunk/prototypes/C/arduino.mk (rev 0) +++ trunk/prototypes/C/arduino.mk 2013-03-23 06:54:05 UTC (rev 3076) @@ -0,0 +1,8 @@ +# Arduino install definitions, for Arduino 22 + +# The ARDUINO_ROOT definition varies with install location +ARDUINO_ROOT := /Applications/Arduino.app/Contents/Resources/Java/ + +CC_OPTIONS_ARDUINO := -Os -w -fno-exceptions -ffunction-sections -fdata-sections -std=gnu99 -mmcu=atmega168 -DF_CPU=16000000L + +INCLUDE_ARDUINO := -I${ARDUINO_ROOT}hardware/arduino/cores/arduino -I${ARDUINO_ROOT}hardware/arduino/variants/standard Copied: trunk/prototypes/C/standard.mk (from rev 3052, trunk/prototypes/C/standard.mk) =================================================================== --- trunk/prototypes/C/standard.mk (rev 0) +++ trunk/prototypes/C/standard.mk 2013-03-23 06:54:05 UTC (rev 3076) @@ -0,0 +1,56 @@ +# Simple makefile fragment for Arduino sketch, somewhat brute force. +# Requires a suitable arduino.mk has been included first + +INCLUDE_ARDUINO := ${INCLUDE_ARDUINO} -I${ARDUINO_ROOT}libraries/EEPROM +INCLUDE_ARDUINO := ${INCLUDE_ARDUINO} -I${ARDUINO_ROOT}libraries/LiquidCrystal +INCLUDE_ARDUINO := ${INCLUDE_ARDUINO} -I${ARDUINO_ROOT}libraries/SPI +INCLUDE_ARDUINO := ${INCLUDE_ARDUINO} -I${ARDUINO_ROOT}libraries/Servo + +# note that this in meant to be included one level down, where PWD refers to a specific examples/sketch + +# local libraries +INCLUDE_OPTIONS := -I${PWD}/libraries/ButtonLED +INCLUDE_OPTIONS := ${INCLUDE_OPTIONS} -I${PWD}/libraries/OlcbArduinoCAN +INCLUDE_OPTIONS := ${INCLUDE_OPTIONS} -I${PWD}/libraries/OlcbCommonCAN +INCLUDE_OPTIONS := ${INCLUDE_OPTIONS} -I${PWD}/libraries/CAN +INCLUDE_OPTIONS := ${INCLUDE_OPTIONS} -I${PWD}/libraries/LCmini +INCLUDE_OPTIONS := ${INCLUDE_OPTIONS} -I${PWD}/libraries/LocoNet +INCLUDE_OPTIONS := ${INCLUDE_OPTIONS} -I${PWD}/libraries/NmraDcc +INCLUDE_OPTIONS := ${INCLUDE_OPTIONS} -I${PWD}/libraries/EthernetBonjour +INCLUDE_OPTIONS := ${INCLUDE_OPTIONS} -I${PWD}/libraries/EthernetDNS +INCLUDE_OPTIONS := ${INCLUDE_OPTIONS} -I${PWD}/libraries/EthernetDHCP + +# libraries that locals may sub for + +INCLUDE_OPTIONS := ${INCLUDE_OPTIONS} -I${PWD}/libraries/EtherNet2 +INCLUDE_OPTIONS := ${INCLUDE_OPTIONS} -I${ARDUINO_ROOT}libraries/Ethernet + +TMPDIR := $(shell mktemp -d /tmp/Arduino.XXXXXXXX) + +io: TARGET = at90can128 +io: MCU_TARGET = at90can128 +io: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=3' +# -DBAUD_RATE=57600 +io: AVR_FREQ = 16000000L +#io: LDSECTION = --section-start=.text=0xF000 +io: LDSECTION = --section-start=.text=0x1E000 +io: ${INO}${PDE}_io.hex + +%.hex: %.elf + $(OBJCOPY) -j .text -j .data -O ihex $< $@ + +# assumes only one INO file +INO := $(foreach V,$(wildcard *.ino),$(V:.ino=)) + +# copy header files, if any, to temp build directory +$(foreach V,$(wildcard *.h),${TMPDIR}/$(V)): + cp *.h ${TMPDIR}/ + +all: $(foreach V,$(wildcard *.h),${TMPDIR}/$(V)) + -cp ${INO}.ino ${TMPDIR}/${INO}.cpp + cd ${TMPDIR}; ${ARDUINO_ROOT}hardware/tools/avr/bin/avr-g++ -c -g ${CC_OPTIONS_ARDUINO} ${INCLUDE_ARDUINO} ${INCLUDE_OPTIONS} *.cpp + +# rm -r ${TMPDIR} + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |