From 79068828f101c7acee598b5e859ea00f25ef6c1c Mon Sep 17 00:00:00 2001 From: Martin Oldfield Date: Sun, 29 Apr 2012 18:55:17 +0100 Subject: Rejig path calculations.\nMove reset target to Perl.\n --- README.md | 40 +++++- arduino-mk/Arduino.mk | 171 ++++++++++++++++++----- arduino-mk/ard-parse-boards | 261 ------------------------------------ bin/ard-parse-boards | 261 ++++++++++++++++++++++++++++++++++++ bin/ard-reset-arduino | 115 ++++++++++++++++ examples/AnalogInOutSerial/Makefile | 4 - examples/Blink/Makefile | 6 +- examples/BlinkWithoutDelay/Makefile | 4 - examples/Fade/Makefile | 4 - examples/HelloWorld/Makefile | 4 - examples/WebServer/Makefile | 6 +- examples/master_reader/Makefile | 4 - examples/toneMelody/Makefile | 4 - 13 files changed, 551 insertions(+), 333 deletions(-) delete mode 100755 arduino-mk/ard-parse-boards create mode 100755 bin/ard-parse-boards create mode 100755 bin/ard-reset-arduino diff --git a/README.md b/README.md index e976748..f086c92 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,45 @@ still find [what documentation](http://mjo.tc/atelier/2009/02/arduino-cli.html "Documentation") exists. -If you're using Debian or Ubuntu, you can find this in the arduino-core package. +If you're using Debian or Ubuntu, you can find this in the +arduino-core package. + +# Important Changes, 2012-04-29 + +I've rejigged the path calculations so that: + +1. Few, if any paths, need to specified in the project specific Makefiles. + +1. The paths can be grabber from the environment e.g. set up in a user's .bashrc. + +1. It should be easier to move between e.g. Mac and Linux. + +I'm indebted to Christopher Peplin for making me think about this, and indeed for +contributing code which did similar things in different ways. + +The upshot of all this is that you'll need to set up some variables if you want +this to work: + +On the Mac you might want to set: + + ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java + ARDMK_DIR = /usr/local + +On Linux, you might prefer: + + ARDUINO_DIR = /usr/share/arduino + ARDMK_DIR = /usr/local + AVR_TOOLS_DIR = /usr + +The Makefile also delegates resetting the board to a short Perl program. +You'll need to install Device::SerialPort to use it though. On Debian or +Ubuntu do + + apt-get install libdevice-serial-perl + +On other systems + + cpanm Device::SerialPort ## User Libraries diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk index 26fd3bb..5261afa 100644 --- a/arduino-mk/Arduino.mk +++ b/arduino-mk/Arduino.mk @@ -72,7 +72,62 @@ # defined (ex Peplin) # - Added a monitor target which talks to the # Arduino serial port (Peplin's suggestion) -# +# - Rejigged PATH calculations for general +# tidiness (ex Peplin) +# - Moved the reset target to Perl for +# clarity and better error handling (ex +# Daniele Vergini) +# +######################################################################## +# +# PATHS YOU NEED TO SET UP +# +# I've reworked the way paths to executables are constructed in this +# version (0.9) of the Makefile. +# +# We need to worry about three different sorts of file: +# +# 1. Things which are included in this distribution e.g. ard-parse-boards +# => ARDMK_DIR +# +# 2. Things which are always in the Arduino distribution e.g. +# boards.txt, libraries, &c. +# => ARDUINO_DIR +# +# 3. Things which might be bundled with the Arduino distribution, but +# might come from the system. Most of the toolchain is like this: +# on Linux it's supplied by the system. +# => AVR_TOOLS_DIR +# +# Having set these three variables, we can work out the rest assuming +# that things are canonically arranged beneath the directories defined +# above. +# +# On the Mac you might want to set: +# +# ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java +# ARDMK_DIR = /usr/local +# +# On Linux, you might prefer: +# +# ARDUINO_DIR = /usr/share/arduino +# ARDMK_DIR = /usr/local +# AVR_TOOLS_DIR = /usr +# +# You can either set these up in the Makefile, or put them in your +# environment e.g. in your .bashrc +# +# If you don't install the ard-... binaries to /usr/local/bin, but +# instead copy them to e.g. /home/mjo/arduino.mk/bin then set +# ARDML_DIR = /home/mjo/arduino.mk +# +######################################################################## +# +# DEPENDENCIES +# +# The Perl programs need a couple of libraries: +# YAML +# Device::SerialPort # ######################################################################## # @@ -83,11 +138,7 @@ # # For example: # -# ARDUINO_DIR = /Applications/arduino-0013 -# -# TARGET = CLItest # ARDUINO_LIBS = Ethernet Ethernet/utility SPI -# # BOARD_TAG = uno # ARDUINO_PORT = /dev/cu.usb* # @@ -95,12 +146,6 @@ # # Hopefully these will be self-explanatory but in case they're not: # -# ARDUINO_DIR - Where the Arduino software has been unpacked -# -# TARGET - The basename used for the final files. Canonically -# this would match the .pde file, but it's not needed -# here: you could always set it to xx if you wanted! -# # ARDUINO_LIBS - A list of any libraries used by the sketch (we # assume these are in # $(ARDUINO_DIR)/hardware/libraries @@ -111,11 +156,6 @@ # BOARD_TAG - The ard-parse-boards tag for the board e.g. uno or mega # 'make show_boards' shows a list # -# You might also want to specify these, but normally they'll be read from the -# boards.txt file i.e. implied by BOARD_TAG -# -# MCU,F_CPU - The target processor description -# # Once this file has been created the typical workflow is just # # $ make upload @@ -157,13 +197,42 @@ # ######################################################################## # -# ARDUINO WITH OTHER TOOLS +# PATHS +# +# I've reworked the way paths to executables are constructed in this +# version of Makefile. +# +# We need to worry about three different sorts of file: +# +# 1. Things which are included in this distribution e.g. ard-parse-boards +# => ARDMK_DIR +# +# 2. Things which are always in the Arduino distribution e.g. +# boards.txt, libraries, &c. +# => ARDUINO_DIR +# +# 3. Things which might be bundled with the Arduino distribution, but +# might come from the system. Most of the toolchain is like this: +# on Linux it's supplied by the system. +# => AVR_TOOLS_DIR +# +# Having set these three variables, we can work out the rest assuming +# that things are canonically arranged beneath the directories defined +# above. +# +# So, on the Mac you might want to set: # -# If the tools aren't in the Arduino distribution, then you need to -# specify their location: +# ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java +# ARDMK_DIR = /usr/local # -# AVR_TOOLS_PATH = /usr/bin -# AVRDUDE_CONF = /etc/avrdude/avrdude.conf +# On Linux, you might prefer: +# +# ARDUINO_DIR = /usr/share/arduino +# ARDMK_DIR = /usr/local +# AVR_TOOLS_DIR = /usr +# +# +# # ######################################################################## # @@ -209,28 +278,49 @@ ifndef ARDUINO_VERSION ARDUINO_VERSION = 100 endif +######################################################################## +# Arduino and system paths # -# Some paths -# +ifdef ARDUINO_DIR -ifneq (ARDUINO_DIR,) +ifndef AVR_TOOLS_DIR +AVR_TOOLS_DIR = $(ARDUINO_DIR)/hardware/tools/avr +# The avrdude bundled with Arduino can't find it's config +AVRDUDE_CONF = $(AVR_TOOLS_DIR)/etc/avrdude.conf +endif ifndef AVR_TOOLS_PATH -AVR_TOOLS_PATH = $(ARDUINO_DIR)/hardware/tools/avr/bin +AVR_TOOLS_PATH = $(AVR_TOOLS_DIR)/bin endif -ifndef ARDUINO_ETC_PATH -ARDUINO_ETC_PATH = $(ARDUINO_DIR)/hardware/tools/avr/etc +ARDUINO_LIB_PATH = $(ARDUINO_DIR)/libraries +ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/arduino/cores/arduino +ARDUINO_VAR_PATH = $(ARDUINO_DIR)/hardware/arduino/variants + +else + +echo $(error "ARDUINO_DIR is not defined") + endif -ifndef AVRDUDE_CONF -AVRDUDE_CONF = $(ARDUINO_ETC_PATH)/avrdude.conf +######################################################################## +# Makefile distribution path +# +ifdef ARDMK_DIR + +ifndef ARDMK_PATH +ARDMK_PATH = $(ARDMK_DIR)/bin endif -ARDUINO_LIB_PATH = $(ARDUINO_DIR)/libraries -ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/arduino/cores/arduino -ARDUINO_VAR_PATH = $(ARDUINO_DIR)/hardware/arduino/variants +else + +echo $(error "ARDMK_DIR is not defined") + +endif +######################################################################## +# Miscellanea +# ifndef ARDUINO_SKETCHBOOK ARDUINO_SKETCHBOOK = $(HOME)/sketchbook endif @@ -239,8 +329,6 @@ ifndef USER_LIB_PATH USER_LIB_PATH = $(ARDUINO_SKETCHBOOK)/libraries endif -endif - ######################################################################## # Serial monitor (just a screen wrapper) # @@ -256,6 +344,12 @@ ifndef MONITOR_CMD MONITOR_CMD = screen endif +######################################################################## +# Reset +ifndef RESET_CMD +RESET_CMD = $(ARDMK_PATH)/ard-reset-arduino $(ARD_RESET_OPTS) +endif + ######################################################################## # boards.txt parsing # @@ -268,7 +362,7 @@ BOARDS_TXT = $(ARDUINO_DIR)/hardware/arduino/boards.txt endif ifndef PARSE_BOARD -PARSE_BOARD = ard-parse-boards +PARSE_BOARD = $(ARDMK_PATH)/ard-parse-boards endif ifndef PARSE_BOARD_OPTS @@ -554,10 +648,13 @@ raw_upload: $(TARGET_HEX) $(AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ARD_OPTS) \ -U flash:w:$(TARGET_HEX):i +reset: + $(RESET_CMD) $(ARD_PORT) + # stty on MacOS likes -F, but on Debian it likes -f redirecting # stdin/out appears to work but generates a spurious error on MacOS at # least. Perhaps it would be better to just do it in perl ? -reset: +reset_stty: for STTYF in 'stty -F' 'stty --file' 'stty -f' 'stty <' ; \ do $$STTYF /dev/tty >/dev/null 2>/dev/null && break ; \ done ;\ @@ -591,6 +688,6 @@ show_boards: monitor: $(MONITOR_CMD) $(ARD_PORT) $(MONITOR_BAUDRATE) -.PHONY: all clean depends upload raw_upload reset size show_boards monitor +.PHONY: all clean depends upload raw_upload reset reset_stty size show_boards monitor include $(DEP_FILE) diff --git a/arduino-mk/ard-parse-boards b/arduino-mk/ard-parse-boards deleted file mode 100755 index e2de71b..0000000 --- a/arduino-mk/ard-parse-boards +++ /dev/null @@ -1,261 +0,0 @@ -#! /usr/bin/perl - -use strict; -use warnings; - -use Getopt::Long; -use Pod::Usage; -use YAML; - -my %Opt = - ( - boards_txt => '/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/boards.txt', - ); - -GetOptions(\%Opt, - "boards_txt=s", # filename of the boards.txt file - "find!", # search for data - "dump!", # dump the whole database - "boards!", # dump a list of boards - "help!", - "info!", - ); - -if ($Opt{help} || $Opt{info}) - { - usage(); - } - -my $db = parse_boards($Opt{boards_txt}); - -if ($Opt{dump}) - { - dump_data("$Opt{boards_txt} contains:", $db); - } -elsif ($Opt{find}) - { - my @terms = @ARGV or usage(); - find_data($db, \@terms); - } -elsif ($Opt{boards}) - { - dump_boards($db); - } -else - { - my $tag = shift @ARGV or usage(); - - if (my $key = shift @ARGV) - { - die "$key isn't defined for the $tag board, " - unless $db->{$tag} && exists $db->{$tag}->{$key}; - - print $db->{$tag}->{$key}, "\n"; - } - else - { - die "The $tag board isn't defined, " - unless $db->{$tag}; - - dump_data("The $tag board:", $db->{$tag}); - } - } - -## here endeth the main - -sub usage - { - pod2usage(-verbose => 2); - } - -# return HoH: {board}->{field} = value -sub parse_boards - { - my $filename = shift; - - my %b; - - open(my $fh, '<', $filename) - or die "Can't open $filename, "; - - while(<$fh>) - { - my ($board, $key, $value) = /^\s*(\S+?)\.(\S+?)\s*=\s*(.+?)\s*$/ - or next; - - $b{$board}->{$key} = $value; - } - - return \%b; - } - -# A rudimentary search engine -sub find_data - { - my ($db, $term_list) = @_; - - my @q = map { qr/$_/i } @$term_list; - my $q = join(' && ', map { "/$_/i" } @$term_list); - - my %hit; - foreach my $b (keys %$db) - { - foreach my $k (keys %{$db->{$b}}) - { - my $v = $db->{$b}->{$k}; - $hit{$b}->{$k} = $v if !grep { $v !~ /$_/i } @q; - } - } - - dump_data("Matches for $q:", \%hit); - } - -# The list of boards... -sub dump_boards - { - my $db = shift or return; - - my %name; - my $max_l = 0; - foreach my $b (keys %$db) - { - $name{$b} = $db->{$b}->{name} || 'Anonymous'; - $max_l = length($b) if $max_l < length($b); - } - - my $fmt = sprintf("%%-%ds %%s\n", $max_l + 2); - - printf $fmt, "Tag", "Board Name"; - foreach my $b (sort keys %name) - { - printf $fmt, $b, $name{$b}; - } - } - - -# dump arbitrary data with a title -sub dump_data - { - my ($title, $data) = @_; - - print "# $title\n", Dump($data); - } - -__END__ - -=head1 NAME - -ard-parse-boards - Read data from the Arduino boards.txt file - -=head1 USAGE - - Dump all the data in the file: - $ ard-parse-boards --dump - - See which boards we know about: - $ ard-parse-boards --boards - - Look for a particular board... - $ ard-parse-boards --find uno - - ...multiple terms are implicitly ANDed: - $ ard-parse-boards --find duemil 328 - - Dump all the data for a particular board: - $ ard-parse-boards atmega328 - - Extract a particular field: - $ ard-parse-boards atmega328 build.f_cpu - -=head1 DESCRIPTION - -The Arduino software package ships with a boards.txt file which tells -the Arduino IDE details about particular hardware. So when the user -says he's got a shiny new Arduino Uno, boards.txt knows that it has a -16MHz ATmega328 on it. It would be nice to access these data from the -command line too. - -In normal operation you simply specify the tag given to the board in -the boards.txt file, and optionally a field name. This program then -extracts the data to STDOUT. - -Most boards have names which are quite unwieldy, so we always refer to -a board by a tag, not its name. Strictly the tag is the bit before the -first dot in the boards.txt key. You can see a list of board tags and -names with the C<--boards> option. - -=head1 OPTIONS - -=over - -=item --boards_txt=[file] - -Specify the full path to the boards.txt file. - -=back - -The following options all disable the normal 'lookup' operation. - -=over - -=item --dump - -Dump the complete database in YAML format. - -=item ---boards - -Print a list of the tag and name of every board in the file. - -=item --find [query] ... - -Find matching data. Strictly, return a list of values which match all -of the query terms, treating each term as a case-insensitive regexp. - -For example: - -=over - -=item --find 328 - -List data containing 328 (anywhere in the value). - -=item --find due - -List data containing 'due' (e.g. duemilanove). - -=item --find 328 due - -List data containing both 328 and due. - -=back - -=back - -=head1 BUGS AND LIMITATIONS - -There are no known bugs in this application. - -Please report problems to the author. - -Patches are welcome. - -=head1 AUTHOR - -Martin Oldfield, ex-atelier@mjo.tc - -Thanks to Mark Sproul who suggested doing something like this to me ages ago. - -=head1 LICENCE AND COPYRIGHT - -Copyright (c) 2011, Martin Oldfield. All rights reserved. - -This file is free software; you can redistribute it and/or modify it -under the terms of the GNU Lesser General Public License as published -by the Free Software Foundation; either version 2.1 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - diff --git a/bin/ard-parse-boards b/bin/ard-parse-boards new file mode 100755 index 0000000..e2de71b --- /dev/null +++ b/bin/ard-parse-boards @@ -0,0 +1,261 @@ +#! /usr/bin/perl + +use strict; +use warnings; + +use Getopt::Long; +use Pod::Usage; +use YAML; + +my %Opt = + ( + boards_txt => '/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/boards.txt', + ); + +GetOptions(\%Opt, + "boards_txt=s", # filename of the boards.txt file + "find!", # search for data + "dump!", # dump the whole database + "boards!", # dump a list of boards + "help!", + "info!", + ); + +if ($Opt{help} || $Opt{info}) + { + usage(); + } + +my $db = parse_boards($Opt{boards_txt}); + +if ($Opt{dump}) + { + dump_data("$Opt{boards_txt} contains:", $db); + } +elsif ($Opt{find}) + { + my @terms = @ARGV or usage(); + find_data($db, \@terms); + } +elsif ($Opt{boards}) + { + dump_boards($db); + } +else + { + my $tag = shift @ARGV or usage(); + + if (my $key = shift @ARGV) + { + die "$key isn't defined for the $tag board, " + unless $db->{$tag} && exists $db->{$tag}->{$key}; + + print $db->{$tag}->{$key}, "\n"; + } + else + { + die "The $tag board isn't defined, " + unless $db->{$tag}; + + dump_data("The $tag board:", $db->{$tag}); + } + } + +## here endeth the main + +sub usage + { + pod2usage(-verbose => 2); + } + +# return HoH: {board}->{field} = value +sub parse_boards + { + my $filename = shift; + + my %b; + + open(my $fh, '<', $filename) + or die "Can't open $filename, "; + + while(<$fh>) + { + my ($board, $key, $value) = /^\s*(\S+?)\.(\S+?)\s*=\s*(.+?)\s*$/ + or next; + + $b{$board}->{$key} = $value; + } + + return \%b; + } + +# A rudimentary search engine +sub find_data + { + my ($db, $term_list) = @_; + + my @q = map { qr/$_/i } @$term_list; + my $q = join(' && ', map { "/$_/i" } @$term_list); + + my %hit; + foreach my $b (keys %$db) + { + foreach my $k (keys %{$db->{$b}}) + { + my $v = $db->{$b}->{$k}; + $hit{$b}->{$k} = $v if !grep { $v !~ /$_/i } @q; + } + } + + dump_data("Matches for $q:", \%hit); + } + +# The list of boards... +sub dump_boards + { + my $db = shift or return; + + my %name; + my $max_l = 0; + foreach my $b (keys %$db) + { + $name{$b} = $db->{$b}->{name} || 'Anonymous'; + $max_l = length($b) if $max_l < length($b); + } + + my $fmt = sprintf("%%-%ds %%s\n", $max_l + 2); + + printf $fmt, "Tag", "Board Name"; + foreach my $b (sort keys %name) + { + printf $fmt, $b, $name{$b}; + } + } + + +# dump arbitrary data with a title +sub dump_data + { + my ($title, $data) = @_; + + print "# $title\n", Dump($data); + } + +__END__ + +=head1 NAME + +ard-parse-boards - Read data from the Arduino boards.txt file + +=head1 USAGE + + Dump all the data in the file: + $ ard-parse-boards --dump + + See which boards we know about: + $ ard-parse-boards --boards + + Look for a particular board... + $ ard-parse-boards --find uno + + ...multiple terms are implicitly ANDed: + $ ard-parse-boards --find duemil 328 + + Dump all the data for a particular board: + $ ard-parse-boards atmega328 + + Extract a particular field: + $ ard-parse-boards atmega328 build.f_cpu + +=head1 DESCRIPTION + +The Arduino software package ships with a boards.txt file which tells +the Arduino IDE details about particular hardware. So when the user +says he's got a shiny new Arduino Uno, boards.txt knows that it has a +16MHz ATmega328 on it. It would be nice to access these data from the +command line too. + +In normal operation you simply specify the tag given to the board in +the boards.txt file, and optionally a field name. This program then +extracts the data to STDOUT. + +Most boards have names which are quite unwieldy, so we always refer to +a board by a tag, not its name. Strictly the tag is the bit before the +first dot in the boards.txt key. You can see a list of board tags and +names with the C<--boards> option. + +=head1 OPTIONS + +=over + +=item --boards_txt=[file] + +Specify the full path to the boards.txt file. + +=back + +The following options all disable the normal 'lookup' operation. + +=over + +=item --dump + +Dump the complete database in YAML format. + +=item ---boards + +Print a list of the tag and name of every board in the file. + +=item --find [query] ... + +Find matching data. Strictly, return a list of values which match all +of the query terms, treating each term as a case-insensitive regexp. + +For example: + +=over + +=item --find 328 + +List data containing 328 (anywhere in the value). + +=item --find due + +List data containing 'due' (e.g. duemilanove). + +=item --find 328 due + +List data containing both 328 and due. + +=back + +=back + +=head1 BUGS AND LIMITATIONS + +There are no known bugs in this application. + +Please report problems to the author. + +Patches are welcome. + +=head1 AUTHOR + +Martin Oldfield, ex-atelier@mjo.tc + +Thanks to Mark Sproul who suggested doing something like this to me ages ago. + +=head1 LICENCE AND COPYRIGHT + +Copyright (c) 2011, Martin Oldfield. All rights reserved. + +This file is free software; you can redistribute it and/or modify it +under the terms of the GNU Lesser General Public License as published +by the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + diff --git a/bin/ard-reset-arduino b/bin/ard-reset-arduino new file mode 100755 index 0000000..22c7109 --- /dev/null +++ b/bin/ard-reset-arduino @@ -0,0 +1,115 @@ +#! /usr/bin/perl + +use strict; +use warnings; + +use Device::SerialPort; +use Getopt::Long; +use Pod::Usage; + +my %Opt = + ( + period => 0.1, + ); + +GetOptions(\%Opt, + "period=f", # width of reset pulse in seconds + "verbose!", + "help!", + "info!", + ); + +if ($Opt{help} || $Opt{info}) + { + usage(); + } + +die "No Arduinos found!\n" + unless @ARGV; + +foreach my $dev (@ARGV) + { + my $p = Device::SerialPort->new($dev) + or die "Unable to open $dev: $!\n"; + + my $dt = $Opt{period}; + + print STDERR "Setting DTR high for ${dt}s on $dev\n" + if $Opt{verbose}; + + die "Invalid pulse width ($dt), " + unless $dt > 0.0; + + $p->pulse_dtr_on($dt * 1000.0); + } + +## here endeth the main + +sub usage + { + pod2usage(-verbose => 2); + } + +__END__ + +=head1 NAME + +ard-reset-arduino - Reset an Arduino + +=head1 USAGE + + $ ard-reset-arduino /dev/cu.usb* + + $ ard-reset-arduino --verbose --period=0.1 /dev/cu.usb* + +=head1 DESCRIPTION + +To reset (most) Arduinos, it's enough to just pulse the DTR line. + +You can do that from the shell with stty, but there's an interesting +diversity of command flags. This little program gives a uniform interface +at the cost of requiring C. + +=head1 OPTIONS + +=over + +=item --verbose + +Watch what's going on on STDERR. + +=item --period=0.25 + +Specify the DTR pulse width in seconds. + +=back + +=head1 BUGS AND LIMITATIONS + +There are no known bugs in this application. + +Please report problems to the author. + +Patches are welcome. + +=head1 AUTHOR + +Martin Oldfield, ex-atelier@mjo.tc + +Thanks to Daniele Vergini who suggested this to me, and supplied +a command line version. + +=head1 LICENCE AND COPYRIGHT + +Copyright (c) 2012, Martin Oldfield. All rights reserved. + +This file is free software; you can redistribute it and/or modify it +under the terms of the GNU Lesser General Public License as published +by the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + diff --git a/examples/AnalogInOutSerial/Makefile b/examples/AnalogInOutSerial/Makefile index 5c8c1dd..eac50fb 100644 --- a/examples/AnalogInOutSerial/Makefile +++ b/examples/AnalogInOutSerial/Makefile @@ -1,9 +1,5 @@ -ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java -PARSE_BOARD = ../../arduino-mk/ard-parse-boards - BOARD_TAG = uno ARDUINO_PORT = /dev/cu.usb* - ARDUINO_LIBS = include ../../arduino-mk/Arduino.mk \ No newline at end of file diff --git a/examples/Blink/Makefile b/examples/Blink/Makefile index 12cd3e6..1c61004 100644 --- a/examples/Blink/Makefile +++ b/examples/Blink/Makefile @@ -1,10 +1,6 @@ -ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java -PARSE_BOARD = ../../arduino-mk/ard-parse-boards - BOARD_TAG = uno ARDUINO_PORT = /dev/cu.usb* - ARDUINO_LIBS = -include ../../arduino-mk/Arduino.mk +include $(ARDMK_DIR)/arduino-mk/Arduino.mk diff --git a/examples/BlinkWithoutDelay/Makefile b/examples/BlinkWithoutDelay/Makefile index 5c8c1dd..eac50fb 100644 --- a/examples/BlinkWithoutDelay/Makefile +++ b/examples/BlinkWithoutDelay/Makefile @@ -1,9 +1,5 @@ -ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java -PARSE_BOARD = ../../arduino-mk/ard-parse-boards - BOARD_TAG = uno ARDUINO_PORT = /dev/cu.usb* - ARDUINO_LIBS = include ../../arduino-mk/Arduino.mk \ No newline at end of file diff --git a/examples/Fade/Makefile b/examples/Fade/Makefile index 5c8c1dd..eac50fb 100644 --- a/examples/Fade/Makefile +++ b/examples/Fade/Makefile @@ -1,9 +1,5 @@ -ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java -PARSE_BOARD = ../../arduino-mk/ard-parse-boards - BOARD_TAG = uno ARDUINO_PORT = /dev/cu.usb* - ARDUINO_LIBS = include ../../arduino-mk/Arduino.mk \ No newline at end of file diff --git a/examples/HelloWorld/Makefile b/examples/HelloWorld/Makefile index 591d575..6c71d22 100644 --- a/examples/HelloWorld/Makefile +++ b/examples/HelloWorld/Makefile @@ -1,9 +1,5 @@ -ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java -PARSE_BOARD = ../../arduino-mk/ard-parse-boards - BOARD_TAG = uno ARDUINO_PORT = /dev/cu.usb* - ARDUINO_LIBS = LiquidCrystal include ../../arduino-mk/Arduino.mk \ No newline at end of file diff --git a/examples/WebServer/Makefile b/examples/WebServer/Makefile index 56e422f..d361759 100644 --- a/examples/WebServer/Makefile +++ b/examples/WebServer/Makefile @@ -1,9 +1,5 @@ -ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java -PARSE_BOARD = ../../arduino-mk/ard-parse-boards - BOARD_TAG = uno ARDUINO_PORT = /dev/cu.usb* - ARDUINO_LIBS = Ethernet Ethernet/utility SPI -include ../../arduino-mk/Arduino.mk \ No newline at end of file +include ../../arduino-mk/Arduino.mk diff --git a/examples/master_reader/Makefile b/examples/master_reader/Makefile index 7e744c1..f242a44 100644 --- a/examples/master_reader/Makefile +++ b/examples/master_reader/Makefile @@ -1,9 +1,5 @@ -ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java -PARSE_BOARD = ../../arduino-mk/ard-parse-boards - BOARD_TAG = uno ARDUINO_PORT = /dev/cu.usb* - ARDUINO_LIBS = Wire Wire/utility include ../../arduino-mk/Arduino.mk diff --git a/examples/toneMelody/Makefile b/examples/toneMelody/Makefile index 17d67e8..7ea0a9f 100644 --- a/examples/toneMelody/Makefile +++ b/examples/toneMelody/Makefile @@ -1,9 +1,5 @@ -ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java -PARSE_BOARD = ../../arduino-mk/ard-parse-boards - BOARD_TAG = uno ARDUINO_PORT = /dev/cu.usb* - ARDUINO_LIBS = include ../../arduino-mk/Arduino.mk -- cgit v1.2.3