Skip to content

Commit

Permalink
Removed the optimisation flags from the libopenstm32 port build. Also…
Browse files Browse the repository at this point in the history
… removed the building of the examples as they fail to build without the optimisation -Os in the build of the library.
  • Loading branch information
rbdavison committed Jan 31, 2011
1 parent eaadd76 commit 7992e0a
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 0 deletions.
7 changes: 7 additions & 0 deletions darwin/macports/ports/cross/libopenstm32/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ description libopenstm32
long_description libopenstm32
fetch.type git
git.url git://libopenstm32.git.sourceforge.net/gitroot/libopenstm32/libopenstm32
patchfiles \
patch-Makefile.diff \
patch-examples-lpc13xx-Makefile-include.diff \
patch-examples-stm32-Makefile-include.diff \
patch-lib-lpc13cc-Makefile.diff \
patch-lib-stm32-Makefile.diff

#worksrcdir ${name}
use_configure no
Expand All @@ -19,6 +25,7 @@ depends_lib port:${targetarch}-gcc-linaro
set environment [list PATH="${prefix}/${targetarch}/bin" LDFLAGS="-L${prefix}/${targetarch}/lib"]
build.env ${environment}
build.args PREFIX=${targetarch} Q="" -w
build.target lib

# All cross ports violate the mtree layout.
destroot.violate_mtree yes
Expand Down
11 changes: 11 additions & 0 deletions darwin/macports/ports/cross/libopenstm32/files/patch-Makefile.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- Makefile.orig 2011-01-31 22:31:56.000000000 +1100
+++ Makefile 2011-01-31 22:32:20.000000000 +1100
@@ -47,7 +47,7 @@
@printf " BUILD examples/lpc13xx\n"
$(Q)$(MAKE) -C examples/lpc13xx all

-install: build
+install:
@printf " INSTALL headers\n"
$(Q)$(INSTALL) -d $(INCDIR)/libopencm3
$(Q)$(INSTALL) -d $(LIBDIR)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- examples/lpc13xx/Makefile.include.orig 2011-01-31 22:20:50.000000000 +1100
+++ examples/lpc13xx/Makefile.include 2011-01-31 22:21:02.000000000 +1100
@@ -27,7 +27,7 @@
# Uncomment this line if you want to use the installed (not local) library.
# TOOLCHAIN_DIR = `dirname \`which $(CC)\``/../$(PREFIX)
TOOLCHAIN_DIR = ../../../..
-CFLAGS += -Os -g -Wall -Wextra -I$(TOOLCHAIN_DIR)/include -fno-common \
+CFLAGS += -g -Wall -Wextra -I$(TOOLCHAIN_DIR)/include -fno-common \
-mcpu=cortex-m3 -mthumb
LDSCRIPT = $(BINARY).ld
LDFLAGS += -L$(TOOLCHAIN_DIR)/lib -L$(TOOLCHAIN_DIR)/lib/lpc13xx \
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- examples/stm32/Makefile.include.orig 2011-01-31 22:22:06.000000000 +1100
+++ examples/stm32/Makefile.include 2011-01-31 22:22:18.000000000 +1100
@@ -27,7 +27,7 @@
# Uncomment this line if you want to use the installed (not local) library.
# TOOLCHAIN_DIR = `dirname \`which $(CC)\``/../$(PREFIX)
TOOLCHAIN_DIR = ../../../..
-CFLAGS += -Os -g -Wall -Wextra -I$(TOOLCHAIN_DIR)/include \
+CFLAGS += -g -Wall -Wextra -I$(TOOLCHAIN_DIR)/include \
-fno-common -mcpu=cortex-m3 -mthumb
LDSCRIPT = $(BINARY).ld
LDFLAGS += -L$(TOOLCHAIN_DIR)/lib -L$(TOOLCHAIN_DIR)/lib/stm32 \
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- lib/lpc13xx/Makefile.orig 2011-01-31 22:11:42.000000000 +1100
+++ lib/lpc13xx/Makefile 2011-01-31 22:12:30.000000000 +1100
@@ -23,7 +23,7 @@
PREFIX ?= arm-elf
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
-CFLAGS = -Os -g -Wall -Wextra -I../../include -fno-common \
+CFLAGS = -g -Wall -Wextra -I../../include -fno-common \
-mcpu=cortex-m3 -mthumb -Wstrict-prototypes \
-ffunction-sections -fdata-sections
# ARFLAGS = rcsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- lib/stm32/Makefile.orig 2011-01-31 22:12:45.000000000 +1100
+++ lib/stm32/Makefile 2011-01-31 22:12:56.000000000 +1100
@@ -23,7 +23,7 @@
PREFIX ?= arm-elf
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
-CFLAGS = -Os -g -Wall -Wextra -I../../include -fno-common \
+CFLAGS = -g -Wall -Wextra -I../../include -fno-common \
-mcpu=cortex-m3 -mthumb -Wstrict-prototypes \
-ffunction-sections -fdata-sections
# ARFLAGS = rcsv

0 comments on commit 7992e0a

Please sign in to comment.