Update to makefiles to support ChibiOS v3, making ARM thumb targets, CPU specific flags etc
Also put license in the gmake master scripts.
This commit is contained in:
parent
5d3ab261c0
commit
2151935b3a
17 changed files with 377 additions and 545 deletions
|
@ -13,6 +13,8 @@
|
||||||
OPT_LINK_OPTIMIZE = yes
|
OPT_LINK_OPTIMIZE = yes
|
||||||
OPT_NONSTANDARD_FLAGS = no
|
OPT_NONSTANDARD_FLAGS = no
|
||||||
OPT_OS = linux
|
OPT_OS = linux
|
||||||
|
# Change this next setting (or add the explicit compiler flags) if you are not compiling for x86 linux
|
||||||
|
OPT_CPU = x86
|
||||||
|
|
||||||
# uGFX settings
|
# uGFX settings
|
||||||
# See $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk for the list of variables
|
# See $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk for the list of variables
|
||||||
|
@ -30,13 +32,13 @@
|
||||||
|
|
||||||
ARCH =
|
ARCH =
|
||||||
SRCFLAGS = -ggdb -O0
|
SRCFLAGS = -ggdb -O0
|
||||||
SRCFLAGS+= -m32
|
|
||||||
CFLAGS =
|
CFLAGS =
|
||||||
CXXFLAGS =
|
CXXFLAGS =
|
||||||
ASFLAGS =
|
ASFLAGS =
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
|
|
||||||
SRC =
|
SRC =
|
||||||
|
OBJS =
|
||||||
DEFS =
|
DEFS =
|
||||||
LIBS =
|
LIBS =
|
||||||
INCPATH =
|
INCPATH =
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
OPT_LINK_OPTIMIZE = yes
|
OPT_LINK_OPTIMIZE = yes
|
||||||
OPT_NONSTANDARD_FLAGS = no
|
OPT_NONSTANDARD_FLAGS = no
|
||||||
OPT_OS = linux
|
OPT_OS = linux
|
||||||
|
# Change this next setting (or add the explicit compiler flags) if you are not compiling for x86 linux
|
||||||
|
OPT_CPU = x86
|
||||||
|
|
||||||
# uGFX settings
|
# uGFX settings
|
||||||
# See $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk for the list of variables
|
# See $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk for the list of variables
|
||||||
|
@ -30,13 +32,13 @@
|
||||||
|
|
||||||
ARCH =
|
ARCH =
|
||||||
SRCFLAGS = -ggdb -O0
|
SRCFLAGS = -ggdb -O0
|
||||||
SRCFLAGS+= -m32
|
|
||||||
CFLAGS =
|
CFLAGS =
|
||||||
CXXFLAGS =
|
CXXFLAGS =
|
||||||
ASFLAGS =
|
ASFLAGS =
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
|
|
||||||
SRC =
|
SRC =
|
||||||
|
OBJS =
|
||||||
DEFS =
|
DEFS =
|
||||||
LIBS =
|
LIBS =
|
||||||
INCPATH =
|
INCPATH =
|
||||||
|
|
|
@ -1,236 +1,66 @@
|
||||||
##############################################################################
|
# Possible Targets: all clean Debug cleanDebug Release cleanRelease
|
||||||
# Build global options
|
|
||||||
# NOTE: Can be overridden externally.
|
##############################################################################################
|
||||||
|
# Settings
|
||||||
#
|
#
|
||||||
|
|
||||||
# Compiler options here.
|
# General settings
|
||||||
ifeq ($(USE_OPT),)
|
# See $(GFXLIB)/tools/gmake_scripts/readme.txt for the list of variables
|
||||||
# Replace -O0 with -O2 for a production build. -O2 just messes with the debugger.
|
OPT_VERBOSE_COMPILE = no
|
||||||
USE_OPT = -O0 -g -fomit-frame-pointer -falign-functions=16
|
OPT_GENERATE_LISTINGS = yes
|
||||||
|
OPT_GENERATE_MAP = yes
|
||||||
|
OPT_COPY_EXE = no
|
||||||
|
OPT_LINK_OPTIMIZE = yes
|
||||||
|
OPT_NONSTANDARD_FLAGS = no
|
||||||
|
OPT_NATIVEOS = chibios
|
||||||
|
OPT_OS = chibios
|
||||||
|
OPT_THUMB = yes
|
||||||
|
OPT_CPU = stm32m4
|
||||||
|
|
||||||
|
# uGFX settings
|
||||||
|
# See $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk for the list of variables
|
||||||
|
GFXLIB = ../uGFX
|
||||||
|
GFXBOARD = Mikromedia-STM32-M4-ILI9341
|
||||||
|
#GFXDRIVERS = multiple/uGFXnet
|
||||||
|
GFXDEMO = modules/gdisp/basics
|
||||||
|
|
||||||
|
# ChibiOS settings
|
||||||
|
ifeq ($(OPT_OS),chibios)
|
||||||
|
# See $(GFXLIB)/tools/gmake_scripts/os_chibios.mk for the list of variables
|
||||||
|
CHIBIOS = ../ChibiOS
|
||||||
|
CHIBIOS_BOARD =
|
||||||
|
CHIBIOS_PLATFORM = STM32F4xx
|
||||||
|
CHIBIOS_PORT = GCC/ARMCMx/STM32F4xx
|
||||||
|
CHIBIOS_DEFS =
|
||||||
|
CHIBIOS_LDSCRIPT = STM32F407xG.ld
|
||||||
|
# We define a non standard board script as this is not a standard ChibiOS supported board
|
||||||
|
include $(GFXLIB)/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/board.mk
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# C specific options here (added to USE_OPT).
|
##############################################################################################
|
||||||
ifeq ($(USE_COPT),)
|
# Set these for your project
|
||||||
USE_COPT =
|
|
||||||
endif
|
|
||||||
|
|
||||||
# C++ specific options here (added to USE_OPT).
|
|
||||||
ifeq ($(USE_CPPOPT),)
|
|
||||||
USE_CPPOPT = -fno-rtti
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Enable this if you want the linker to remove unused code and data
|
|
||||||
ifeq ($(USE_LINK_GC),)
|
|
||||||
USE_LINK_GC = yes
|
|
||||||
endif
|
|
||||||
|
|
||||||
# If enabled, this option allows to compile the application in THUMB mode.
|
|
||||||
ifeq ($(USE_THUMB),)
|
|
||||||
USE_THUMB = yes
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Enable this if you want to see the full log while compiling.
|
|
||||||
ifeq ($(USE_VERBOSE_COMPILE),)
|
|
||||||
USE_VERBOSE_COMPILE = no
|
|
||||||
endif
|
|
||||||
|
|
||||||
#
|
|
||||||
# Build global options
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# Architecture or project specific options
|
|
||||||
#
|
#
|
||||||
|
|
||||||
# Enables the use of FPU on Cortex-M4.
|
ARCH = arm-none-eabi-
|
||||||
# Enable this if you really want to use the STM FWLib.
|
SRCFLAGS = -ggdb -O0
|
||||||
ifeq ($(USE_FPU),)
|
CFLAGS =
|
||||||
USE_FPU = no
|
CXXFLAGS = -fno-rtti
|
||||||
endif
|
ASFLAGS =
|
||||||
|
LDFLAGS =
|
||||||
|
|
||||||
# Enable this if you really want to use the STM FWLib.
|
SRC =
|
||||||
ifeq ($(USE_FWLIB),)
|
OBJS =
|
||||||
USE_FWLIB = no
|
DEFS =
|
||||||
endif
|
LIBS =
|
||||||
|
INCPATH =
|
||||||
|
LIBPATH =
|
||||||
|
LDSCRIPT =
|
||||||
|
|
||||||
#
|
##############################################################################################
|
||||||
# Architecture or project specific options
|
# These should be at the end
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# Project, sources and paths
|
|
||||||
#
|
#
|
||||||
|
|
||||||
SW = ..
|
include $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk
|
||||||
|
include $(GFXLIB)/tools/gmake_scripts/os_$(OPT_OS).mk
|
||||||
# Define project name here
|
include $(GFXLIB)/tools/gmake_scripts/compiler_gcc.mk
|
||||||
PROJECT = ch
|
# *** EOF ***
|
||||||
|
|
||||||
# Imported source files and paths
|
|
||||||
CHIBIOS = ../ChibiOS
|
|
||||||
#include $(CHIBIOS)/boards/MIKROMEDIA_STM32_M4/board.mk # Not a standard ChibiOS supported board
|
|
||||||
include $(CHIBIOS)/os/hal/platforms/STM32F4xx/platform.mk
|
|
||||||
include $(CHIBIOS)/os/hal/hal.mk
|
|
||||||
include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32F4xx/port.mk
|
|
||||||
include $(CHIBIOS)/os/kernel/kernel.mk
|
|
||||||
LDSCRIPT= $(PORTLD)/STM32F407xG.ld
|
|
||||||
|
|
||||||
# Imported source files and paths for uGFX
|
|
||||||
GFXLIB = ../ugfx
|
|
||||||
include $(GFXLIB)/boards/base/Mikromedia-STM32-M4-ILI9341/board.mk
|
|
||||||
include $(GFXLIB)/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/board.mk # The replacement ChibiOS board files
|
|
||||||
include $(GFXLIB)/gfx.mk
|
|
||||||
|
|
||||||
# Where is our source code - alter these for your project.
|
|
||||||
# Either just include the demo makefile or add your own definitions
|
|
||||||
include $(GFXLIB)/demos/modules/gdisp/basics/demo.mk
|
|
||||||
#MYFILES = my-project-directory
|
|
||||||
#MYCSRC = $(MYFILES)/main.c
|
|
||||||
#MYDEFS =
|
|
||||||
|
|
||||||
# C sources that can be compiled in ARM or THUMB mode depending on the global
|
|
||||||
# setting.
|
|
||||||
CSRC = $(PORTSRC) \
|
|
||||||
$(KERNSRC) \
|
|
||||||
$(TESTSRC) \
|
|
||||||
$(HALSRC) \
|
|
||||||
$(PLATFORMSRC) \
|
|
||||||
$(BOARDSRC) \
|
|
||||||
$(GFXSRC) \
|
|
||||||
$(MYCSRC)
|
|
||||||
|
|
||||||
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
|
|
||||||
# setting.
|
|
||||||
CPPSRC =
|
|
||||||
|
|
||||||
# C sources to be compiled in ARM mode regardless of the global setting.
|
|
||||||
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
|
|
||||||
# option that results in lower performance and larger code size.
|
|
||||||
ACSRC =
|
|
||||||
|
|
||||||
# C++ sources to be compiled in ARM mode regardless of the global setting.
|
|
||||||
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
|
|
||||||
# option that results in lower performance and larger code size.
|
|
||||||
ACPPSRC =
|
|
||||||
|
|
||||||
# C sources to be compiled in THUMB mode regardless of the global setting.
|
|
||||||
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
|
|
||||||
# option that results in lower performance and larger code size.
|
|
||||||
TCSRC =
|
|
||||||
|
|
||||||
# C sources to be compiled in THUMB mode regardless of the global setting.
|
|
||||||
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
|
|
||||||
# option that results in lower performance and larger code size.
|
|
||||||
TCPPSRC =
|
|
||||||
|
|
||||||
# List ASM source files here
|
|
||||||
ASMSRC = $(PORTASM)
|
|
||||||
|
|
||||||
INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
|
|
||||||
$(HALINC) $(PLATFORMINC) $(BOARDINC) \
|
|
||||||
$(GFXINC) \
|
|
||||||
$(MYFILES)
|
|
||||||
|
|
||||||
#
|
|
||||||
# Project, sources and paths
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# Compiler settings
|
|
||||||
#
|
|
||||||
|
|
||||||
MCU = cortex-m4
|
|
||||||
|
|
||||||
#TRGT = arm-elf-
|
|
||||||
TRGT = arm-none-eabi-
|
|
||||||
CC = $(TRGT)gcc
|
|
||||||
CPPC = $(TRGT)g++
|
|
||||||
# Enable loading with g++ only if you need C++ runtime support.
|
|
||||||
# NOTE: You can use C++ even without C++ support if you are careful. C++
|
|
||||||
# runtime support makes code size explode.
|
|
||||||
LD = $(TRGT)gcc
|
|
||||||
#LD = $(TRGT)g++
|
|
||||||
CP = $(TRGT)objcopy
|
|
||||||
AS = $(TRGT)gcc -x assembler-with-cpp
|
|
||||||
OD = $(TRGT)objdump
|
|
||||||
SZ = $(TRGT)size
|
|
||||||
HEX = $(CP) -O ihex
|
|
||||||
BIN = $(CP) -O binary
|
|
||||||
|
|
||||||
# ARM-specific options here
|
|
||||||
AOPT =
|
|
||||||
|
|
||||||
# THUMB-specific options here
|
|
||||||
TOPT = -mthumb -DTHUMB
|
|
||||||
|
|
||||||
# Define C warning options here
|
|
||||||
CWARN = -Wall -Wextra -Wstrict-prototypes
|
|
||||||
|
|
||||||
# Define C++ warning options here
|
|
||||||
CPPWARN = -Wall -Wextra
|
|
||||||
|
|
||||||
#
|
|
||||||
# Compiler settings
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# Start of default section
|
|
||||||
#
|
|
||||||
|
|
||||||
# List all default C defines here, like -D_DEBUG=1
|
|
||||||
DDEFS = $(GFXDEFS)
|
|
||||||
|
|
||||||
# List all default ASM defines here, like -D_DEBUG=1
|
|
||||||
DADEFS =
|
|
||||||
|
|
||||||
# List all default directories to look for include files here
|
|
||||||
DINCDIR =
|
|
||||||
|
|
||||||
# List the default directory to look for the libraries here
|
|
||||||
DLIBDIR =
|
|
||||||
|
|
||||||
# List all default libraries here
|
|
||||||
DLIBS =
|
|
||||||
|
|
||||||
#
|
|
||||||
# End of default section
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# Start of user section
|
|
||||||
#
|
|
||||||
|
|
||||||
# List all user C define here, like -D_DEBUG=1
|
|
||||||
UDEFS =
|
|
||||||
|
|
||||||
# Define ASM defines here
|
|
||||||
UADEFS =
|
|
||||||
|
|
||||||
# List all user directories here
|
|
||||||
UINCDIR =
|
|
||||||
|
|
||||||
# List the user directory to look for the libraries here
|
|
||||||
ULIBDIR =
|
|
||||||
|
|
||||||
# List all user libraries here
|
|
||||||
ULIBS =
|
|
||||||
|
|
||||||
#
|
|
||||||
# End of user defines
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
ifeq ($(USE_FPU),yes)
|
|
||||||
USE_OPT += -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -fsingle-precision-constant
|
|
||||||
DDEFS += -DCORTEX_USE_FPU=TRUE
|
|
||||||
else
|
|
||||||
DDEFS += -DCORTEX_USE_FPU=FALSE
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(USE_FWLIB),yes)
|
|
||||||
include $(CHIBIOS)/ext/stm32lib/stm32lib.mk
|
|
||||||
CSRC += $(STM32SRC)
|
|
||||||
INCDIR += $(STM32INC)
|
|
||||||
USE_OPT += -DUSE_STDPERIPH_DRIVER
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(CHIBIOS)/os/ports/GCC/ARMCMx/rules.mk
|
|
||||||
|
|
|
@ -1,53 +1,71 @@
|
||||||
##############################################################################
|
# Possible Targets: all clean Debug cleanDebug Release cleanRelease
|
||||||
# Build global options
|
|
||||||
# NOTE: Can be overridden externally.
|
##############################################################################################
|
||||||
|
# Settings
|
||||||
#
|
#
|
||||||
|
|
||||||
# Compiler options here.
|
# General settings
|
||||||
ifeq ($(USE_OPT),)
|
# See $(GFXLIB)/tools/gmake_scripts/readme.txt for the list of variables
|
||||||
# Replace -O0 with -O2 for a production build. -O2 just messes with the debugger.
|
OPT_VERBOSE_COMPILE = no
|
||||||
USE_OPT = -O0 -g -fomit-frame-pointer -falign-functions=16
|
OPT_GENERATE_LISTINGS = yes
|
||||||
|
OPT_GENERATE_MAP = yes
|
||||||
|
OPT_COPY_EXE = no
|
||||||
|
OPT_LINK_OPTIMIZE = yes
|
||||||
|
OPT_NONSTANDARD_FLAGS = no
|
||||||
|
OPT_NATIVEOS = chibios
|
||||||
|
OPT_OS = chibios
|
||||||
|
OPT_THUMB = yes
|
||||||
|
OPT_CPU = stm32m4
|
||||||
|
|
||||||
|
# uGFX settings
|
||||||
|
# See $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk for the list of variables
|
||||||
|
GFXLIB = ../uGFX
|
||||||
|
GFXBOARD = Mikromedia-STM32-M4-ILI9341
|
||||||
|
#GFXDRIVERS = multiple/uGFXnet
|
||||||
|
GFXDEMO = modules/gdisp/basics
|
||||||
|
|
||||||
|
# ChibiOS settings
|
||||||
|
ifeq ($(OPT_OS),chibios)
|
||||||
|
# See $(GFXLIB)/tools/gmake_scripts/os_chibios.mk for the list of variables
|
||||||
|
CHIBIOS = ../ChibiOS
|
||||||
|
CHBIOS_VERSION = 3
|
||||||
|
CHIBIOS_BOARD =
|
||||||
|
CHIBIOS_PLATFORM = STM32/STM32F4xx
|
||||||
|
CHIBIOS_PORT = ARMCMx/compilers/GCC/mk/port_stm32f4xx
|
||||||
|
CHIBIOS_DEFS =
|
||||||
|
CHIBIOS_LDSCRIPT = STM32F407xG.ld
|
||||||
|
# We define a non standard board script as this is not a standard ChibiOS supported board
|
||||||
|
include $(GFXLIB)/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/board.mk
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# C specific options here (added to USE_OPT).
|
##############################################################################################
|
||||||
ifeq ($(USE_COPT),)
|
# Set these for your project
|
||||||
USE_COPT =
|
|
||||||
endif
|
|
||||||
|
|
||||||
# C++ specific options here (added to USE_OPT).
|
|
||||||
ifeq ($(USE_CPPOPT),)
|
|
||||||
USE_CPPOPT = -fno-rtti
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Enable this if you want the linker to remove unused code and data
|
|
||||||
ifeq ($(USE_LINK_GC),)
|
|
||||||
USE_LINK_GC = yes
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Linker extra options here.
|
|
||||||
ifeq ($(USE_LDOPT),)
|
|
||||||
USE_LDOPT =
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Enable this if you want link time optimizations (LTO)
|
|
||||||
ifeq ($(USE_LTO),)
|
|
||||||
### disable as can cause segfault
|
|
||||||
USE_LTO = no
|
|
||||||
endif
|
|
||||||
|
|
||||||
# If enabled, this option allows to compile the application in THUMB mode.
|
|
||||||
ifeq ($(USE_THUMB),)
|
|
||||||
USE_THUMB = yes
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Enable this if you want to see the full log while compiling.
|
|
||||||
ifeq ($(USE_VERBOSE_COMPILE),)
|
|
||||||
USE_VERBOSE_COMPILE = no
|
|
||||||
endif
|
|
||||||
#
|
#
|
||||||
# Build global options
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
|
ARCH = arm-none-eabi-
|
||||||
|
SRCFLAGS = -ggdb -O0
|
||||||
|
CFLAGS =
|
||||||
|
CXXFLAGS = -fno-rtti
|
||||||
|
ASFLAGS =
|
||||||
|
LDFLAGS =
|
||||||
|
|
||||||
|
SRC =
|
||||||
|
OBJS =
|
||||||
|
DEFS =
|
||||||
|
LIBS =
|
||||||
|
INCPATH =
|
||||||
|
LIBPATH =
|
||||||
|
LDSCRIPT =
|
||||||
|
|
||||||
|
##############################################################################################
|
||||||
|
# These should be at the end
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk
|
||||||
|
include $(GFXLIB)/tools/gmake_scripts/os_$(OPT_OS).mk
|
||||||
|
include $(GFXLIB)/tools/gmake_scripts/compiler_gcc.mk
|
||||||
|
# *** EOF ***
|
||||||
|
##############################################################################
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Architecture or project specific options
|
# Architecture or project specific options
|
||||||
#
|
#
|
||||||
|
@ -64,178 +82,5 @@ ifeq ($(USE_EXCEPTIONS_STACKSIZE),)
|
||||||
USE_EXCEPTIONS_STACKSIZE = 0x400
|
USE_EXCEPTIONS_STACKSIZE = 0x400
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Enables the use of FPU on Cortex-M4 (no, softfp, hard).
|
|
||||||
ifeq ($(USE_FPU),)
|
|
||||||
USE_FPU = no
|
|
||||||
endif
|
|
||||||
|
|
||||||
#
|
|
||||||
# Architecture or project specific options
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# Project, sources and paths
|
|
||||||
#
|
|
||||||
|
|
||||||
SW = ..
|
|
||||||
|
|
||||||
# Define project name here
|
|
||||||
PROJECT = ch
|
|
||||||
|
|
||||||
# Imported source files and paths
|
|
||||||
CHIBIOS = ../ChibiOS
|
|
||||||
#include $(CHIBIOS)/boards/MIKROMEDIA_STM32_M4/board.mk # Not a standard ChibiOS supported board
|
|
||||||
include $(CHIBIOS)/os/hal/hal.mk
|
|
||||||
include $(CHIBIOS)/os/hal/ports/STM32/STM32F4xx/platform.mk
|
|
||||||
include $(CHIBIOS)/os/hal/osal/rt/osal.mk
|
|
||||||
include $(CHIBIOS)/os/rt/rt.mk
|
|
||||||
include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_stm32f4xx.mk
|
|
||||||
LDSCRIPT= $(PORTLD)/STM32F407xG.ld
|
|
||||||
|
|
||||||
# Imported source files and paths for uGFX
|
|
||||||
GFXLIB = ../ugfx
|
|
||||||
include $(GFXLIB)/boards/base/Mikromedia-STM32-M4-ILI9341/board.mk
|
|
||||||
include $(GFXLIB)/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/board.mk # The replacement ChibiOS board files
|
|
||||||
include $(GFXLIB)/gfx.mk
|
|
||||||
|
|
||||||
# Where is our source code - alter these for your project.
|
|
||||||
# Either just include the demo makefile or add your own definitions
|
|
||||||
include $(GFXLIB)/demos/modules/gdisp/basics/demo.mk
|
|
||||||
#MYFILES = my-project-directory
|
|
||||||
#MYCSRC = $(MYFILES)/main.c
|
|
||||||
#MYDEFS =
|
|
||||||
|
|
||||||
# C sources that can be compiled in ARM or THUMB mode depending on the global
|
|
||||||
# setting.
|
|
||||||
CSRC = $(PORTSRC) \
|
|
||||||
$(KERNSRC) \
|
|
||||||
$(TESTSRC) \
|
|
||||||
$(HALSRC) \
|
|
||||||
$(PLATFORMSRC) \
|
|
||||||
$(BOARDSRC) \
|
|
||||||
$(GFXSRC) \
|
|
||||||
$(MYCSRC)
|
|
||||||
|
|
||||||
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
|
|
||||||
# setting.
|
|
||||||
CPPSRC =
|
|
||||||
|
|
||||||
# C sources to be compiled in ARM mode regardless of the global setting.
|
|
||||||
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
|
|
||||||
# option that results in lower performance and larger code size.
|
|
||||||
ACSRC =
|
|
||||||
|
|
||||||
# C++ sources to be compiled in ARM mode regardless of the global setting.
|
|
||||||
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
|
|
||||||
# option that results in lower performance and larger code size.
|
|
||||||
ACPPSRC =
|
|
||||||
|
|
||||||
# C sources to be compiled in THUMB mode regardless of the global setting.
|
|
||||||
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
|
|
||||||
# option that results in lower performance and larger code size.
|
|
||||||
TCSRC =
|
|
||||||
|
|
||||||
# C sources to be compiled in THUMB mode regardless of the global setting.
|
|
||||||
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
|
|
||||||
# option that results in lower performance and larger code size.
|
|
||||||
TCPPSRC =
|
|
||||||
|
|
||||||
# List ASM source files here
|
|
||||||
ASMSRC = $(PORTASM)
|
|
||||||
|
|
||||||
INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
|
|
||||||
$(HALINC) $(OSALINC) $(PLATFORMINC) $(BOARDINC) \
|
|
||||||
$(GFXINC) \
|
|
||||||
$(MYFILES)
|
|
||||||
|
|
||||||
#
|
|
||||||
# Project, sources and paths
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# Compiler settings
|
|
||||||
#
|
|
||||||
|
|
||||||
MCU = cortex-m4
|
|
||||||
|
|
||||||
#TRGT = arm-elf-
|
|
||||||
TRGT = arm-none-eabi-
|
|
||||||
CC = $(TRGT)gcc
|
|
||||||
CPPC = $(TRGT)g++
|
|
||||||
# Enable loading with g++ only if you need C++ runtime support.
|
|
||||||
# NOTE: You can use C++ even without C++ support if you are careful. C++
|
|
||||||
# runtime support makes code size explode.
|
|
||||||
LD = $(TRGT)gcc
|
|
||||||
#LD = $(TRGT)g++
|
|
||||||
CP = $(TRGT)objcopy
|
|
||||||
AS = $(TRGT)gcc -x assembler-with-cpp
|
|
||||||
OD = $(TRGT)objdump
|
|
||||||
SZ = $(TRGT)size
|
|
||||||
HEX = $(CP) -O ihex
|
|
||||||
BIN = $(CP) -O binary
|
|
||||||
|
|
||||||
# ARM-specific options here
|
|
||||||
AOPT =
|
|
||||||
|
|
||||||
# THUMB-specific options here
|
|
||||||
TOPT = -mthumb -DTHUMB
|
|
||||||
|
|
||||||
# Define C warning options here
|
|
||||||
CWARN = -Wall -Wextra -Wstrict-prototypes
|
|
||||||
|
|
||||||
# Define C++ warning options here
|
|
||||||
CPPWARN = -Wall -Wextra
|
|
||||||
|
|
||||||
#
|
|
||||||
# Compiler settings
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# Start of default section
|
|
||||||
#
|
|
||||||
|
|
||||||
# List all default C defines here, like -D_DEBUG=1
|
|
||||||
DDEFS = $(GFXDEFS)
|
|
||||||
|
|
||||||
# List all default ASM defines here, like -D_DEBUG=1
|
|
||||||
DADEFS =
|
|
||||||
|
|
||||||
# List all default directories to look for include files here
|
|
||||||
DINCDIR =
|
|
||||||
|
|
||||||
# List the default directory to look for the libraries here
|
|
||||||
DLIBDIR =
|
|
||||||
|
|
||||||
# List all default libraries here
|
|
||||||
DLIBS =
|
|
||||||
|
|
||||||
#
|
|
||||||
# End of default section
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# Start of user section
|
|
||||||
#
|
|
||||||
|
|
||||||
# List all user C define here, like -D_DEBUG=1
|
|
||||||
UDEFS =
|
|
||||||
|
|
||||||
# Define ASM defines here
|
|
||||||
UADEFS =
|
|
||||||
|
|
||||||
# List all user directories here
|
|
||||||
UINCDIR =
|
|
||||||
|
|
||||||
# List the user directory to look for the libraries here
|
|
||||||
ULIBDIR =
|
|
||||||
|
|
||||||
# List all user libraries here
|
|
||||||
ULIBS =
|
|
||||||
|
|
||||||
#
|
|
||||||
# End of user defines
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
|
|
||||||
RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC
|
RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC
|
||||||
include $(RULESPATH)/rules.mk
|
include $(RULESPATH)/rules.mk
|
|
@ -24,7 +24,7 @@
|
||||||
# OSX settings
|
# OSX settings
|
||||||
# See $(GFXLIB)/tools/gmake_scripts/os_osx.mk for the list of variables
|
# See $(GFXLIB)/tools/gmake_scripts/os_osx.mk for the list of variables
|
||||||
OSX_SDK = /Developer/SDKs/MacOSX10.7.sdk
|
OSX_SDK = /Developer/SDKs/MacOSX10.7.sdk
|
||||||
OSX_ARCH = -mmacosx-version-min=10.3 -arch i386
|
OSX_ARCH = -mmacosx-version-min=10.3
|
||||||
|
|
||||||
##############################################################################################
|
##############################################################################################
|
||||||
# Set these for your project
|
# Set these for your project
|
||||||
|
@ -32,13 +32,13 @@
|
||||||
|
|
||||||
ARCH =
|
ARCH =
|
||||||
SRCFLAGS = -ggdb -O0
|
SRCFLAGS = -ggdb -O0
|
||||||
SRCFLAGS+= -m32
|
|
||||||
CFLAGS =
|
CFLAGS =
|
||||||
CXXFLAGS =
|
CXXFLAGS =
|
||||||
ASFLAGS =
|
ASFLAGS =
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
|
|
||||||
SRC =
|
SRC =
|
||||||
|
OBJS =
|
||||||
DEFS =
|
DEFS =
|
||||||
LIBS =
|
LIBS =
|
||||||
INCPATH =
|
INCPATH =
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
OPT_NONSTANDARD_FLAGS = no
|
OPT_NONSTANDARD_FLAGS = no
|
||||||
OPT_NATIVEOS = chibios
|
OPT_NATIVEOS = chibios
|
||||||
OPT_OS = chibios
|
OPT_OS = chibios
|
||||||
|
OPT_THUMB = no
|
||||||
|
OPT_CPU = at91sam7
|
||||||
|
|
||||||
# uGFX settings
|
# uGFX settings
|
||||||
# See $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk for the list of variables
|
# See $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk for the list of variables
|
||||||
|
@ -30,9 +32,7 @@ ifeq ($(OPT_OS),chibios)
|
||||||
CHIBIOS_PLATFORM = AT91SAM7
|
CHIBIOS_PLATFORM = AT91SAM7
|
||||||
CHIBIOS_PORT = GCC/ARM/AT91SAM7
|
CHIBIOS_PORT = GCC/ARM/AT91SAM7
|
||||||
CHIBIOS_DEFS =
|
CHIBIOS_DEFS =
|
||||||
#CHIBIOS_LDSCRIPT = $(PORTLD)/AT91SAM7X256.ld
|
CHIBIOS_LDSCRIPT = AT91SAM7X256.ld
|
||||||
# We define a non standard linker script here just to give us some more stack space
|
|
||||||
CHIBIOS_LDSCRIPT = linker.ld
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
##############################################################################################
|
##############################################################################################
|
||||||
|
@ -41,18 +41,20 @@ endif
|
||||||
|
|
||||||
ARCH = arm-none-eabi-
|
ARCH = arm-none-eabi-
|
||||||
SRCFLAGS = -ggdb -O0
|
SRCFLAGS = -ggdb -O0
|
||||||
SRCFLAGS+= -mcpu=arm7tdmi -mabi=apcs-gnu -mno-thumb-interwork
|
|
||||||
CFLAGS =
|
CFLAGS =
|
||||||
CXXFLAGS = -fno-rtti
|
CXXFLAGS = -fno-rtti
|
||||||
ASFLAGS =
|
ASFLAGS =
|
||||||
LDFLAGS = -mcpu=arm7tdmi
|
LDFLAGS =
|
||||||
|
|
||||||
SRC =
|
SRC =
|
||||||
|
OBJS =
|
||||||
DEFS =
|
DEFS =
|
||||||
LIBS =
|
LIBS =
|
||||||
INCPATH =
|
INCPATH =
|
||||||
LIBPATH =
|
LIBPATH =
|
||||||
LDSCRIPT =
|
|
||||||
|
# We override the standard ChibiOS linker script here just to give us some more stack space
|
||||||
|
LDSCRIPT = linker.ld
|
||||||
|
|
||||||
##############################################################################################
|
##############################################################################################
|
||||||
# These should be at the end
|
# These should be at the end
|
||||||
|
|
|
@ -1,3 +1 @@
|
||||||
Copy these files into your own project directory and alter them to suite.
|
Copy these files into your own project directory and alter them to suite.
|
||||||
|
|
||||||
In particular look at the MYFILES definition and the MYCSRC definition.
|
|
|
@ -43,6 +43,7 @@ ASFLAGS =
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
|
|
||||||
SRC =
|
SRC =
|
||||||
|
OBJS =
|
||||||
DEFS =
|
DEFS =
|
||||||
LIBS =
|
LIBS =
|
||||||
INCPATH =
|
INCPATH =
|
||||||
|
|
|
@ -3,7 +3,4 @@ Copy these files into your own project directory and alter them to suite.
|
||||||
Notes:
|
Notes:
|
||||||
|
|
||||||
1/ This makefile uses the MINGW compiler tool chain and was run using the cygwin make.
|
1/ This makefile uses the MINGW compiler tool chain and was run using the cygwin make.
|
||||||
2/ At the top of the Makefile is the define USE_CHIBIOS. Win32 can build uGFX for either
|
2/ The files chconf.h and halconf.h are only needed if compiling for the ChibiOS simulator.
|
||||||
native Win32 (the default) or for the ChibiOS simulator.
|
|
||||||
3/ The files chconf.h and halconf.h are only needed if compiling for the ChibiOS simulator.
|
|
||||||
4/ Look at the MYFILES definition and the MYCSRC definition.
|
|
||||||
|
|
|
@ -1,8 +1,17 @@
|
||||||
|
#
|
||||||
|
# This file is subject to the terms of the GFX License. If a copy of
|
||||||
|
# the license was not distributed with this file, you can obtain one at:
|
||||||
|
#
|
||||||
|
# http://ugfx.org/license.html
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
# See readme.txt for the make API
|
# See readme.txt for the make API
|
||||||
|
#
|
||||||
|
|
||||||
ifeq ($(basename $(OPT_OS)),win32)
|
ifeq ($(basename $(OPT_OS)),win32)
|
||||||
# Nasty - must convert all paths into a format make can handle
|
# Nasty - must convert all paths into a format make can handle
|
||||||
PATHEXPAND := ARCH XCC XCXX XAS XLD XOC XOD PROJECT BUILDDIR SRC DEFS LIBS INCPATH LIBPATH $(PATHLIST)
|
PATHEXPAND := ARCH XCC XCXX XAS XLD XOC XOD XSZ PROJECT BUILDDIR SRC DEFS LIBS INCPATH LIBPATH $(PATHLIST)
|
||||||
|
|
||||||
# First convert \'s to /'s
|
# First convert \'s to /'s
|
||||||
$(foreach var,$(PATHEXPAND),$(eval $(var):=$$(subst \,/,$($(var)))))
|
$(foreach var,$(PATHEXPAND),$(eval $(var):=$$(subst \,/,$($(var)))))
|
||||||
|
@ -43,6 +52,9 @@ endif
|
||||||
ifeq ($(XOD),)
|
ifeq ($(XOD),)
|
||||||
XOD = $(ARCH)objdump
|
XOD = $(ARCH)objdump
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(XSZ),)
|
||||||
|
XSZ = $(ARCH)size
|
||||||
|
endif
|
||||||
|
|
||||||
# Default project name is the project directory name
|
# Default project name is the project directory name
|
||||||
ifeq ($(PROJECT),)
|
ifeq ($(PROJECT),)
|
||||||
|
@ -75,6 +87,7 @@ DEPDIR = $(BUILDDIR)/dep
|
||||||
|
|
||||||
# Output files
|
# Output files
|
||||||
MAPFILE = $(BUILDDIR)/$(PROJECT).map
|
MAPFILE = $(BUILDDIR)/$(PROJECT).map
|
||||||
|
FAKEFILE= fakefile.o
|
||||||
EXEFILE =
|
EXEFILE =
|
||||||
ifeq ($(basename $(OPT_OS)),win32)
|
ifeq ($(basename $(OPT_OS)),win32)
|
||||||
EXEFILE = $(BUILDDIR)/$(PROJECT).exe
|
EXEFILE = $(BUILDDIR)/$(PROJECT).exe
|
||||||
|
@ -91,20 +104,37 @@ endif
|
||||||
ifeq ($(EXEFILE),)
|
ifeq ($(EXEFILE),)
|
||||||
LDFLAGS += -nostartfiles
|
LDFLAGS += -nostartfiles
|
||||||
EXEFILE = $(BUILDDIR)/$(PROJECT).elf
|
EXEFILE = $(BUILDDIR)/$(PROJECT).elf
|
||||||
TARGETS = $(EXEFILE) $(BUILDDIR)/$(PROJECT).hex $(BUILDDIR)/$(PROJECT).bin $(BUILDDIR)/$(PROJECT).dmp
|
TARGETS = $(EXEFILE) $(BUILDDIR)/$(PROJECT).hex $(BUILDDIR)/$(PROJECT).bin $(BUILDDIR)/$(PROJECT).dmp elfstats
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Combine all our compiler arguments
|
# Generate our object file lists
|
||||||
SRCFLAGS += -I. $(patsubst %,-I%,$(INCPATH)) $(patsubst %,-D%,$(patsubst -D%,%,$(DEFS)))
|
OBJS_THUMB += $(addprefix $(OBJDIR)/,$(call src_obj,$(addsuffix .o,$(basename $(SRC_THUMB)))))
|
||||||
LDFLAGS += $(patsubst %,-L%,$(LIBPATH)) $(patsubst %,-l%,$(patsubst -l%,%,$(LIBS)))
|
OBJS_NOTHUMB += $(addprefix $(OBJDIR)/,$(call src_obj,$(addsuffix .o,$(basename $(SRC_NOTHUMB)))))
|
||||||
OBJS = $(addprefix $(OBJDIR)/,$(call src_obj,$(addsuffix .o,$(basename $(SRC)))))
|
ifeq ($(OPT_THUMB),yes)
|
||||||
|
OBJS_THUMB += $(OBJS) $(addprefix $(OBJDIR)/,$(call src_obj,$(addsuffix .o,$(basename $(SRC)))))
|
||||||
|
else
|
||||||
|
OBJS_NOTHUMB += $(OBJS) $(addprefix $(OBJDIR)/,$(call src_obj,$(addsuffix .o,$(basename $(SRC)))))
|
||||||
|
endif
|
||||||
|
ifneq ($(OBJS_THUMB),)
|
||||||
|
ifneq ($(OBJS_NOTHUMB),)
|
||||||
|
# Mixed ARM and THUMB mode - enabled only if needed because it kills performance.
|
||||||
|
SRCFLAGS += -mthumb-interwork
|
||||||
|
LDFLAGS += -mthumb-interwork
|
||||||
|
DEFS += THUMB_PRESENT
|
||||||
|
else
|
||||||
|
# Pure THUMB mode, THUMB C code cannot be called by ARM asm code directly.
|
||||||
|
LDFLAGS += -mthumb
|
||||||
|
DEFS += THUMB_PRESENT THUMB_NO_INTERWORKING
|
||||||
|
FAKEFILE= fakethumbfile.o
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# Handle make API options that affect compiler arguments
|
# Handle make API options that affect compiler arguments
|
||||||
ifneq ($(OPT_NONSTANDARD_FLAGS),yes)
|
ifneq ($(OPT_NONSTANDARD_FLAGS),yes)
|
||||||
SRCFLAGS += -fomit-frame-pointer -Wall -Wextra -Wstrict-prototypes -fverbose-asm
|
SRCFLAGS += -fomit-frame-pointer -Wall -Wextra -Wstrict-prototypes -fverbose-asm
|
||||||
endif
|
endif
|
||||||
ifeq ($(OPT_LINK_OPTIMIZE),yes)
|
ifeq ($(OPT_LINK_OPTIMIZE),yes)
|
||||||
SRCFLAGS += -ffunction-sections -fdata-sections
|
SRCFLAGS += -ffunction-sections -fdata-sections -fno-common -flto
|
||||||
endif
|
endif
|
||||||
ifeq ($(OPT_GENERATE_MAP),yes)
|
ifeq ($(OPT_GENERATE_MAP),yes)
|
||||||
ifeq ($(OPT_LINK_OPTIMIZE),yes)
|
ifeq ($(OPT_LINK_OPTIMIZE),yes)
|
||||||
|
@ -121,27 +151,72 @@ endif
|
||||||
ifneq ($(LDSCRIPT),)
|
ifneq ($(LDSCRIPT),)
|
||||||
LDFLAGS += -T$(LDSCRIPT)
|
LDFLAGS += -T$(LDSCRIPT)
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(OPT_CPU),x86)
|
||||||
|
SRCFLAGS += -m32
|
||||||
|
LDFLAGS += -m32
|
||||||
|
endif
|
||||||
|
ifeq ($(OPT_CPU),x64)
|
||||||
|
SRCFLAGS += -m64
|
||||||
|
LDFLAGS += -m64
|
||||||
|
endif
|
||||||
|
ifeq ($(OPT_CPU),at91sam7)
|
||||||
|
SRCFLAGS += -mcpu=arm7tdmi -mabi=apcs-gnu
|
||||||
|
LDFLAGS += -mcpu=arm7tdmi
|
||||||
|
endif
|
||||||
|
ifeq ($(OPT_CPU),stm32m4)
|
||||||
|
SRCFLAGS += -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -falign-functions=16
|
||||||
|
LDFLAGS += -mcpu=cortex-m4
|
||||||
|
LIBS += m
|
||||||
|
endif
|
||||||
|
|
||||||
# Generate dependency information
|
# Generate dependency information
|
||||||
SRCFLAGS += -MMD -MP -MF $(DEPDIR)/$(@F).d
|
SRCFLAGS += -MMD -MP -MF $(DEPDIR)/$(@F).d
|
||||||
|
|
||||||
|
# Combine all our compiler arguments
|
||||||
|
SRCFLAGS += -I. $(patsubst %,-I%,$(INCPATH)) $(patsubst %,-D%,$(patsubst -D%,%,$(DEFS)))
|
||||||
|
LDFLAGS += $(patsubst %,-L%,$(LIBPATH)) $(patsubst %,-l%,$(patsubst -l%,%,$(LIBS)))
|
||||||
|
|
||||||
# Targets
|
# Targets
|
||||||
.PHONY: builddirs fakefile.o all clean Debug Release cleanDebug cleanRelease
|
.PHONY: builddirs fakefile.o fakethumbfile.o elfstats all clean Debug Release cleanDebug cleanRelease
|
||||||
|
|
||||||
Debug Release: all
|
Debug Release: all
|
||||||
cleanDebug cleanRelease: clean
|
cleanDebug cleanRelease: clean
|
||||||
|
|
||||||
all: builddirs fakefile.o $(TARGETS)
|
all: builddirs $(FAKEFILE) $(TARGETS)
|
||||||
|
|
||||||
builddirs:
|
builddirs:
|
||||||
@mkdir -p $(BUILDDIR)
|
@mkdir -p $(BUILDDIR)
|
||||||
@mkdir -p $(OBJDIR)
|
@mkdir -p $(OBJDIR)
|
||||||
@mkdir -p $(DEPDIR)
|
@mkdir -p $(DEPDIR)
|
||||||
|
|
||||||
fakefile.o:
|
$(FAKEFILE):
|
||||||
ifneq ($(OPT_VERBOSE_COMPILE),yes)
|
ifneq ($(OPT_VERBOSE_COMPILE),yes)
|
||||||
@echo Compiler Options - $(XCC) -c $(CPPFLAGS) $(CFLAGS) $(SRCFLAGS) fakefile.c -o $(OBJDIR)/$@
|
@echo .
|
||||||
@echo
|
ifneq ($(filter %.cpp,$(SRC) $(SRC_NOTHUMB) $(SRC_THUMB)),)
|
||||||
|
@echo C++ Compiler Options.. $(XCXX) -c $(CPPFLAGS) $(CXXFLAGS) $(SRCFLAGS) $(@:.o=.cpp) -o $(OBJDIR)/$@
|
||||||
|
else
|
||||||
|
ifneq ($(filter %.c++,$(SRC) $(SRC_NOTHUMB) $(SRC_THUMB)),)
|
||||||
|
@echo C++ Compiler Options.. $(XCXX) -c $(CPPFLAGS) $(CXXFLAGS) $(SRCFLAGS) $(@:.o=.c++) -o $(OBJDIR)/$@
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
ifneq ($(filter %.c,$(SRC) $(SRC_NOTHUMB) $(SRC_THUMB)),)
|
||||||
|
@echo C Compiler Options.... $(XCC) -c $(CPPFLAGS) $(CFLAGS) $(SRCFLAGS) $(@:.o=.c) -o $(OBJDIR)/$@
|
||||||
|
endif
|
||||||
|
ifneq ($(filter %.s,$(SRC) $(SRC_NOTHUMB) $(SRC_THUMB)),)
|
||||||
|
@echo Assembler Options..... $(XCC) -c $(CPPFLAGS) $(CFLAGS) $(SRCFLAGS) $(@:.o=.s) -o $(OBJDIR)/$@
|
||||||
|
endif
|
||||||
|
@echo Linker Options........ $(XLD) $(LDFLAGS) $(OBJDIR)/$@ -o $(EXEFILE)
|
||||||
|
@echo .
|
||||||
|
endif
|
||||||
|
|
||||||
|
fakethumbfile.o $(OBJS_THUMB): SRCFLAGS += -mthumb -DTHUMB
|
||||||
|
|
||||||
|
elfstats: $(EXEFILE)
|
||||||
|
@echo .
|
||||||
|
ifeq ($(USE_VERBOSE_COMPILE),yes)
|
||||||
|
$(XSZ) $<
|
||||||
|
else
|
||||||
|
@$(XSZ) $<
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Implicit Rules
|
# Implicit Rules
|
||||||
|
@ -150,7 +225,7 @@ endif
|
||||||
$(OBJDIR)/%.o : $$(call obj_src,%.c)
|
$(OBJDIR)/%.o : $$(call obj_src,%.c)
|
||||||
@mkdir -p $(dir $@)
|
@mkdir -p $(dir $@)
|
||||||
ifeq ($(OPT_VERBOSE_COMPILE),yes)
|
ifeq ($(OPT_VERBOSE_COMPILE),yes)
|
||||||
@echo
|
@echo .
|
||||||
$(XCC) -c $(CPPFLAGS) $(CFLAGS) $(SRCFLAGS) $< -o $@
|
$(XCC) -c $(CPPFLAGS) $(CFLAGS) $(SRCFLAGS) $< -o $@
|
||||||
else
|
else
|
||||||
@echo Compiling $<
|
@echo Compiling $<
|
||||||
|
@ -160,7 +235,7 @@ endif
|
||||||
$(OBJDIR)/%.o : $$(call obj_src,%.cpp)
|
$(OBJDIR)/%.o : $$(call obj_src,%.cpp)
|
||||||
@mkdir -p $(dir $@)
|
@mkdir -p $(dir $@)
|
||||||
ifeq ($(OPT_VERBOSE_COMPILE),yes)
|
ifeq ($(OPT_VERBOSE_COMPILE),yes)
|
||||||
@echo
|
@echo .
|
||||||
$(XCXX) -c $(CPPFLAGS) $(CXXFLAGS) $(SRCFLAGS) $< -o $@
|
$(XCXX) -c $(CPPFLAGS) $(CXXFLAGS) $(SRCFLAGS) $< -o $@
|
||||||
else
|
else
|
||||||
@echo Compiling $<
|
@echo Compiling $<
|
||||||
|
@ -170,7 +245,7 @@ endif
|
||||||
$(OBJDIR)/%.o : $$(call obj_src,%.c++)
|
$(OBJDIR)/%.o : $$(call obj_src,%.c++)
|
||||||
@mkdir -p $(dir $@)
|
@mkdir -p $(dir $@)
|
||||||
ifeq ($(OPT_VERBOSE_COMPILE),yes)
|
ifeq ($(OPT_VERBOSE_COMPILE),yes)
|
||||||
@echo
|
@echo .
|
||||||
$(XCXX) -c $(CPPFLAGS) $(CXXFLAGS) $(SRCFLAGS) $< -o $@
|
$(XCXX) -c $(CPPFLAGS) $(CXXFLAGS) $(SRCFLAGS) $< -o $@
|
||||||
else
|
else
|
||||||
@echo Compiling $<
|
@echo Compiling $<
|
||||||
|
@ -180,21 +255,21 @@ endif
|
||||||
$(OBJDIR)/%.o : $$(call obj_src,%.s)
|
$(OBJDIR)/%.o : $$(call obj_src,%.s)
|
||||||
@mkdir -p $(dir $@)
|
@mkdir -p $(dir $@)
|
||||||
ifeq ($(OPT_VERBOSE_COMPILE),yes)
|
ifeq ($(OPT_VERBOSE_COMPILE),yes)
|
||||||
@echo
|
@echo .
|
||||||
$(XAS) -c $(CPPFLAGS) $(ASFLAGS) $(SRCFLAGS) $< -o $@
|
$(XAS) -c $(CPPFLAGS) $(ASFLAGS) $(SRCFLAGS) $< -o $@
|
||||||
else
|
else
|
||||||
@echo Compiling $<
|
@echo Compiling $<
|
||||||
@$(XAS) -c $(CPPFLAGS) $(ASFLAGS) $(SRCFLAGS) $< -o $@
|
@$(XAS) -c $(CPPFLAGS) $(ASFLAGS) $(SRCFLAGS) $< -o $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(EXEFILE): $(OBJS) $(LDSCRIPT)
|
$(EXEFILE): $(OBJS_THUMB) $(OBJS_NOTHUMB) $(LDSCRIPT)
|
||||||
@mkdir -p $(dir $@)
|
@mkdir -p $(dir $@)
|
||||||
ifeq ($(OPT_VERBOSE_COMPILE),yes)
|
ifeq ($(OPT_VERBOSE_COMPILE),yes)
|
||||||
@echo
|
@echo .
|
||||||
$(XLD) $(OBJS) $(LDFLAGS) -o $@
|
$(XLD) $(OBJS_THUMB) $(OBJS_NOTHUMB) $(LDFLAGS) -o $@
|
||||||
else
|
else
|
||||||
@echo Linking $@
|
@echo Linking $@
|
||||||
@$(XLD) $(OBJS) $(LDFLAGS) -o $@
|
@$(XLD) $(OBJS_THUMB) $(OBJS_NOTHUMB) $(LDFLAGS) -o $@
|
||||||
endif
|
endif
|
||||||
ifeq ($(OPT_COPY_EXE),yes)
|
ifeq ($(OPT_COPY_EXE),yes)
|
||||||
@cp $@ .
|
@cp $@ .
|
||||||
|
@ -228,7 +303,6 @@ ifeq ($(USE_VERBOSE_COMPILE),yes)
|
||||||
else
|
else
|
||||||
@echo Creating $@
|
@echo Creating $@
|
||||||
@$(XOD) -x --syms $< > $@
|
@$(XOD) -x --syms $< > $@
|
||||||
@echo Done
|
|
||||||
endif
|
endif
|
||||||
ifeq ($(OPT_COPY_EXE),yes)
|
ifeq ($(OPT_COPY_EXE),yes)
|
||||||
@cp $@ .
|
@cp $@ .
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
#
|
||||||
|
# This file is subject to the terms of the GFX License. If a copy of
|
||||||
|
# the license was not distributed with this file, you can obtain one at:
|
||||||
|
#
|
||||||
|
# http://ugfx.org/license.html
|
||||||
|
#
|
||||||
|
|
||||||
# See readme.txt for the make API
|
# See readme.txt for the make API
|
||||||
|
|
||||||
# Requirements:
|
# Requirements:
|
||||||
|
|
|
@ -1,26 +1,58 @@
|
||||||
|
#
|
||||||
|
# This file is subject to the terms of the GFX License. If a copy of
|
||||||
|
# the license was not distributed with this file, you can obtain one at:
|
||||||
|
#
|
||||||
|
# http://ugfx.org/license.html
|
||||||
|
#
|
||||||
|
|
||||||
# See readme.txt for the make API
|
# See readme.txt for the make API
|
||||||
|
|
||||||
# Requirements:
|
# Requirements:
|
||||||
#
|
#
|
||||||
# CHIBIOS: The location of the ChibiOS code eg CHIBIOS=../chibios
|
# CHIBIOS: The location of the ChibiOS code eg CHIBIOS=../chibios
|
||||||
# CHIBIOS_BOARD The name of the ChibiOS board eg CHIBIOS_BOARD=OLIMEX_SAM7_EX256
|
|
||||||
# CHIBIOS_PLATFORM The name of the ChibiOS platform eg CHIBIOS_PLATFORM=AT91SAM7
|
# CHIBIOS_PLATFORM The name of the ChibiOS platform eg CHIBIOS_PLATFORM=AT91SAM7
|
||||||
# CHIBIOS_PORT The name of the ChibiOS port eg CHIBIOS_PORT=GCC/ARM/AT91SAM7
|
# CHIBIOS_PORT The name of the ChibiOS port eg CHIBIOS_PORT=GCC/ARM/AT91SAM7
|
||||||
#
|
#
|
||||||
|
|
||||||
# Optional:
|
# Optional:
|
||||||
#
|
#
|
||||||
# CHIBIOS_LDSCRIPT The name of the loader script eg CHIBIOS_LDSCRIPT=$(PORTLD)/AT91SAM7X256.ld
|
# CHIBIOS_LDSCRIPT The name of the loader script eg CHIBIOS_LDSCRIPT=AT91SAM7X256.ld
|
||||||
|
# CHIBIOS_BOARD The name of the ChibiOS board eg CHIBIOS_BOARD=OLIMEX_SAM7_EX256 - if not specified you must include equivalent code yourself
|
||||||
|
# CHIBIOS_STM32LIB Use the STM32 library source for drivers instead of native drivers (yes or no) - default no
|
||||||
|
# CHIBIOS_VERSION Which version of ChibiOS is this (2 or 3) - default is 2
|
||||||
#
|
#
|
||||||
|
|
||||||
PATHLIST += CHIBIOS
|
PATHLIST += CHIBIOS
|
||||||
|
|
||||||
include $(CHIBIOS)/boards/$(CHIBIOS_BOARD)/board.mk
|
ifeq ($(CHIBIOS_VERSION),3)
|
||||||
include $(CHIBIOS)/os/hal/platforms/$(CHIBIOS_PLATFORM)/platform.mk
|
include $(CHIBIOS)/os/hal/hal.mk
|
||||||
include $(CHIBIOS)/os/hal/hal.mk
|
include $(CHIBIOS)/os/hal/osal/rt/osal.mk
|
||||||
include $(CHIBIOS)/os/ports/$(CHIBIOS_PORT)/port.mk
|
include $(CHIBIOS)/os/hal/ports/$(CHIBIOS_PLATFORM)/platform.mk
|
||||||
include $(CHIBIOS)/os/kernel/kernel.mk
|
include $(CHIBIOS)/os/rt/rt.mk
|
||||||
LDSCRIPT= $(CHIBIOS_LDSCRIPT)
|
include $(CHIBIOS)/os/rt/ports/$(CHIBIOS_PORT).mk
|
||||||
|
else
|
||||||
|
include $(CHIBIOS)/os/hal/hal.mk
|
||||||
|
include $(CHIBIOS)/os/hal/platforms/$(CHIBIOS_PLATFORM)/platform.mk
|
||||||
|
include $(CHIBIOS)/os/kernel/kernel.mk
|
||||||
|
include $(CHIBIOS)/os/ports/$(CHIBIOS_PORT)/port.mk
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(CHIBIOS_BOARD),)
|
||||||
|
include $(CHIBIOS)/boards/$(CHIBIOS_BOARD)/board.mk
|
||||||
|
endif
|
||||||
|
ifeq ($(LDSCRIPT),)
|
||||||
|
ifneq ($(CHIBIOS_LDSCRIPT),)
|
||||||
|
LDSCRIPT= $(PORTLD)/$(CHIBIOS_LDSCRIPT)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CHIBIOS_STM32LIB),yes)
|
||||||
|
include $(CHIBIOS)/ext/stm32lib/stm32lib.mk
|
||||||
|
SRC += $(STM32SRC)
|
||||||
|
DEFS += USE_STDPERIPH_DRIVER
|
||||||
|
INCPATH += $(STM32INC)
|
||||||
|
endif
|
||||||
|
|
||||||
INCPATH += $(PORTINC) $(KERNINC) $(TESTINC) \
|
INCPATH += $(PORTINC) $(KERNINC) $(TESTINC) \
|
||||||
$(HALINC) $(PLATFORMINC) $(BOARDINC)
|
$(HALINC) $(PLATFORMINC) $(BOARDINC)
|
||||||
SRC += $(PORTSRC) \
|
SRC += $(PORTSRC) \
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
#
|
||||||
|
# This file is subject to the terms of the GFX License. If a copy of
|
||||||
|
# the license was not distributed with this file, you can obtain one at:
|
||||||
|
#
|
||||||
|
# http://ugfx.org/license.html
|
||||||
|
#
|
||||||
|
|
||||||
# See readme.txt for the make API
|
# See readme.txt for the make API
|
||||||
|
|
||||||
# Requirements:
|
# Requirements:
|
||||||
|
|
|
@ -1,10 +1,18 @@
|
||||||
|
#
|
||||||
|
# This file is subject to the terms of the GFX License. If a copy of
|
||||||
|
# the license was not distributed with this file, you can obtain one at:
|
||||||
|
#
|
||||||
|
# http://ugfx.org/license.html
|
||||||
|
#
|
||||||
|
|
||||||
# See readme.txt for the make API
|
# See readme.txt for the make API
|
||||||
|
|
||||||
# Requirements:
|
# Requirements:
|
||||||
#
|
#
|
||||||
# OSX_SDK The location of the SDK eg. OSX_SDK = /Developer/SDKs/MacOSX10.7.sdk
|
# OSX_SDK The location of the SDK eg. OSX_SDK = /Developer/SDKs/MacOSX10.7.sdk
|
||||||
# OSX_ARCH The architecture flags eg. OSX_ARCH = -mmacosx-version-min=10.3 -arch i386
|
# OSX_ARCH The architecture flags eg. OSX_ARCH = -mmacosx-version-min=10.3
|
||||||
#
|
#
|
||||||
|
|
||||||
SRCFLAGS += -isysroot $(OSX_SDK) $(OSX_ARCH)
|
SRCFLAGS += -isysroot $(OSX_SDK) $(OSX_ARCH)
|
||||||
LDFLAGS += -pthread -Wl,-syslibroot,$(OSX_SDK) $(OSX_ARCH)
|
LDFLAGS += -pthread -Wl,-syslibroot,$(OSX_SDK) $(OSX_ARCH)
|
||||||
|
OPT_CPU = x86
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
#
|
||||||
|
# This file is subject to the terms of the GFX License. If a copy of
|
||||||
|
# the license was not distributed with this file, you can obtain one at:
|
||||||
|
#
|
||||||
|
# http://ugfx.org/license.html
|
||||||
|
#
|
||||||
|
|
||||||
# See readme.txt for the make API
|
# See readme.txt for the make API
|
||||||
|
|
||||||
# Requirements:
|
# Requirements:
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
|
#
|
||||||
|
# This file is subject to the terms of the GFX License. If a copy of
|
||||||
|
# the license was not distributed with this file, you can obtain one at:
|
||||||
|
#
|
||||||
|
# http://ugfx.org/license.html
|
||||||
|
#
|
||||||
|
|
||||||
# See readme.txt for the make API
|
# See readme.txt for the make API
|
||||||
|
|
||||||
# Requirements:
|
# Requirements:
|
||||||
#
|
#
|
||||||
# NONE
|
# NONE
|
||||||
#
|
#
|
||||||
|
OPT_CPU = x86
|
||||||
|
|
|
@ -15,6 +15,7 @@ OPT_COPY_EXE=no|yes - Copy the final program to the local project directory -
|
||||||
OPT_NONSTANDARD_FLAGS=no - Turn off adding the standard compiler language flags - default no
|
OPT_NONSTANDARD_FLAGS=no - Turn off adding the standard compiler language flags - default no
|
||||||
OPT_LINK_OPTIMIZE=no - Remove unused code/data during link - default no
|
OPT_LINK_OPTIMIZE=no - Remove unused code/data during link - default no
|
||||||
OPT_OS=win32|win32.chibios|linux|osx|chibios|freertos|ecos|raw32|rawrtos - Mandatory: The operating system
|
OPT_OS=win32|win32.chibios|linux|osx|chibios|freertos|ecos|raw32|rawrtos - Mandatory: The operating system
|
||||||
|
OPT_CPU=x86|x64|stm32m4|at91sam7 - Add some cpu dependant flags
|
||||||
|
|
||||||
BUILDDIR - Build Directory - default is ".build" or "bin/Debug" or "bin/Release" depending on the target
|
BUILDDIR - Build Directory - default is ".build" or "bin/Debug" or "bin/Release" depending on the target
|
||||||
PROJECT - Project Name - default is the name of the project directory
|
PROJECT - Project Name - default is the name of the project directory
|
||||||
|
@ -27,6 +28,7 @@ XAS - Assembler - default is "$(ARCH)gcc -x assembler-with-cpp"
|
||||||
XLD - Linker - default is "$(ARCH)gcc"
|
XLD - Linker - default is "$(ARCH)gcc"
|
||||||
XOC - Object Copy - default is "$(ARCH)objcopy"
|
XOC - Object Copy - default is "$(ARCH)objcopy"
|
||||||
XOD - Object Dump - default is "$(ARCH)objdump"
|
XOD - Object Dump - default is "$(ARCH)objdump"
|
||||||
|
XSZ - Report binary dump details - default is "$(ARCH)size"
|
||||||
|
|
||||||
SRCFLAGS - Compiler defines for c, c++ and assembler files - default is ""
|
SRCFLAGS - Compiler defines for c, c++ and assembler files - default is ""
|
||||||
CFLAGS - C specific compiler defines - default is ""
|
CFLAGS - C specific compiler defines - default is ""
|
||||||
|
@ -43,8 +45,18 @@ LIBPATH - List of library include directories - default is ""
|
||||||
DEFS - List of preprocessor defines (any -D prefix is ignored) - default is ""
|
DEFS - List of preprocessor defines (any -D prefix is ignored) - default is ""
|
||||||
LIBS - List of libraries (any -l prefix is ignored) - default is ""
|
LIBS - List of libraries (any -l prefix is ignored) - default is ""
|
||||||
SRC - List of c, c++ and assembler source files - default is ""
|
SRC - List of c, c++ and assembler source files - default is ""
|
||||||
|
OBJS - List of additional object files - default is ""
|
||||||
LDSCRIPT - Custom loader script - default is ""
|
LDSCRIPT - Custom loader script - default is ""
|
||||||
|
|
||||||
|
ARM Specific options
|
||||||
|
----------------------------
|
||||||
|
OPT_THUMB=no|yes - Compile normal sources in thumb mode - default is no
|
||||||
|
|
||||||
|
SRC_THUMB - List of source files that MUST be compiled in thumb mode - default is ""
|
||||||
|
SRC_NOTHUMB - List of source files that MUST be compiled in non-thumb mode - default is ""
|
||||||
|
OBJS_THUMB - List of object files that MUST be linked in thumb mode - default is ""
|
||||||
|
OBJS_NOTHUMB - List of object files that MUST be linked in non-thumb mode - default is ""
|
||||||
|
|
||||||
Targets
|
Targets
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue