mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] bare_metal: add libopencm3 support
@ 2014-06-08  0:07 Michael Grzeschik
  2014-06-13  6:24 ` Michael Olbrich
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Grzeschik @ 2014-06-08  0:07 UTC (permalink / raw)
  To: ptxdist

This patch adds support for the libopencm3 for bare metal
systems. With this library it is possible to build single
applications for cortexm3 companion systems, that
needs to be deployed with the bsp.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 rules/bare_metal.in     |  7 +++++
 rules/bare_metal_cm3.in | 12 ++++++++
 rules/libopencm3.in     | 11 ++++++++
 rules/libopencm3.make   | 75 +++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 105 insertions(+)
 create mode 100644 rules/bare_metal_cm3.in
 create mode 100644 rules/libopencm3.in
 create mode 100644 rules/libopencm3.make

diff --git a/rules/bare_metal.in b/rules/bare_metal.in
index 1292a34..e5c15c5 100644
--- a/rules/bare_metal.in
+++ b/rules/bare_metal.in
@@ -6,3 +6,10 @@ menuconfig STELLARIS
 if STELLARIS
 source "generated/bare_metal_stellaris.in"
 endif
+
+menuconfig OPENCM3
+	bool "OpenCM3                       "
+
+if OPENCM3
+source "generated/bare_metal_cm3.in"
+endif
diff --git a/rules/bare_metal_cm3.in b/rules/bare_metal_cm3.in
new file mode 100644
index 0000000..a912c9e
--- /dev/null
+++ b/rules/bare_metal_cm3.in
@@ -0,0 +1,12 @@
+## SECTION=bare_metal_cm3
+
+config CM3_GNU_TARGET
+	string
+	prompt "stellaris gnu target"
+	default "arm-cortexm3-eabi"
+	help
+	  configure the cm3 gnu target
+
+config CM3_CC
+	string
+	default "${PTXCONF_CM3_GNU_TARGET}-gcc"
diff --git a/rules/libopencm3.in b/rules/libopencm3.in
new file mode 100644
index 0000000..69276b7
--- /dev/null
+++ b/rules/libopencm3.in
@@ -0,0 +1,11 @@
+## SECTION=bare_metal_cm3
+
+config LIBOPENCM3
+	tristate
+	prompt "libopencm3"
+	help
+	  The libopencm3 project (previously known as libopenstm32) aims
+	  to create a free/libre/open-source (LGPL v3, or later) firmware
+	  library for various ARM Cortex-M0(+)/M3/M4 microcontrollers,
+	  including ST STM32, Ti Tiva and Stellaris, NXP LPC 11xx, 13xx,
+	  15xx, 17xx parts, Atmel SAM3, Energy Micro EFM32 and others.
diff --git a/rules/libopencm3.make b/rules/libopencm3.make
new file mode 100644
index 0000000..8ceb1a1
--- /dev/null
+++ b/rules/libopencm3.make
@@ -0,0 +1,75 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2013 by Michael Grzeschik <m.grzeschik@gmx.net>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+ifdef PTXCONF_LIBOPENCM3
+ifneq ($(shell test -h $(PTXDIST_WORKSPACE)/selected_toolchain_cm3 && echo ok),ok)
+    $(warning *** selected_toolchain_cm3 must point to a valid cortexm3 toolchain)
+    $(error )
+endif
+ifneq ($(shell test -x $(PTXDIST_WORKSPACE)/selected_toolchain_cm3/$(PTXCONF_CM3_CC) && echo ok),ok)
+    $(warning *** $(PTXDIST_WORKSPACE)/selected_toolchain_cm3/$(PTXCONF_CM3_CC) not found)
+    $(error )
+endif
+endif
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_LIBOPENCM3) += libopencm3
+
+#
+# Paths and names
+#
+LIBOPENCM3_VERSION	:= 67b538a5
+LIBOPENCM3_MD5		:= 7d40cc7bcd3a5e852d0b37572655b9b5
+LIBOPENCM3		:= libopencm3-$(LIBOPENCM3_VERSION)
+LIBOPENCM3_SUFFIX	:= tar.bz2
+LIBOPENCM3_URL		:= https://github.com/libopencm3/libopencm3.git;tag=67b538a5
+LIBOPENCM3_SOURCE	:= $(SRCDIR)/$(LIBOPENCM3).$(LIBOPENCM3_SUFFIX)
+LIBOPENCM3_DIR		:= $(BUILDDIR)/$(LIBOPENCM3)
+LIBOPENCM3_LICENSE	:= LGPLv3+
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+LIBOPENCM3_MAKEVARS := \
+	PREFIX=$(PTXDIST_WORKSPACE)/selected_toolchain_cm3/$(PTXCONF_CM3_GNU_TARGET)
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/libopencm3.install:
+	@$(call targetinfo)
+
+#	# install static libraries
+	mkdir -p $(PTXDIST_PLATFORMDIR)/sysroot-cm3/lib
+	cp $(LIBOPENCM3_DIR)/lib/*.a \
+		$(PTXDIST_PLATFORMDIR)/sysroot-cm3/lib/
+
+#	# install header files
+	mkdir -p $(PTXDIST_PLATFORMDIR)/sysroot-cm3/include
+	cd $(LIBOPENCM3_DIR) && \
+	for i in `find . -name "*.h"`; do \
+		mkdir -p $(PTXDIST_PLATFORMDIR)/sysroot-cm3/include/`dirname $$i`; \
+		cp $$i $(PTXDIST_PLATFORMDIR)/sysroot-cm3/include/$$i; \
+	done
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/libopencm3.targetinstall:
+	@$(call targetinfo)
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.0.0.rc2


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [PATCH] bare_metal: add libopencm3 support
  2014-06-08  0:07 [ptxdist] [PATCH] bare_metal: add libopencm3 support Michael Grzeschik
@ 2014-06-13  6:24 ` Michael Olbrich
  2014-06-27 19:02   ` [ptxdist] [PATCH v2] " Michael Grzeschik
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Olbrich @ 2014-06-13  6:24 UTC (permalink / raw)
  To: ptxdist

On Sun, Jun 08, 2014 at 02:07:12AM +0200, Michael Grzeschik wrote:
> This patch adds support for the libopencm3 for bare metal
> systems. With this library it is possible to build single
> applications for cortexm3 companion systems, that
> needs to be deployed with the bsp.
> 
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> ---
>  rules/bare_metal.in     |  7 +++++
>  rules/bare_metal_cm3.in | 12 ++++++++
>  rules/libopencm3.in     | 11 ++++++++
>  rules/libopencm3.make   | 75 +++++++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 105 insertions(+)
>  create mode 100644 rules/bare_metal_cm3.in
>  create mode 100644 rules/libopencm3.in
>  create mode 100644 rules/libopencm3.make
> 
> diff --git a/rules/bare_metal.in b/rules/bare_metal.in
> index 1292a34..e5c15c5 100644
> --- a/rules/bare_metal.in
> +++ b/rules/bare_metal.in
> @@ -6,3 +6,10 @@ menuconfig STELLARIS
>  if STELLARIS
>  source "generated/bare_metal_stellaris.in"
>  endif
> +
> +menuconfig OPENCM3
> +	bool "OpenCM3                       "
> +
> +if OPENCM3
> +source "generated/bare_metal_cm3.in"
> +endif
> diff --git a/rules/bare_metal_cm3.in b/rules/bare_metal_cm3.in
> new file mode 100644
> index 0000000..a912c9e
> --- /dev/null
> +++ b/rules/bare_metal_cm3.in
> @@ -0,0 +1,12 @@
> +## SECTION=bare_metal_cm3
> +
> +config CM3_GNU_TARGET
> +	string
> +	prompt "stellaris gnu target"

I think this should be 'cm3' not 'stellaris', right?

> +	default "arm-cortexm3-eabi"
> +	help
> +	  configure the cm3 gnu target
> +
> +config CM3_CC
> +	string
> +	default "${PTXCONF_CM3_GNU_TARGET}-gcc"
> diff --git a/rules/libopencm3.in b/rules/libopencm3.in
> new file mode 100644
> index 0000000..69276b7
> --- /dev/null
> +++ b/rules/libopencm3.in
> @@ -0,0 +1,11 @@
> +## SECTION=bare_metal_cm3
> +
> +config LIBOPENCM3
> +	tristate
> +	prompt "libopencm3"
> +	help
> +	  The libopencm3 project (previously known as libopenstm32) aims
> +	  to create a free/libre/open-source (LGPL v3, or later) firmware
> +	  library for various ARM Cortex-M0(+)/M3/M4 microcontrollers,
> +	  including ST STM32, Ti Tiva and Stellaris, NXP LPC 11xx, 13xx,
> +	  15xx, 17xx parts, Atmel SAM3, Energy Micro EFM32 and others.
> diff --git a/rules/libopencm3.make b/rules/libopencm3.make
> new file mode 100644
> index 0000000..8ceb1a1
> --- /dev/null
> +++ b/rules/libopencm3.make
> @@ -0,0 +1,75 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2013 by Michael Grzeschik <m.grzeschik@gmx.net>
> +#
> +# See CREDITS for details about who has contributed to this project.
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +ifdef PTXCONF_LIBOPENCM3
> +ifneq ($(shell test -h $(PTXDIST_WORKSPACE)/selected_toolchain_cm3 && echo ok),ok)
> +    $(warning *** selected_toolchain_cm3 must point to a valid cortexm3 toolchain)
> +    $(error )
> +endif
> +ifneq ($(shell test -x $(PTXDIST_WORKSPACE)/selected_toolchain_cm3/$(PTXCONF_CM3_CC) && echo ok),ok)
> +    $(warning *** $(PTXDIST_WORKSPACE)/selected_toolchain_cm3/$(PTXCONF_CM3_CC) not found)
> +    $(error )
> +endif
> +endif

I don't really like this, but I have no better idea either :-/

> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_LIBOPENCM3) += libopencm3
> +
> +#
> +# Paths and names
> +#
> +LIBOPENCM3_VERSION	:= 67b538a5
> +LIBOPENCM3_MD5		:= 7d40cc7bcd3a5e852d0b37572655b9b5
> +LIBOPENCM3		:= libopencm3-$(LIBOPENCM3_VERSION)
> +LIBOPENCM3_SUFFIX	:= tar.bz2
> +LIBOPENCM3_URL		:= https://github.com/libopencm3/libopencm3.git;tag=67b538a5
> +LIBOPENCM3_SOURCE	:= $(SRCDIR)/$(LIBOPENCM3).$(LIBOPENCM3_SUFFIX)
> +LIBOPENCM3_DIR		:= $(BUILDDIR)/$(LIBOPENCM3)
> +LIBOPENCM3_LICENSE	:= LGPLv3+
> +
> +# ----------------------------------------------------------------------------
> +# Prepare
> +# ----------------------------------------------------------------------------
> +
> +LIBOPENCM3_MAKEVARS := \
> +	PREFIX=$(PTXDIST_WORKSPACE)/selected_toolchain_cm3/$(PTXCONF_CM3_GNU_TARGET)


_MAKEVARS is deprecated. use _MAKE_OPT / _INSTALL_OPT

Also, I think you should expand PATH and then use PREFIX=$(PTXCONF_CM3_GNU_TARGET)

> +
> +# ----------------------------------------------------------------------------
> +# Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/libopencm3.install:
> +	@$(call targetinfo)
> +
> +#	# install static libraries
> +	mkdir -p $(PTXDIST_PLATFORMDIR)/sysroot-cm3/lib
> +	cp $(LIBOPENCM3_DIR)/lib/*.a \
> +		$(PTXDIST_PLATFORMDIR)/sysroot-cm3/lib/

	c$(LIBOPENCM3_DIR) && \
	for i in lib/*.a; do \
		install -D -m644 $$i $(PTXDIST_PLATFORMDIR)/sysroot-cm3/$$i; \
	done

or something like that.
 -> no need for mkdir
 -> strange umasks wont cause problems

> +
> +#	# install header files
> +	mkdir -p $(PTXDIST_PLATFORMDIR)/sysroot-cm3/include
> +	cd $(LIBOPENCM3_DIR) && \
> +	for i in `find . -name "*.h"`; do \
> +		mkdir -p $(PTXDIST_PLATFORMDIR)/sysroot-cm3/include/`dirname $$i`; \
> +		cp $$i $(PTXDIST_PLATFORMDIR)/sysroot-cm3/include/$$i; \
> +	done

same here.

> +	@$(call touch)
> +
> +# ----------------------------------------------------------------------------
> +# Target-Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/libopencm3.targetinstall:
> +	@$(call targetinfo)
> +	@$(call touch)


The default targetinstall is empty, so this can be removed.

Michael

> +
> +# vim: syntax=make
> -- 
> 2.0.0.rc2
> 
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ptxdist] [PATCH v2] bare_metal: add libopencm3 support
  2014-06-13  6:24 ` Michael Olbrich
@ 2014-06-27 19:02   ` Michael Grzeschik
  2014-08-06 20:39     ` Michael Grzeschik
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Grzeschik @ 2014-06-27 19:02 UTC (permalink / raw)
  To: ptxdist

This patch adds support for the libopencm3 for bare metal
systems. With this library it is possible to build single
applications for cortexm3 companion systems, that
needs to be deployed with the bsp.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
v1 -> v2
- fixed description from "stellaris" to "cm3"
- used LIBOPENCM3_MAKE_OPT/_INSTALL_OPT where possible
- expanded PATH for shorter PREFIX
- used install instead of cp
- removed empty targetinstall stage

 rules/bare_metal.in     |  7 +++++
 rules/bare_metal_cm3.in | 12 +++++++++
 rules/libopencm3.in     | 11 ++++++++
 rules/libopencm3.make   | 72 +++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 102 insertions(+)
 create mode 100644 rules/bare_metal_cm3.in
 create mode 100644 rules/libopencm3.in
 create mode 100644 rules/libopencm3.make

diff --git a/rules/bare_metal.in b/rules/bare_metal.in
index 1292a34..e5c15c5 100644
--- a/rules/bare_metal.in
+++ b/rules/bare_metal.in
@@ -6,3 +6,10 @@ menuconfig STELLARIS
 if STELLARIS
 source "generated/bare_metal_stellaris.in"
 endif
