make: use $(PREFIX)gcc instead of $(PREFIX)-gcc

The leading - makes it rather inconsistent with the majority of other
projects around the world.  Use the form everyone else uses.
To solve this, properly pass prefix to inner makes as was always
intended.

Fixes: https://github.com/libopencm3/libopencm3/issues/1058
This commit is contained in:
Karl Palsson 2019-06-07 21:25:46 +00:00
parent 795fe21860
commit 7be50a5e75
35 changed files with 70 additions and 139 deletions

View File

@ -17,8 +17,7 @@
## along with this library. If not, see <http://www.gnu.org/licenses/>.
##
PREFIX ?= arm-none-eabi
#PREFIX ?= arm-elf
PREFIX ?= arm-none-eabi-
STYLECHECK := scripts/checkpatch.pl
STYLECHECKFLAGS := --no-tree -f --terse --mailback
@ -69,7 +68,7 @@ LIB_DIRS:=$(wildcard $(addprefix lib/,$(TARGETS)))
$(LIB_DIRS): $(IRQ_DEFN_FILES:=.genhdr)
$(Q)$(RM) .stamp_failure_$(subst /,_,$@)
@printf " BUILD $@\n";
$(Q)$(MAKE) --directory=$@ SRCLIBDIR="$(SRCLIBDIR)" || \
$(Q)$(MAKE) --directory=$@ SRCLIBDIR="$(SRCLIBDIR)" PREFIX="$(PREFIX)" || \
echo "Failure building: $@: code: $$?" > .stamp_failure_$(subst /,_,$@)
lib: $(LIB_DIRS)

View File

@ -24,10 +24,8 @@ SRCLIBDIR ?= ../..
FAMILY = EZR32WG
FP_FLAGS ?= -mfloat-abi=hard -mfpu=fpv4-sp-d16
PREFIX ?= arm-none-eabi
#PREFIX ?= arm-elf
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -22,10 +22,8 @@ LIBNAME = libopencm3_efm32g
SRCLIBDIR ?= ../..
FAMILY = EFM32G
PREFIX ?= arm-none-eabi
#PREFIX ?= arm-elf
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -22,10 +22,8 @@ LIBNAME = libopencm3_efm32gg
SRCLIBDIR ?= ../..
FAMILY = EFM32GG
PREFIX ?= arm-none-eabi
#PREFIX ?= arm-elf
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -24,10 +24,8 @@ LIBNAME = libopencm3_efm32hg
SRCLIBDIR ?= ../..
FAMILY = EFM32HG
PREFIX ?= arm-none-eabi
#PREFIX ?= arm-elf
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -23,10 +23,8 @@ LIBNAME = libopencm3_efm32lg
SRCLIBDIR ?= ../..
FAMILY = EFM32LG
PREFIX ?= arm-none-eabi
#PREFIX ?= arm-elf
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -22,10 +22,8 @@ LIBNAME = libopencm3_efm32tg
SRCLIBDIR ?= ../..
FAMILY = EFM32TG
PREFIX ?= arm-none-eabi
#PREFIX ?= arm-elf
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -24,10 +24,8 @@ SRCLIBDIR ?= ../..
FAMILY = EFM32WG
FP_FLAGS ?= -mfloat-abi=hard -mfpu=fpv4-sp-d16
PREFIX ?= arm-none-eabi
#PREFIX ?= arm-elf
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -20,10 +20,8 @@
LIBNAME = libopencm3_gd32f1x0
SRCLIBDIR ?= ../..
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -20,10 +20,8 @@
LIBNAME = libopencm3_lm3s
SRCLIBDIR ?= ..
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -22,10 +22,8 @@ LIBNAME = libopencm3_lm4f
SRCLIBDIR ?= ..
FP_FLAGS ?= -mfloat-abi=hard -mfpu=fpv4-sp-d16
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -20,10 +20,8 @@
LIBNAME = libopencm3_lpc13xx
SRCLIBDIR ?= ..
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -20,10 +20,8 @@
LIBNAME = libopencm3_lpc17xx
SRCLIBDIR ?= ..
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -22,10 +22,8 @@
LIBNAME = libopencm3_lpc43xx_m0
SRCLIBDIR ?= ../..
PREFIX ?= arm-none-eabi
#PREFIX ?= arm-elf
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -O2 -Wall -Wextra -I../../../include -fno-common \
-mcpu=cortex-m0 -mthumb -Wstrict-prototypes \
-ffunction-sections -fdata-sections -MD -DLPC43XX -DLPC43XX_M0

View File

@ -24,10 +24,8 @@ LIBNAME = libopencm3_lpc43xx
SRCLIBDIR ?= ../..
FP_FLAGS ?= -mfloat-abi=hard -mfpu=fpv4-sp-d16
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -O2 \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -23,10 +23,8 @@ LIBNAME = libopencm3_msp432e4
SRCLIBDIR ?= ../..
FP_FLAGS ?= -mfloat-abi=hard -mfpu=fpv4-sp-d16
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -20,10 +20,8 @@
LIBNAME = libopencm3_sam3a
SRCLIBDIR ?= ../..
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os -Wall -Wextra -I../../../include -fno-common \
-mcpu=cortex-m3 -mthumb $(FP_FLAGS) -Wstrict-prototypes \
-ffunction-sections -fdata-sections -MD -DSAM3A

View File

@ -20,10 +20,8 @@
LIBNAME = libopencm3_sam3n
SRCLIBDIR ?= ../..
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os -Wall -Wextra -I../../../include -fno-common \
-mcpu=cortex-m3 -mthumb $(FP_FLAGS) -Wstrict-prototypes \
-ffunction-sections -fdata-sections -MD -DSAM3N

View File

@ -21,10 +21,8 @@
LIBNAME = libopencm3_sam3s
SRCLIBDIR ?= ../..
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os -Wall -Wextra -I../../../include -fno-common \
-mcpu=cortex-m3 -mthumb $(FP_FLAGS) -Wstrict-prototypes \
-ffunction-sections -fdata-sections -MD -DSAM3S

View File

@ -21,10 +21,8 @@
LIBNAME = libopencm3_sam3u
SRCLIBDIR ?= ../..
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os -Wall -Wextra -I../../../include -fno-common \
-mcpu=cortex-m3 -mthumb $(FP_FLAGS) -Wstrict-prototypes \
-ffunction-sections -fdata-sections -MD -DSAM3U

View File

@ -20,10 +20,8 @@
LIBNAME = libopencm3_sam3x
SRCLIBDIR ?= ../..
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os -Wall -Wextra -I../../../include -fno-common \
-mcpu=cortex-m3 -mthumb $(FP_FLAGS) -Wstrict-prototypes \
-ffunction-sections -fdata-sections -MD -DSAM3X

View File

@ -18,11 +18,9 @@
LIBNAME = libopencm3_sam4l
SRCLIBDIR ?= ../..
PREFIX ?= arm-none-eabi
FP_FLAGS ?= -msoft-float
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os -Wall -Wextra -I../../../include -fno-common \
-mcpu=cortex-m4 -mthumb $(FP_FLAGS) -Wstrict-prototypes \
-ffunction-sections -fdata-sections -MD -DSAM4L

View File

@ -20,10 +20,8 @@
LIBNAME = libopencm3_samd
SRCLIBDIR ?= ../..
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os -Wall -Wextra -I../../../include -fno-common \
-mcpu=cortex-m0plus -mthumb $(FP_FLAGS) -Wstrict-prototypes \
-ffunction-sections -fdata-sections -MD -DSAMD

View File

@ -20,10 +20,8 @@
LIBNAME = libopencm3_stm32f0
SRCLIBDIR ?= ../..
PREFIX ?= arm-none-eabi
#PREFIX ?= arm-elf
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -20,10 +20,8 @@
LIBNAME = libopencm3_stm32f1
SRCLIBDIR ?= ../..
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -20,10 +20,8 @@
LIBNAME = libopencm3_stm32f2
SRCLIBDIR ?= ../..
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -21,10 +21,8 @@ LIBNAME = libopencm3_stm32f3
SRCLIBDIR ?= ../..
FP_FLAGS ?= -mfloat-abi=hard -mfpu=fpv4-sp-d16
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -22,10 +22,8 @@ LIBNAME = libopencm3_stm32f4
SRCLIBDIR ?= ../..
FP_FLAGS ?= -mfloat-abi=hard -mfpu=fpv4-sp-d16
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -21,10 +21,8 @@
LIBNAME = libopencm3_stm32f7
SRCLIBDIR ?= ../..
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
# STM32F7 only supports single precision FPU
FP_FLAGS ?= -mfloat-abi=hard -mfpu=fpv5-sp-d16

View File

@ -20,10 +20,8 @@
LIBNAME = libopencm3_stm32g0
SRCLIBDIR ?= ../..
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -20,10 +20,8 @@
LIBNAME = libopencm3_stm32l0
SRCLIBDIR ?= ../..
PREFIX ?= arm-none-eabi
#PREFIX ?= arm-elf
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -20,10 +20,8 @@
LIBNAME = libopencm3_stm32l1
SRCLIBDIR ?= ../..
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -21,10 +21,8 @@ LIBNAME = libopencm3_stm32l4
SRCLIBDIR ?= ../..
FP_FLAGS ?= -mfloat-abi=hard -mfpu=fpv4-sp-d16
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -20,10 +20,8 @@
LIBNAME = libopencm3_swm050
SRCLIBDIR ?= ..
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \

View File

@ -22,10 +22,8 @@ LIBNAME = libopencm3_vf6xx
SRCLIBDIR ?= ..
FP_FLAGS ?= -mfloat-abi=hard -mfpu=fpv4-sp-d16
PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
TGT_CFLAGS = -Os \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \