[conf] toolchain makefile cleanup

This commit is contained in:
Felix Ruess
2013-12-18 15:00:41 +01:00
parent 20afea552d
commit 2d5cde0a91
6 changed files with 55 additions and 73 deletions
-43
View File
@@ -1,43 +0,0 @@
# Hey Emacs, this is a -*- makefile -*-
#
# Copyright (C) 2012 Felix Ruess <felix.ruess@gmail.com>
#
# This file is part of paparazzi.
#
# paparazzi is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# paparazzi is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with paparazzi; see the file COPYING. If not, see
# <http://www.gnu.org/licenses/>.
#
#
# This is the common Makefile for finding the arm compiler and OpenOcd
#
#
# some generic and informative targets
#
printcommands:
@echo ""
@echo "Using CC = $(CC)"
# @echo "Using LD = $(LD)"
# @echo "Using CP = $(CP)"
# @echo "Using DMP = $(DMP)"
# @echo "Using NM = $(NM)"
# @echo "Using SIZE = $(SIZE)"
@echo "GCC version:"
@$(CC) --version | head -1
@echo ""
.PHONY : printcommands
@@ -4,12 +4,21 @@
#
# This is the common Makefile for finding the arm compiler and OpenOcd
# This has some common targets
# for bare metal systems like on the ARM7TDMI, cortex M3/4
# include the common ARM makefiles to print the commands and find the toolchain
include $(PAPARAZZI_SRC)/conf/Makefile.arm-common
include $(PAPARAZZI_SRC)/conf/Makefile.arm-embedded-toolchain
printcommands:
@echo ""
@echo "Using CC = $(CC)"
# @echo "Using LD = $(LD)"
# @echo "Using CP = $(CP)"
# @echo "Using DMP = $(DMP)"
# @echo "Using NM = $(NM)"
# @echo "Using SIZE = $(SIZE)"
@echo "GCC version:"
@$(CC) --version | head -1
@echo ""
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(OBJDIR)/$(TARGET).hex
@@ -46,4 +55,4 @@ clean_list :
$(RM) .dep/*
$(RM) *~
.PHONY : sizebefore sizeafter clean clean_list
.PHONY : printcommands sizebefore sizeafter clean clean_list
@@ -35,6 +35,3 @@ GDB = $(PREFIX)-gdb
# some general commands
RM = rm
include $(PAPARAZZI_SRC)/conf/Makefile.arm-common
+12 -8
View File
@@ -37,7 +37,7 @@ Q=@
#
# find compiler toolchain
#
include $(PAPARAZZI_SRC)/conf/Makefile.arm-embedded
include $(PAPARAZZI_SRC)/conf/Makefile.arm-embedded-toolchain
#
# if the new arm-none-eabi multilib compiler was not found try the old arm-elf one
@@ -68,7 +68,6 @@ ASRCARM = crt0.S
# Optimization level, can be [0, 1, 2, 3, s].
# 0 = turn off optimization. s = optimize for size.
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
OPT = s
#OPT=3
@@ -86,12 +85,15 @@ CFLAGS += -ffunction-sections -fdata-sections
CFLAGS += -finline-limit=1200 --param inline-unit-growth=100
# flags for warnings
CFLAGS += -Wall -Wextra
CFLAGS += -Wcast-qual -Wimplicit -Wcast-align
CFLAGS += -Wpointer-arith -Wswitch
CFLAGS += -Wredundant-decls -Wreturn-type -Wshadow -Wunused
CFLAGS += -Wstrict-prototypes -Wmissing-declarations
CFLAGS += -Wmissing-prototypes -Wnested-externs
CFLAGS += -Wall -Wextra -Wunused
CFLAGS += -Wcast-qual
CFLAGS += -Wcast-align
CFLAGS += -Wpointer-arith
CFLAGS += -Wswitch-default
CFLAGS += -Wredundant-decls -Wmissing-declarations
CFLAGS += -Wstrict-prototypes -Wmissing-prototypes
CFLAGS += -Wshadow
CFLAGS += -Wnested-externs
CFLAGS += $(CSTANDARD)
CFLAGS += $($(TARGET).CFLAGS) $(LOCAL_CFLAGS)
@@ -166,6 +168,8 @@ GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d
ALL_CFLAGS = -mcpu=$(MCU) $(THUMB_IW) -I. $(CFLAGS)
ALL_ASFLAGS = -mcpu=$(MCU) $(THUMB_IW) -I. -x assembler-with-cpp $(ASFLAGS)
# some common informative targets
include $(PAPARAZZI_SRC)/conf/Makefile.arm-embedded-common
# Default target.
all: printcommands sizebefore build sizeafter
+10 -2
View File
@@ -24,7 +24,7 @@
#
# find compiler toolchain
#
include $(PAPARAZZI_SRC)/conf/Makefile.arm-linux
include $(PAPARAZZI_SRC)/conf/Makefile.arm-linux-toolchain
# Define programs and commands.
@@ -69,6 +69,14 @@ OBJ_C_OMAP = $(SRC_C_OMAP:%.c=$(OBJDIR)/%.o)
SRC_CPP_OMAP = $($(TARGET).cpp_srcs)
OBJ_CPP_OMAP = $(SRC_CPP_OMAP:%.cpp=$(OBJDIR)/%.o)
printcommands:
@echo ""
@echo "Using CC = $(CC)"
# @echo "Using LD = $(LD)"
@echo "GCC version:"
@$(CC) --version | head -1
@echo ""
all: printcommands build
build: $(OBJDIR) elf
@@ -102,7 +110,7 @@ $(OBJDIR)/%.o : %.cpp $(OBJDIR)/../Makefile.ac
# Listing of phony targets.
.PHONY : all build elf clean clean_list
.PHONY : printcommands all build elf
#
# Dependencies
+19 -12
View File
@@ -34,7 +34,7 @@ Q=@
#
# find compiler toolchain
#
include $(PAPARAZZI_SRC)/conf/Makefile.arm-embedded
include $(PAPARAZZI_SRC)/conf/Makefile.arm-embedded-toolchain
ifeq ($(ARCH_L),f4)
@@ -103,7 +103,7 @@ endif
endif
CFLAGS = -I. -I./$(ARCH) -I../ext/libopencm3/include $(INCLUDES)
CFLAGS += -D__thumb2__ -Wall -O$(OPT)
CFLAGS += -D__thumb2__ -O$(OPT)
ifeq ($(ARCH_L), )
CFLAGS += -msoft-float
else ifeq ($(ARCH_L),f4)
@@ -113,24 +113,30 @@ else
CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
endif
endif
CSTANDARD = -std=gnu99
CFLAGS += -Wl,--gc-sections
CFLAGS += -mfix-cortex-m3-ldrd
CFLAGS += -mcpu=$(MCU) -mthumb -ansi
CFLAGS += -std=gnu99
CFLAGS += $(CSTANDARD)
#CFLAGS += -malignment-traps
CFLAGS += -fno-common
CFLAGS += -g$(DEBUG)
CFLAGS += -ffunction-sections -fdata-sections
CFLAGS += -Wimplicit
CFLAGS += -Wcast-align
CFLAGS += -Wpointer-arith -Wswitch
CFLAGS += -Wredundant-decls -Wreturn-type -Wshadow -Wunused
CFLAGS += -Wa,-adhlns=$(OBJDIR)/$(notdir $(subst $(suffix $<),.lst,$<))
CFLAGS += -Wnested-externs
CFLAGS += -Wmissing-prototypes
CFLAGS += -Wstrict-prototypes
CFLAGS += -Wmissing-declarations
# flags for warnings
CFLAGS += -Wall -Wextra -Wunused
#CFLAGS += -Wcast-qual
CFLAGS += -Wcast-align
CFLAGS += -Wpointer-arith
CFLAGS += -Wswitch-default
CFLAGS += -Wredundant-decls -Wmissing-declarations
CFLAGS += -Wstrict-prototypes -Wmissing-prototypes
CFLAGS += -Wshadow
CFLAGS += -Wnested-externs
ifneq ($(ARCH_L), )
ifeq ($(ARCH_L),f4)
CFLAGS += -DSTM32F4
@@ -173,7 +179,8 @@ CPFLAGS_HEX = -Oihex
ODFLAGS = -S
# some common informative targets
include $(PAPARAZZI_SRC)/conf/Makefile.arm-embedded-common
# Default target.
all: printcommands sizebefore build sizeafter