From: <jac...@us...> - 2013-03-23 05:53:34
|
Revision: 3062 http://openlcb.svn.sourceforge.net/openlcb/?rev=3062&view=rev Author: jacobsen Date: 2013-03-23 05:53:27 +0000 (Sat, 23 Mar 2013) Log Message: ----------- moving over the Makefile support, 1st step Modified Paths: -------------- trunk/prototypes/C/OlcbStarLibraries/libraries/ButtonLED/ButtonLed.h Added Paths: ----------- trunk/prototypes/C/OlcbStarLibraries/Makefile trunk/prototypes/C/OlcbStarLibraries/arduino.mk trunk/prototypes/C/OlcbStarLibraries/gtest/ trunk/prototypes/C/OlcbStarLibraries/standard.mk Copied: trunk/prototypes/C/OlcbStarLibraries/Makefile (from rev 3052, trunk/prototypes/C/Makefile) =================================================================== --- trunk/prototypes/C/OlcbStarLibraries/Makefile (rev 0) +++ trunk/prototypes/C/OlcbStarLibraries/Makefile 2013-03-23 05:53:27 UTC (rev 3062) @@ -0,0 +1,18 @@ + +# Top-level Makefile for OpenLCB C/C++ implementations + +# Arduino sketch directories +SUBDIRS := $(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 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 + Copied: trunk/prototypes/C/OlcbStarLibraries/arduino.mk (from rev 3052, trunk/prototypes/C/arduino.mk) =================================================================== --- trunk/prototypes/C/OlcbStarLibraries/arduino.mk (rev 0) +++ trunk/prototypes/C/OlcbStarLibraries/arduino.mk 2013-03-23 05:53:27 UTC (rev 3062) @@ -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 Modified: trunk/prototypes/C/OlcbStarLibraries/libraries/ButtonLED/ButtonLed.h =================================================================== --- trunk/prototypes/C/OlcbStarLibraries/libraries/ButtonLED/ButtonLed.h 2013-03-23 05:52:22 UTC (rev 3061) +++ trunk/prototypes/C/OlcbStarLibraries/libraries/ButtonLED/ButtonLed.h 2013-03-23 05:53:27 UTC (rev 3062) @@ -28,8 +28,7 @@ // Values of 500 and 1k work well for cheap LEDs. // For high intensity LEDs, R1 should perhaps be 1k. -// #include "OlcbUtil.h" -#include <Arduino.h> +#include "OlcbUtil.h" class ButtonLed { private: Copied: trunk/prototypes/C/OlcbStarLibraries/standard.mk (from rev 3052, trunk/prototypes/C/standard.mk) =================================================================== --- trunk/prototypes/C/OlcbStarLibraries/standard.mk (rev 0) +++ trunk/prototypes/C/OlcbStarLibraries/standard.mk 2013-03-23 05:53:27 UTC (rev 3062) @@ -0,0 +1,58 @@ +# 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 PDE or INO file +PDE := $(foreach V,$(wildcard *.pde),$(V:.pde=)) +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 + -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} + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |