Update support for ChibiOS v3 to the current repository.

Update Make system to match.
Add ability to make to a library rather than a program
Stop ignoring objcode invalid format errors
Multiple make tidy ups
ugfx_release_2.6
inmarket 2014-10-06 15:50:19 +10:00
parent 2151935b3a
commit 18c4a9f870
19 changed files with 180 additions and 122 deletions

View File

@ -6,13 +6,8 @@
# General settings # General settings
# See $(GFXLIB)/tools/gmake_scripts/readme.txt for the list of variables # See $(GFXLIB)/tools/gmake_scripts/readme.txt for the list of variables
OPT_VERBOSE_COMPILE = no
OPT_GENERATE_LISTINGS = yes
OPT_GENERATE_MAP = yes
OPT_COPY_EXE = no
OPT_LINK_OPTIMIZE = yes
OPT_NONSTANDARD_FLAGS = no
OPT_OS = linux OPT_OS = linux
OPT_LINK_OPTIMIZE = yes
# Change this next setting (or add the explicit compiler flags) if you are not compiling for x86 linux # Change this next setting (or add the explicit compiler flags) if you are not compiling for x86 linux
OPT_CPU = x86 OPT_CPU = x86
@ -20,7 +15,6 @@
# 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
GFXLIB = ../uGFX GFXLIB = ../uGFX
GFXBOARD = Linux-Framebuffer GFXBOARD = Linux-Framebuffer
#GFXDRIVERS = multiple/uGFXnet
GFXDEMO = modules/gdisp/basics GFXDEMO = modules/gdisp/basics
# Linux settings # Linux settings

View File

@ -6,13 +6,8 @@
# General settings # General settings
# See $(GFXLIB)/tools/gmake_scripts/readme.txt for the list of variables # See $(GFXLIB)/tools/gmake_scripts/readme.txt for the list of variables
OPT_VERBOSE_COMPILE = no
OPT_GENERATE_LISTINGS = yes
OPT_GENERATE_MAP = yes
OPT_COPY_EXE = no
OPT_LINK_OPTIMIZE = yes
OPT_NONSTANDARD_FLAGS = no
OPT_OS = linux OPT_OS = linux
OPT_LINK_OPTIMIZE = yes
# Change this next setting (or add the explicit compiler flags) if you are not compiling for x86 linux # Change this next setting (or add the explicit compiler flags) if you are not compiling for x86 linux
OPT_CPU = x86 OPT_CPU = x86
@ -20,7 +15,6 @@
# 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
GFXLIB = ../uGFX GFXLIB = ../uGFX
GFXBOARD = Linux GFXBOARD = Linux
#GFXDRIVERS = multiple/uGFXnet
GFXDEMO = modules/gdisp/basics GFXDEMO = modules/gdisp/basics
# Linux settings # Linux settings

View File

@ -49,6 +49,7 @@
* MCU type as defined in the ST header. * MCU type as defined in the ST header.
*/ */
#define STM32F40_41xxx #define STM32F40_41xxx
#define STM32F407xx
/* /*
* IO pins assignments. * IO pins assignments.

View File

@ -6,22 +6,16 @@
# General settings # General settings
# See $(GFXLIB)/tools/gmake_scripts/readme.txt for the list of variables # See $(GFXLIB)/tools/gmake_scripts/readme.txt for the list of variables
OPT_VERBOSE_COMPILE = no
OPT_GENERATE_LISTINGS = yes
OPT_GENERATE_MAP = yes
OPT_COPY_EXE = no
OPT_LINK_OPTIMIZE = yes
OPT_NONSTANDARD_FLAGS = no
OPT_NATIVEOS = chibios OPT_NATIVEOS = chibios
OPT_OS = chibios OPT_OS = chibios
OPT_THUMB = yes OPT_THUMB = yes
OPT_LINK_OPTIMIZE = yes
OPT_CPU = stm32m4 OPT_CPU = stm32m4
# 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
GFXLIB = ../uGFX GFXLIB = ../uGFX
GFXBOARD = Mikromedia-STM32-M4-ILI9341 GFXBOARD = Mikromedia-STM32-M4-ILI9341
#GFXDRIVERS = multiple/uGFXnet
GFXDEMO = modules/gdisp/basics GFXDEMO = modules/gdisp/basics
# ChibiOS settings # ChibiOS settings
@ -31,7 +25,6 @@ ifeq ($(OPT_OS),chibios)
CHIBIOS_BOARD = CHIBIOS_BOARD =
CHIBIOS_PLATFORM = STM32F4xx CHIBIOS_PLATFORM = STM32F4xx
CHIBIOS_PORT = GCC/ARMCMx/STM32F4xx CHIBIOS_PORT = GCC/ARMCMx/STM32F4xx
CHIBIOS_DEFS =
CHIBIOS_LDSCRIPT = STM32F407xG.ld CHIBIOS_LDSCRIPT = STM32F407xG.ld
# We define a non standard board script as this is not a standard ChibiOS supported board # 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 include $(GFXLIB)/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/board.mk

View File

@ -6,33 +6,27 @@
# General settings # General settings
# See $(GFXLIB)/tools/gmake_scripts/readme.txt for the list of variables # See $(GFXLIB)/tools/gmake_scripts/readme.txt for the list of variables
OPT_VERBOSE_COMPILE = no
OPT_GENERATE_LISTINGS = yes
OPT_GENERATE_MAP = yes
OPT_COPY_EXE = no
OPT_LINK_OPTIMIZE = yes
OPT_NONSTANDARD_FLAGS = no
OPT_NATIVEOS = chibios OPT_NATIVEOS = chibios
OPT_OS = chibios OPT_OS = chibios
OPT_THUMB = yes OPT_THUMB = yes
OPT_LINK_OPTIMIZE = yes
OPT_CPU = stm32m4 OPT_CPU = stm32m4
# 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
GFXLIB = ../uGFX GFXLIB = ../uGFX
GFXBOARD = Mikromedia-STM32-M4-ILI9341 GFXBOARD = Mikromedia-STM32-M4-ILI9341
#GFXDRIVERS = multiple/uGFXnet
GFXDEMO = modules/gdisp/basics GFXDEMO = modules/gdisp/basics
# ChibiOS settings # ChibiOS settings
ifeq ($(OPT_OS),chibios) ifeq ($(OPT_OS),chibios)
# See $(GFXLIB)/tools/gmake_scripts/os_chibios.mk for the list of variables # See $(GFXLIB)/tools/gmake_scripts/os_chibios.mk for the list of variables
CHIBIOS = ../ChibiOS CHIBIOS = ../ChibiOS3
CHBIOS_VERSION = 3 CHIBIOS_VERSION = 3
CHIBIOS_BOARD = CHIBIOS_BOARD =
CHIBIOS_CPUCLASS = ARMCMx
CHIBIOS_PLATFORM = STM32/STM32F4xx CHIBIOS_PLATFORM = STM32/STM32F4xx
CHIBIOS_PORT = ARMCMx/compilers/GCC/mk/port_stm32f4xx CHIBIOS_PORT = stm32f4xx
CHIBIOS_DEFS =
CHIBIOS_LDSCRIPT = STM32F407xG.ld CHIBIOS_LDSCRIPT = STM32F407xG.ld
# We define a non standard board script as this is not a standard ChibiOS supported board # 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 include $(GFXLIB)/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/board.mk
@ -65,22 +59,3 @@ include $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk
include $(GFXLIB)/tools/gmake_scripts/os_$(OPT_OS).mk include $(GFXLIB)/tools/gmake_scripts/os_$(OPT_OS).mk
include $(GFXLIB)/tools/gmake_scripts/compiler_gcc.mk include $(GFXLIB)/tools/gmake_scripts/compiler_gcc.mk
# *** EOF *** # *** EOF ***
##############################################################################
###############################################################################
# Architecture or project specific options
#
# Stack size to be allocated to the Cortex-M process stack. This stack is
# the stack used by the main() thread.
ifeq ($(USE_PROCESS_STACKSIZE),)
USE_PROCESS_STACKSIZE = 0x400
endif
# Stack size to the allocated to the Cortex-M main/exceptions stack. This
# stack is used for processing interrupts and exceptions.
ifeq ($(USE_EXCEPTIONS_STACKSIZE),)
USE_EXCEPTIONS_STACKSIZE = 0x400
endif
RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC
include $(RULESPATH)/rules.mk

View File

@ -1,5 +1,5 @@
/* /*
ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio ChibiOS - Copyright (C) 2006-2014 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/* /*
ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio ChibiOS - Copyright (C) 2006-2014 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -30,13 +30,6 @@
#include "mcuconf.h" #include "mcuconf.h"
/**
* @brief Enables the TM subsystem.
*/
#if !defined(HAL_USE_TM) || defined(__DOXYGEN__)
#define HAL_USE_TM FALSE
#endif
/** /**
* @brief Enables the PAL subsystem. * @brief Enables the PAL subsystem.
*/ */
@ -79,6 +72,13 @@
#define HAL_USE_I2C FALSE #define HAL_USE_I2C FALSE
#endif #endif
/**
* @brief Enables the I2S subsystem.
*/
#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
#define HAL_USE_I2S FALSE
#endif
/** /**
* @brief Enables the ICU subsystem. * @brief Enables the ICU subsystem.
*/ */
@ -104,7 +104,7 @@
* @brief Enables the PWM subsystem. * @brief Enables the PWM subsystem.
*/ */
#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) #if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
#define HAL_USE_PWM TRUE #define HAL_USE_PWM FALSE
#endif #endif
/** /**

View File

@ -1,5 +1,5 @@
/* /*
ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio ChibiOS - Copyright (C) 2006-2014 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -6,19 +6,13 @@
# General settings # General settings
# See $(GFXLIB)/tools/gmake_scripts/readme.txt for the list of variables # See $(GFXLIB)/tools/gmake_scripts/readme.txt for the list of variables
OPT_VERBOSE_COMPILE = no
OPT_GENERATE_LISTINGS = yes
OPT_GENERATE_MAP = yes
OPT_COPY_EXE = no
OPT_LINK_OPTIMIZE = yes
OPT_NONSTANDARD_FLAGS = no
OPT_OS = osx OPT_OS = osx
OPT_LINK_OPTIMIZE = yes
# 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
GFXLIB = ../uGFX GFXLIB = ../uGFX
GFXBOARD = OSX GFXBOARD = OSX
#GFXDRIVERS = multiple/uGFXnet
GFXDEMO = modules/gdisp/basics GFXDEMO = modules/gdisp/basics
# OSX settings # OSX settings

View File

@ -6,22 +6,16 @@
# General settings # General settings
# See $(GFXLIB)/tools/gmake_scripts/readme.txt for the list of variables # See $(GFXLIB)/tools/gmake_scripts/readme.txt for the list of variables
OPT_VERBOSE_COMPILE = no
OPT_GENERATE_LISTINGS = yes
OPT_GENERATE_MAP = yes
OPT_COPY_EXE = no
OPT_LINK_OPTIMIZE = yes
OPT_NONSTANDARD_FLAGS = no
OPT_NATIVEOS = chibios OPT_NATIVEOS = chibios
OPT_OS = chibios OPT_OS = chibios
OPT_THUMB = no OPT_THUMB = yes
OPT_LINK_OPTIMIZE = yes
OPT_CPU = at91sam7 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
GFXLIB = ../uGFX GFXLIB = ../uGFX
GFXBOARD = Olimex-SAM7EX256-GE8 GFXBOARD = Olimex-SAM7EX256-GE8
#GFXDRIVERS = multiple/uGFXnet
GFXDEMO = modules/gdisp/basics GFXDEMO = modules/gdisp/basics
# ChibiOS settings # ChibiOS settings
@ -31,7 +25,6 @@ ifeq ($(OPT_OS),chibios)
CHIBIOS_BOARD = OLIMEX_SAM7_EX256 CHIBIOS_BOARD = OLIMEX_SAM7_EX256
CHIBIOS_PLATFORM = AT91SAM7 CHIBIOS_PLATFORM = AT91SAM7
CHIBIOS_PORT = GCC/ARM/AT91SAM7 CHIBIOS_PORT = GCC/ARM/AT91SAM7
CHIBIOS_DEFS =
CHIBIOS_LDSCRIPT = AT91SAM7X256.ld CHIBIOS_LDSCRIPT = AT91SAM7X256.ld
endif endif

View File

@ -6,20 +6,14 @@
# General settings # General settings
# See $(GFXLIB)/tools/gmake_scripts/readme.txt for the list of variables # See $(GFXLIB)/tools/gmake_scripts/readme.txt for the list of variables
OPT_VERBOSE_COMPILE = no
OPT_GENERATE_LISTINGS = yes
OPT_GENERATE_MAP = yes
OPT_COPY_EXE = no
OPT_LINK_OPTIMIZE = yes
OPT_NONSTANDARD_FLAGS = no
# For Win32 this variable can be set to "win32" (native win32 api) or "win32.chibios" (ChibiOS simulator). # For Win32 this variable can be set to "win32" (native win32 api) or "win32.chibios" (ChibiOS simulator).
OPT_OS = win32 OPT_OS = win32
OPT_LINK_OPTIMIZE = yes
# 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
GFXLIB = ../uGFX GFXLIB = ../uGFX
GFXBOARD = Win32 GFXBOARD = Win32
#GFXDRIVERS = multiple/uGFXnet
GFXDEMO = modules/gdisp/basics GFXDEMO = modules/gdisp/basics
# ChibiOS settings # ChibiOS settings

View File

@ -28,6 +28,10 @@
* are already defined by ChibiOS * are already defined by ChibiOS
*/ */
#if CH_KERNEL_MAJOR == 3
typedef char bool_t;
#endif
typedef systime_t delaytime_t; typedef systime_t delaytime_t;
typedef systime_t systemticks_t; typedef systime_t systemticks_t;
typedef cnt_t semcount_t; typedef cnt_t semcount_t;

View File

@ -9,9 +9,9 @@
# See readme.txt for the make API # See readme.txt for the make API
# #
# Win32 Nasty - must convert all paths into a format make can handle
ifeq ($(basename $(OPT_OS)),win32) ifeq ($(basename $(OPT_OS)),win32)
# Nasty - must convert all paths into a format make can handle PATHEXPAND := ARCH XCC XCXX XAS XLD XOC XOD XSZ XAR 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)))))
@ -23,6 +23,14 @@ ifeq ($(basename $(OPT_OS)),win32)
endif endif
endif endif
# Where are we
CURRENTDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
# Handle cpu specific options
ifneq ($(OPT_CPU),)
include $(CURRENTDIR)cpu_$(OPT_CPU).mk
endif
# Path resolution - Functions to convert a source path to a object path and visa-versa # Path resolution - Functions to convert a source path to a object path and visa-versa
src_obj_fn := $$(1) src_obj_fn := $$(1)
obj_src_fn := $$(1) obj_src_fn := $$(1)
@ -54,7 +62,10 @@ ifeq ($(XOD),)
endif endif
ifeq ($(XSZ),) ifeq ($(XSZ),)
XSZ = $(ARCH)size XSZ = $(ARCH)size
endif endif
ifeq ($(XAR),)
XAR = $(ARCH)ar
endif
# Default project name is the project directory name # Default project name is the project directory name
ifeq ($(PROJECT),) ifeq ($(PROJECT),)
@ -87,6 +98,7 @@ DEPDIR = $(BUILDDIR)/dep
# Output files # Output files
MAPFILE = $(BUILDDIR)/$(PROJECT).map MAPFILE = $(BUILDDIR)/$(PROJECT).map
LIBFILE = $(BUILDDIR)/lib$(PROJECT).a
FAKEFILE= fakefile.o FAKEFILE= fakefile.o
EXEFILE = EXEFILE =
ifeq ($(basename $(OPT_OS)),win32) ifeq ($(basename $(OPT_OS)),win32)
@ -135,13 +147,10 @@ ifneq ($(OPT_NONSTANDARD_FLAGS),yes)
endif endif
ifeq ($(OPT_LINK_OPTIMIZE),yes) ifeq ($(OPT_LINK_OPTIMIZE),yes)
SRCFLAGS += -ffunction-sections -fdata-sections -fno-common -flto SRCFLAGS += -ffunction-sections -fdata-sections -fno-common -flto
LDFLAGS += -Wl,--gc-sections
endif endif
ifeq ($(OPT_GENERATE_MAP),yes) ifeq ($(OPT_GENERATE_MAP),yes)
ifeq ($(OPT_LINK_OPTIMIZE),yes) LDFLAGS += -Wl,-Map=$(MAPFILE),--cref
LDFLAGS += -Wl,-Map=$(MAPFILE),--cref,--no-warn-mismatch,--gc-sections
else
LDFLAGS += -Wl,-Map=$(MAPFILE),--cref,--no-warn-mismatch
endif
endif endif
ifeq ($(OPT_GENERATE_LISTINGS),yes) ifeq ($(OPT_GENERATE_LISTINGS),yes)
CFLAGS += -Wa,-alms=$(@:.o=.lst) CFLAGS += -Wa,-alms=$(@:.o=.lst)
@ -151,23 +160,6 @@ 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
@ -176,13 +168,23 @@ SRCFLAGS += -MMD -MP -MF $(DEPDIR)/$(@F).d
SRCFLAGS += -I. $(patsubst %,-I%,$(INCPATH)) $(patsubst %,-D%,$(patsubst -D%,%,$(DEFS))) SRCFLAGS += -I. $(patsubst %,-I%,$(INCPATH)) $(patsubst %,-D%,$(patsubst -D%,%,$(DEFS)))
LDFLAGS += $(patsubst %,-L%,$(LIBPATH)) $(patsubst %,-l%,$(patsubst -l%,%,$(LIBS))) LDFLAGS += $(patsubst %,-L%,$(LIBPATH)) $(patsubst %,-l%,$(patsubst -l%,%,$(LIBS)))
# Targets ################# Targets ######################
.PHONY: builddirs fakefile.o fakethumbfile.o elfstats all clean Debug Release cleanDebug cleanRelease
.PHONY: builddirs fakefile.o fakethumbfile.o elfstats all exe lib clean Debug Release cleanDebug cleanRelease
# Many IDE's use these targets instead.
Debug Release: all Debug Release: all
cleanDebug cleanRelease: clean cleanDebug cleanRelease: clean
all: builddirs $(FAKEFILE) $(TARGETS) # Make a program or a library?
ifeq ($(OPT_MAKE_LIB),yes)
all: lib
else
all: exe
endif
exe: builddirs $(FAKEFILE) $(TARGETS)
lib: builddirs $(FAKEFILE) $(LIBFILE)
builddirs: builddirs:
@mkdir -p $(BUILDDIR) @mkdir -p $(BUILDDIR)
@ -205,7 +207,9 @@ ifneq ($(OPT_VERBOSE_COMPILE),yes)
ifneq ($(filter %.s,$(SRC) $(SRC_NOTHUMB) $(SRC_THUMB)),) ifneq ($(filter %.s,$(SRC) $(SRC_NOTHUMB) $(SRC_THUMB)),)
@echo Assembler Options..... $(XCC) -c $(CPPFLAGS) $(CFLAGS) $(SRCFLAGS) $(@:.o=.s) -o $(OBJDIR)/$@ @echo Assembler Options..... $(XCC) -c $(CPPFLAGS) $(CFLAGS) $(SRCFLAGS) $(@:.o=.s) -o $(OBJDIR)/$@
endif endif
ifneq ($(OPT_MAKE_LIB),yes)
@echo Linker Options........ $(XLD) $(LDFLAGS) $(OBJDIR)/$@ -o $(EXEFILE) @echo Linker Options........ $(XLD) $(LDFLAGS) $(OBJDIR)/$@ -o $(EXEFILE)
endif
@echo . @echo .
endif endif
@ -275,6 +279,18 @@ ifeq ($(OPT_COPY_EXE),yes)
@cp $@ . @cp $@ .
endif endif
$(LIBFILE): $(OBJS_THUMB) $(OBJS_NOTHUMB)
ifeq ($(OPT_VERBOSE_COMPILE),yes)
@echo .
$(XAR) -r $@ $^
else
@echo Creating Library $@
@$(XAR) -r $@ $^
endif
ifeq ($(OPT_COPY_EXE),yes)
@cp $@ .
endif
%.hex: %.elf %.hex: %.elf
ifeq ($(OPT_VERBOSE_COMPILE),yes) ifeq ($(OPT_VERBOSE_COMPILE),yes)
$(XOC) -O ihex $< $@ $(XOC) -O ihex $< $@
@ -287,7 +303,7 @@ ifeq ($(OPT_COPY_EXE),yes)
endif endif
%.bin: %.elf %.bin: %.elf
ifeq ($(USE_VERBOSE_COMPILE),yes) ifeq ($(OPT_VERBOSE_COMPILE),yes)
$(XOC) -O binary $< $@ $(XOC) -O binary $< $@
else else
@echo Creating $@ @echo Creating $@
@ -298,7 +314,7 @@ ifeq ($(OPT_COPY_EXE),yes)
endif endif
%.dmp: %.elf %.dmp: %.elf
ifeq ($(USE_VERBOSE_COMPILE),yes) ifeq ($(OPT_VERBOSE_COMPILE),yes)
$(XOD) -x --syms $< > $@ $(XOD) -x --syms $< > $@
else else
@echo Creating $@ @echo Creating $@
@ -311,7 +327,7 @@ endif
# Goodness knows why we would want this. # Goodness knows why we would want this.
gcov: gcov:
-mkdir gcov -mkdir gcov
$(COV) -u $(subst /,\,$(SRC)) $(COV) -u $(subst /,\,$(SRC_NOTHUMB) $(SRC_THUMB))
-mv *.gcov ./gcov -mv *.gcov ./gcov
# Include the dependency files, should be the last of the makefile except for clean # Include the dependency files, should be the last of the makefile except for clean

View File

@ -0,0 +1,20 @@
#
# 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
#
# Requirements:
#
# NONE
#
SRCFLAGS += -mcpu=arm7tdmi
LDFLAGS += -mcpu=arm7tdmi
#SRCFLAGS += -mcpu=arm7tdmi -mabi=apcs-gnu
#LDFLAGS += -mcpu=arm7tdmi -Wl,--no-warn-mismatch

View File

@ -0,0 +1,19 @@
#
# 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
#
# Requirements:
#
# NONE
#
SRCFLAGS += -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -falign-functions=16
LDFLAGS += -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16
LIBS += m

View File

@ -0,0 +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
#
# Requirements:
#
# NONE
#
SRCFLAGS += -m64
LDFLAGS += -m64

View File

@ -0,0 +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
#
# Requirements:
#
# NONE
#
SRCFLAGS += -m32
LDFLAGS += -m32

View File

@ -12,6 +12,7 @@
# CHIBIOS: The location of the ChibiOS code eg CHIBIOS=../chibios # CHIBIOS: The location of the ChibiOS code eg CHIBIOS=../chibios
# 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
# CHIBIOS_CPUCLASS The class of the CPU. Only required for ChibiOS v3 eg CHIBIOS_CPUCLASS=ARMCMx
# #
# Optional: # Optional:
@ -20,6 +21,8 @@
# CHIBIOS_BOARD The name of the ChibiOS board eg CHIBIOS_BOARD=OLIMEX_SAM7_EX256 - if not specified you must include equivalent code yourself # 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_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 # CHIBIOS_VERSION Which version of ChibiOS is this (2 or 3) - default is 2
# CHIBIOS_PROCESS_STACKSIZE Size of the ChibiOS process stack. Only useful if the link script supports it - default is 0x400
# CHIBIOS_EXCEPTIONS_STACKSIZE Size of the ChibiOS exceptopms stack. Only useful if the link script supports it - default is 0x400
# #
PATHLIST += CHIBIOS PATHLIST += CHIBIOS
@ -29,23 +32,40 @@ ifeq ($(CHIBIOS_VERSION),3)
include $(CHIBIOS)/os/hal/osal/rt/osal.mk include $(CHIBIOS)/os/hal/osal/rt/osal.mk
include $(CHIBIOS)/os/hal/ports/$(CHIBIOS_PLATFORM)/platform.mk include $(CHIBIOS)/os/hal/ports/$(CHIBIOS_PLATFORM)/platform.mk
include $(CHIBIOS)/os/rt/rt.mk include $(CHIBIOS)/os/rt/rt.mk
include $(CHIBIOS)/os/rt/ports/$(CHIBIOS_PORT).mk include $(CHIBIOS)/os/rt/ports/$(CHIBIOS_CPUCLASS)/compilers/GCC/mk/port_$(CHIBIOS_PORT).mk
ifneq ($(CHIBIOS_BOARD),)
include $(CHIBIOS)/os/hal/boards/$(CHIBIOS_BOARD)/board.mk
endif
LIBPATH += $(CHIBIOS)/os/common/ports/$(CHIBIOS_CPUCLASS)/compilers/GCC
else else
include $(CHIBIOS)/os/hal/hal.mk include $(CHIBIOS)/os/hal/hal.mk
include $(CHIBIOS)/os/hal/platforms/$(CHIBIOS_PLATFORM)/platform.mk include $(CHIBIOS)/os/hal/platforms/$(CHIBIOS_PLATFORM)/platform.mk
include $(CHIBIOS)/os/kernel/kernel.mk include $(CHIBIOS)/os/kernel/kernel.mk
include $(CHIBIOS)/os/ports/$(CHIBIOS_PORT)/port.mk include $(CHIBIOS)/os/ports/$(CHIBIOS_PORT)/port.mk
ifneq ($(CHIBIOS_BOARD),)
include $(CHIBIOS)/boards/$(CHIBIOS_BOARD)/board.mk
endif
endif endif
ifneq ($(CHIBIOS_BOARD),)
include $(CHIBIOS)/boards/$(CHIBIOS_BOARD)/board.mk
endif
ifeq ($(LDSCRIPT),) ifeq ($(LDSCRIPT),)
ifneq ($(CHIBIOS_LDSCRIPT),) ifneq ($(CHIBIOS_LDSCRIPT),)
LDSCRIPT= $(PORTLD)/$(CHIBIOS_LDSCRIPT) LDSCRIPT= $(PORTLD)/$(CHIBIOS_LDSCRIPT)
endif endif
endif endif
ifneq ($(LDSCRIPT),)
ifeq ($(CHIBIOS_PROCESS_STACKSIZE),)
LDFLAGS += -Wl,--defsym=__process_stack_size__=0x400
else
LDFLAGS += -Wl,--defsym=__process_stack_size__=$(CHIBIOS_PROCESS_STACKSIZE)
endif
ifeq ($(CHIBIOS_EXCEPTIONS_STACKSIZE),)
LDFLAGS += -Wl,--defsym=__main_stack_size__=0x400
else
LDFLAGS += -Wl,--defsym=__main_stack_size__=$(CHIBIOS_EXCEPTIONS_STACKSIZE)
endif
endif
ifeq ($(CHIBIOS_STM32LIB),yes) ifeq ($(CHIBIOS_STM32LIB),yes)
include $(CHIBIOS)/ext/stm32lib/stm32lib.mk include $(CHIBIOS)/ext/stm32lib/stm32lib.mk
SRC += $(STM32SRC) SRC += $(STM32SRC)
@ -53,7 +73,7 @@ ifeq ($(CHIBIOS_STM32LIB),yes)
INCPATH += $(STM32INC) INCPATH += $(STM32INC)
endif endif
INCPATH += $(PORTINC) $(KERNINC) $(TESTINC) \ INCPATH += $(PORTINC) $(KERNINC) $(TESTINC) $(OSALINC) \
$(HALINC) $(PLATFORMINC) $(BOARDINC) $(HALINC) $(PLATFORMINC) $(BOARDINC)
SRC += $(PORTSRC) \ SRC += $(PORTSRC) \
$(KERNSRC) \ $(KERNSRC) \
@ -61,4 +81,5 @@ SRC += $(PORTSRC) \
$(HALSRC) \ $(HALSRC) \
$(PLATFORMSRC) \ $(PLATFORMSRC) \
$(BOARDSRC) \ $(BOARDSRC) \
$(OSALSRC) \
$(PORTASM) $(PORTASM)

View File

@ -8,6 +8,7 @@ All make script files in this directory apply the following rules and assumption
Input Variables (all optional unless otherwise specified) Input Variables (all optional unless otherwise specified)
---------------------------- ----------------------------
OPT_MAKE_LIB=no|yes - Make a library instead of an program = default no
OPT_VERBOSE_COMPILE=no|yes - Turn on full compile messages - default no OPT_VERBOSE_COMPILE=no|yes - Turn on full compile messages - default no
OPT_GENERATE_LISTINGS=no|yes - Generate listing files - default no OPT_GENERATE_LISTINGS=no|yes - Generate listing files - default no
OPT_GENERATE_MAP=no|yes - Generate a map file - default no OPT_GENERATE_MAP=no|yes - Generate a map file - default no
@ -29,6 +30,7 @@ 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" XSZ - Report binary dump details - default is "$(ARCH)size"
XAR - Library archiver - default is "$(ARCH)ar"
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 ""
@ -61,6 +63,8 @@ Targets
---------------------------- ----------------------------
all all
lib
exe
clean clean
Debug Debug
cleanDebug cleanDebug