+
+menuconfig OPENCM3
+	bool "OpenCM3                       "
+
+if OPENCM3
+source "generated/bare_metal_cm3.in"
+endif
diff --git a/rules/bare_metal_cm3.in b/rules/bare_metal_cm3.in
new file mode 100644
index 0000000..b42c3d5
--- /dev/null
+++ b/rules/bare_metal_cm3.in
@@ -0,0 +1,12 @@
+## SECTION=bare_metal_cm3
+
+config CM3_GNU_TARGET
+	string
+	prompt "cm3 gnu target"
+	default "arm-cortexm3-eabi"
+	help
+	  configure the cm3 gnu target
+
+config CM3_CC
+	string
+	default "${PTXCONF_CM3_GNU_TARGET}-gcc"
diff --git a/rules/libopencm3.in b/rules/libopencm3.in
new file mode 100644
index 0000000..69276b7
--- /dev/null
+++ b/rules/libopencm3.in
@@ -0,0 +1,11 @@
+## SECTION=bare_metal_cm3
+
+config LIBOPENCM3
+	tristate
+	prompt "libopencm3"
+	help
+	  The libopencm3 project (previously known as libopenstm32) aims
+	  to create a free/libre/open-source (LGPL v3, or later) firmware
+	  library for various ARM Cortex-M0(+)/M3/M4 microcontrollers,
+	  including ST STM32, Ti Tiva and Stellaris, NXP LPC 11xx, 13xx,
+	  15xx, 17xx parts, Atmel SAM3, Energy Micro EFM32 and others.
diff --git a/rules/libopencm3.make b/rules/libopencm3.make
new file mode 100644
index 0000000..ed8f984
--- /dev/null
+++ b/rules/libopencm3.make
@@ -0,0 +1,72 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2013 by Michael Grzeschik <m.grzeschik@gmx.net>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+ifdef PTXCONF_LIBOPENCM3
+ifneq ($(shell test -h $(PTXDIST_WORKSPACE)/selected_toolchain_cm3 && echo ok),ok)
+    $(warning *** selected_toolchain_cm3 must point to a valid cortexm3 toolchain)
+    $(error )
+endif
+ifneq ($(shell test -x $(PTXDIST_WORKSPACE)/selected_toolchain_cm3/$(PTXCONF_CM3_CC) && echo ok),ok)
+    $(warning *** $(PTXDIST_WORKSPACE)/selected_toolchain_cm3/$(PTXCONF_CM3_CC) not found)
+    $(error )
+endif
+endif
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_LIBOPENCM3) += libopencm3
+
+#
+# Paths and names
+#
+LIBOPENCM3_VERSION	:= 67b538a5
+LIBOPENCM3_MD5		:= 7d40cc7bcd3a5e852d0b37572655b9b5
+LIBOPENCM3		:= libopencm3-$(LIBOPENCM3_VERSION)
+LIBOPENCM3_SUFFIX	:= tar.bz2
+LIBOPENCM3_URL		:= https://github.com/libopencm3/libopencm3.git;tag=67b538a5
+LIBOPENCM3_SOURCE	:= $(SRCDIR)/$(LIBOPENCM3).$(LIBOPENCM3_SUFFIX)
+LIBOPENCM3_DIR		:= $(BUILDDIR)/$(LIBOPENCM3)
+LIBOPENCM3_LICENSE	:= LGPLv3+
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+LIBOPENCM3_PATH	:= \
+	PATH=$(PATH):$(PTXDIST_WORKSPACE)/selected_toolchain_cm3
+
+LIBOPENCM3_MAKE_OPT := \
+	PREFIX=$(PTXCONF_CM3_GNU_TARGET)
+
+LIBOPENCM3_INSTALL_OPT := \
+	$(LIBOPENCM3_MAKE_OPT)
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/libopencm3.install:
+	@$(call targetinfo)
+
+#	# install static libraries
+	cd $(LIBOPENCM3_DIR) && \
+	for i in lib/*.a; do \
+		install -D -m644 $$i $(PTXDIST_PLATFORMDIR)/sysroot-cm3/$$i; \
+	done
+
+#	# install header files
+	cd $(LIBOPENCM3_DIR) && \
+	for i in `find . -name "*.h"`; do \
+		install -D -m644 $$i $(PTXDIST_PLATFORMDIR)/sysroot-cm3/$$i; \
+	done
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.0.0


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [PATCH v2] bare_metal: add libopencm3 support
  2014-06-27 19:02   ` [ptxdist] [PATCH v2] " Michael Grzeschik
@ 2014-08-06 20:39     ` Michael Grzeschik
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Grzeschik @ 2014-08-06 20:39 UTC (permalink / raw)
  To: ptxdist

Ping!

This should be mergable now. :o)

On Fri, Jun 27, 2014 at 09:02:35PM +0200, Michael Grzeschik wrote:
> This patch adds support for the libopencm3 for bare metal
> systems. With this library it is possible to build single
> applications for cortexm3 companion systems, that
> needs to be deployed with the bsp.
> 
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> ---
> v1 -> v2
> - fixed description from "stellaris" to "cm3"
> - used LIBOPENCM3_MAKE_OPT/_INSTALL_OPT where possible
> - expanded PATH for shorter PREFIX
> - used install instead of cp
> - removed empty targetinstall stage
> 
>  rules/bare_metal.in     |  7 +++++
>  rules/bare_metal_cm3.in | 12 +++++++++
>  rules/libopencm3.in     | 11 ++++++++
>  rules/libopencm3.make   | 72 +++++++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 102 insertions(+)
>  create mode 100644 rules/bare_metal_cm3.in
>  create mode 100644 rules/libopencm3.in
>  create mode 100644 rules/libopencm3.make
> 
> diff --git a/rules/bare_metal.in b/rules/bare_metal.in
> index 1292a34..e5c15c5 100644
> --- a/rules/bare_metal.in
> +++ b/rules/bare_metal.in
> @@ -6,3 +6,10 @@ menuconfig STELLARIS
>  if STELLARIS
>  source "generated/bare_metal_stellaris.in"
>  endif
> +
> +menuconfig OPENCM3
> +	bool "OpenCM3                       "
> +
> +if OPENCM3
> +source "generated/bare_metal_cm3.in"
> +endif
> diff --git a/rules/bare_metal_cm3.in b/rules/bare_metal_cm3.in
> new file mode 100644
> index 0000000..b42c3d5
> --- /dev/null
> +++ b/rules/bare_metal_cm3.in
> @@ -0,0 +1,12 @@
> +## SECTION=bare_metal_cm3
> +
> +config CM3_GNU_TARGET
> +	string
> +	prompt "cm3 gnu target"
> +	default "arm-cortexm3-eabi"
> +	help
> +	  configure the cm3 gnu target
> +
> +config CM3_CC
> +	string
> +	default "${PTXCONF_CM3_GNU_TARGET}-gcc"
> diff --git a/rules/libopencm3.in b/rules/libopencm3.in
> new file mode 100644
> index 0000000..69276b7
> --- /dev/null
> +++ b/rules/libopencm3.in
> @@ -0,0 +1,11 @@
> +## SECTION=bare_metal_cm3
> +
> +config LIBOPENCM3
> +	tristate
> +	prompt "libopencm3"
> +	help
> +	  The libopencm3 project (previously known as libopenstm32) aims
> +	  to create a free/libre/open-source (LGPL v3, or later) firmware
> +	  library for various ARM Cortex-M0(+)/M3/M4 microcontrollers,
> +	  including ST STM32, Ti Tiva and Stellaris, NXP LPC 11xx, 13xx,
> +	  15xx, 17xx parts, Atmel SAM3, Energy Micro EFM32 and others.
> diff --git a/rules/libopencm3.make b/rules/libopencm3.make
> new file mode 100644
> index 0000000..ed8f984
> --- /dev/null
> +++ b/rules/libopencm3.make
> @@ -0,0 +1,72 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2013 by Michael Grzeschik <m.grzeschik@gmx.net>
> +#
> +# See CREDITS for details about who has contributed to this project.
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +ifdef PTXCONF_LIBOPENCM3
> +ifneq ($(shell test -h $(PTXDIST_WORKSPACE)/selected_toolchain_cm3 && echo ok),ok)
> +    $(warning *** selected_toolchain_cm3 must point to a valid cortexm3 toolchain)
> +    $(error )
> +endif
> +ifneq ($(shell test -x $(PTXDIST_WORKSPACE)/selected_toolchain_cm3/$(PTXCONF_CM3_CC) && echo ok),ok)
> +    $(warning *** $(PTXDIST_WORKSPACE)/selected_toolchain_cm3/$(PTXCONF_CM3_CC) not found)
> +    $(error )
> +endif
> +endif
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_LIBOPENCM3) += libopencm3
> +
> +#
> +# Paths and names
> +#
> +LIBOPENCM3_VERSION	:= 67b538a5
> +LIBOPENCM3_MD5		:= 7d40cc7bcd3a5e852d0b37572655b9b5
> +LIBOPENCM3		:= libopencm3-$(LIBOPENCM3_VERSION)
> +LIBOPENCM3_SUFFIX	:= tar.bz2
> +LIBOPENCM3_URL		:= https://github.com/libopencm3/libopencm3.git;tag=67b538a5
> +LIBOPENCM3_SOURCE	:= $(SRCDIR)/$(LIBOPENCM3).$(LIBOPENCM3_SUFFIX)
> +LIBOPENCM3_DIR		:= $(BUILDDIR)/$(LIBOPENCM3)
> +LIBOPENCM3_LICENSE	:= LGPLv3+
> +
> +# ----------------------------------------------------------------------------
> +# Prepare
> +# ----------------------------------------------------------------------------
> +
> +LIBOPENCM3_PATH	:= \
> +	PATH=$(PATH):$(PTXDIST_WORKSPACE)/selected_toolchain_cm3
> +
> +LIBOPENCM3_MAKE_OPT := \
> +	PREFIX=$(PTXCONF_CM3_GNU_TARGET)
> +
> +LIBOPENCM3_INSTALL_OPT := \
> +	$(LIBOPENCM3_MAKE_OPT)
> +
> +# ----------------------------------------------------------------------------
> +# Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/libopencm3.install:
> +	@$(call targetinfo)
> +
> +#	# install static libraries
> +	cd $(LIBOPENCM3_DIR) && \
> +	for i in lib/*.a; do \
> +		install -D -m644 $$i $(PTXDIST_PLATFORMDIR)/sysroot-cm3/$$i; \
> +	done
> +
> +#	# install header files
> +	cd $(LIBOPENCM3_DIR) && \
> +	for i in `find . -name "*.h"`; do \
> +		install -D -m644 $$i $(PTXDIST_PLATFORMDIR)/sysroot-cm3/$$i; \
> +	done
> +	@$(call touch)
> +
> +# vim: syntax=make
> -- 
> 2.0.0
> 
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-08-06 20:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-08  0:07 [ptxdist] [PATCH] bare_metal: add libopencm3 support Michael Grzeschik
2014-06-13  6:24 ` Michael Olbrich
2014-06-27 19:02   ` [ptxdist] [PATCH v2] " Michael Grzeschik
2014-08-06 20:39     ` Michael Grzeschik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox