dev.ed.am
Arduino Makefile
previous_open_issue.png
Go to the previous open issue
previous_issue.png
Go to the previous issue (open or closed)
star_faded.png
Please log in to bookmark issues
feature_request_small.png
icon_project.png Arduino Makefile / Open Feature request #1 Win32 Support
action_vote_minus_faded.png
0
Votes
action_vote_plus_faded.png
next_issue.png
Go to the next issue (open or closed)
next_open_issue.png
Go to the next open issue
Issue basics
  • Type of issue
    Feature request
  • Targetted for
    0.7 release
  • Status
    Investigating
  • Progress
  • Priority
    Not determined
User pain
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
Affected by this issue (0)
There are no items
People involved
Times and dates
  • Posted at
  • Last updated
Issue details
  • Resolution
    Not determined
Attachments (0)
There is nothing attached to this issue
Commits (0)
There are no code checkins for this issue
Duplicate issues (0)
This issue does not have any duplicates
Description
With a small amount of fiddling, I modified the makefile so it works equivalently across OS X, Linux and Windows (at least in terms of building a sketch, upload and serial monitor not tested).

I attach the following patch.

<source lang="diff">
--- arduino.mk.orig 2012-12-13 17:40:52.000000000 +1100
+++ arduino.mk 2012-12-13 17:41:46.000000000 +1100
@@ -151,6 +151,18 @@
#_______________________________________________________________________________
#

+ifeq ($(OS),Windows_NT)
+ WIN32 := 1
+ ifdef ARDUINODIR
+ ifneq (,$(findstring :,$(ARDUINODIR)))
+ ARDUINODIR := /$(subst :,/,$(ARDUINODIR))
+ endif
+ ARDUINODIR := $(subst \,/,$(ARDUINODIR))
+ endif
+else
+ POSIX := 1
+endif
+
# default arduino software directory, check software exists
ifndef ARDUINODIR
ARDUINODIR := $(firstword $(wildcard ~/opt/arduino /usr/share/arduino))
@@ -201,7 +213,12 @@
endif

# software
-findsoftware = $(firstword $(wildcard $(addsuffix /$(1), $(AVRTOOLSPATH))))
+ifdef WIN32
+ EXE := .exe
+else
+ EXE :=
+endif
+findsoftware = $(firstword $(wildcard $(addsuffix /$(1)$(EXE), $(AVRTOOLSPATH))))
CC := $(call findsoftware,avr-gcc)
CXX := $(call findsoftware,avr-g++)
LD := $(call findsoftware,avr-ld)
@@ -226,7 +243,7 @@

# avrdude confifuration
ifeq "$(AVRDUDECONF)" ""
-ifeq "$(AVRDUDE)" "$(ARDUINODIR)/hardware/tools/avr/bin/avrdude"
+ifeq "$(AVRDUDE)" "$(ARDUINODIR)/hardware/tools/avr/bin/avrdude$(EXE)"
AVRDUDECONF := $(ARDUINODIR)/hardware/tools/avr/etc/avrdude.conf
else
AVRDUDECONF := $(wildcard $(AVRDUDE).conf)

</source>
Comments ()
#7
 Cat101
Mar 14, 2013
This patch does not work with cygwin. All the .exe tools expect the file paths to be in WIN format and choke when they get the cygwin paths. The patch helped make find the tools. I assume Michael is using cmake o nmake
#4
 edam (edam)
Jan 04, 2013
Thanks for the patch! I just have a couple of questions...

Under what system are you trying to run this, exactly?

If it is cygwin/mingw, then I was under the impression that adding ".exe" was not necessary. Is this not the case? And why isn't it reasonable for the makefile to require POSIX-style filenames, with forward-slashes?

If it is not cygwin/ming, then how on earth are you getting the makefile to run!? :o)
#1
 Michael (esharpmajor)
Dec 13, 2012
I didn't realise I would be completely anonymous when submitting the bug. Hopefully this comment allows me to be CC'ed and a way for you to contact me.
History