Add support for "windows_x86" development platform // Issue #263

This commit is contained in:
Ivan Kravets
2015-08-09 19:05:16 +03:00
parent 2715efd910
commit 5e2415cb37
10 changed files with 121 additions and 7 deletions

View File

@@ -4,9 +4,15 @@ Release History
2.3.0 (2015-??-??) 2.3.0 (2015-??-??)
------------------ ------------------
* Added `native <http://docs.platformio.org/en/latest/platforms/native.html>`_ * Added
`native <http://docs.platformio.org/en/latest/platforms/native.html>`__,
`windows_x86 <http://docs.platformio.org/en/latest/platforms/windows_x86.html>`__
development platform development platform
(`issue #263 <https://github.com/platformio/platformio/issues/263>`_) (`issue #263 <https://github.com/platformio/platformio/issues/263>`_)
* Added support for Adafruit Gemma board to
`atmelavr <http://docs.platformio.org/en/latest/platforms/atmelavr.html#boards>`__
platform
(`pull #256 <https://github.com/platformio/platformio/pull/256>`_)
2.2.2 (2015-07-30) 2.2.2 (2015-07-30)
------------------ ------------------

View File

@@ -111,6 +111,9 @@ Packages
* - ``toolchain-gccarmnoneeabi`` * - ``toolchain-gccarmnoneeabi``
- `gcc-arm-embedded <https://launchpad.net/gcc-arm-embedded>`_, `GDB <http://www.gnu.org/software/gdb/>`_ - `gcc-arm-embedded <https://launchpad.net/gcc-arm-embedded>`_, `GDB <http://www.gnu.org/software/gdb/>`_
* - ``toolchain-gccmingw32``
- `MinGW <http://www.mingw.org>`_
* - ``toolchain-timsp430`` * - ``toolchain-timsp430``
- `msp-gcc <http://sourceforge.net/projects/mspgcc/>`_, `GDB <http://www.gnu.org/software/gdb/>`_ - `msp-gcc <http://sourceforge.net/projects/mspgcc/>`_, `GDB <http://www.gnu.org/software/gdb/>`_

View File

@@ -36,6 +36,7 @@ Desktop
:maxdepth: 2 :maxdepth: 2
native native
windows_x86
Own Platform/Board Own Platform/Board
------------------ ------------------

View File

@@ -0,0 +1,21 @@
.. _platform_windows_x86:
Platform ``windows_x86``
========================
Windows x86 (32-bit) is a metafamily of graphical operating systems developed and marketed by Microsoft. Using host OS (Windows or Mac OS X) you can build native application for Windows x86 platform.
For more detailed information please visit `vendor site <http://platformio.org/#!/platforms/windows_x86>`_.
.. contents::
Packages
--------
.. list-table::
:header-rows: 1
* - Name
- Contents
* - ``toolchain-gccmingw32``
- `MinGW <http://www.mingw.org>`_

View File

@@ -1,7 +1,7 @@
# Copyright (C) Ivan Kravets <me@ikravets.com> # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details. # See LICENSE for details.
VERSION = (2, 3, "0.dev0") VERSION = (2, 3, "0.dev1")
__version__ = ".".join([str(s) for s in VERSION]) __version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio" __title__ = "platformio"

View File

@@ -5,12 +5,11 @@
Builder for native platform Builder for native platform
""" """
from SCons.Script import DefaultEnvironment, AlwaysBuild, Default from SCons.Script import AlwaysBuild, Default, DefaultEnvironment
env = DefaultEnvironment() env = DefaultEnvironment()
env.Replace( env.Replace(
SIZEPRINTCMD="size $SOURCES" SIZEPRINTCMD="size $SOURCES"
) )

View File

@@ -0,0 +1,49 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
"""
Builder for Windows x86
"""
from SCons.Script import AlwaysBuild, Default, DefaultEnvironment
from platformio.util import get_systype
env = DefaultEnvironment()
env.Replace(
SIZEPRINTCMD="size $SOURCES",
PROGSUFFIX=".exe"
)
if get_systype() == "darwin_x86_64":
env.Replace(
AR="i586-mingw32-ar",
AS="i586-mingw32-as",
CC="i586-mingw32-gcc",
CXX="i586-mingw32-g++",
OBJCOPY="i586-mingw32-objcopy",
RANLIB="i586-mingw32-ranlib",
SIZETOOL="i586-mingw32-size",
SIZEPRINTCMD='"$SIZETOOL" $SOURCES'
)
#
# Target: Build executable program
#
target_bin = env.BuildProgram()
#
# Target: Print binary size
#
target_size = env.Alias("size", target_bin, "$SIZEPRINTCMD")
AlwaysBuild(target_size)
#
# Target: Define targets
#
Default([target_bin])

View File

@@ -90,6 +90,9 @@ PLATFORM_PACKAGES = {
"tool-micronucleus": [ "tool-micronucleus": [
("Micronucleus", "https://github.com/micronucleus/micronucleus") ("Micronucleus", "https://github.com/micronucleus/micronucleus")
], ],
"toolchain-gccmingw32": [
("MinGW", "http://www.mingw.org")
],
"tool-bossac": [ "tool-bossac": [
("BOSSA CLI", "https://sourceforge.net/projects/b-o-s-s-a/") ("BOSSA CLI", "https://sourceforge.net/projects/b-o-s-s-a/")
], ],
@@ -224,6 +227,12 @@ class BasePlatform(object):
else: else:
raise NotImplementedError() raise NotImplementedError()
def is_embedded(self):
for name, opts in self.get_packages().items():
if name == "framework-mbed" or opts.get("alias") == "uploader":
return True
return False
def get_packages(self): def get_packages(self):
return self.PACKAGES return self.PACKAGES

View File

@@ -0,0 +1,24 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
from platformio.platforms.base import BasePlatform
class Windows_x86Platform(BasePlatform):
"""
Windows x86 (32-bit) is a metafamily of graphical operating systems
developed and marketed by Microsoft.
Using host OS (Windows or Mac OS X) you can build native application
for Windows x86 platform.
http://platformio.org/#!/platforms/windows_x86
"""
PACKAGES = {
"toolchain-gccmingw32": {
"alias": "toolchain",
"default": True
}
}

View File

@@ -66,7 +66,7 @@ def generate_boards(boards):
return "\n".join(lines + [""]) return "\n".join(lines + [""])
def generate_packages(packages): def generate_packages(packages, is_embedded):
if not packages: if not packages:
return return
allpackages = get_packages() allpackages = get_packages()
@@ -92,7 +92,8 @@ Packages
type_=type_, type_=type_,
contents=", ".join(contitems))) contents=", ".join(contitems)))
lines.append(""" if is_embedded:
lines.append("""
.. warning:: .. warning::
**Linux Users:** Don't forget to install "udev" rules file **Linux Users:** Don't forget to install "udev" rules file
`99-platformio-udev.rules <https://github.com/platformio/platformio/blob/develop/scripts/99-platformio-udev.rules>`_ (an instruction is located in the file). `99-platformio-udev.rules <https://github.com/platformio/platformio/blob/develop/scripts/99-platformio-udev.rules>`_ (an instruction is located in the file).
@@ -101,6 +102,7 @@ Packages
from board manufacturer from board manufacturer
""") """)
return "\n".join(lines) return "\n".join(lines)
@@ -126,7 +128,7 @@ For more detailed information please visit `vendor site <%s>`_.""" %
# #
# Packages # Packages
# #
_packages_content = generate_packages(p.get_packages()) _packages_content = generate_packages(p.get_packages(), p.is_embedded())
if _packages_content: if _packages_content:
lines.append(_packages_content) lines.append(_packages_content)