rules.mk
104 lines
| 3.8 KiB
| text/x-makefile
|
MakefileLexer
jeandet@pc-de-jeandet3.lab-lpp.local
|
r16 | #/*------------------------------------------------------------------------------ | ||
#-- This file is a part of the libuc, microcontroler library | ||||
#-- Copyright (C) 2011, Alexis Jeandet | ||||
#-- | ||||
#-- This program 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 3 of the License, or | ||||
#-- (at your option) any later version. | ||||
#-- | ||||
#-- This program 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 this program; if not, write to the Free Software | ||||
#-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||||
#------------------------------------------------------------------------------- | ||||
#-- Author : Alexis Jeandet | ||||
#-- Mail : alexis.jeandet@gmail.com | ||||
#-------------------------------------------------------------------------------*/ | ||||
#--------------------------------------------------------------------------------- | ||||
# GCC EXECUTABLES | ||||
#--------------------------------------------------------------------------------- | ||||
LIBUC_PREFIX = arm-none-eabi- | ||||
LIBUC_CC = $(LIBUC_PREFIX)gcc | ||||
LIBUC_CXX = $(LIBUC_PREFIX)g++ | ||||
LIBUC_AR = $(LIBUC_PREFIX)ar | ||||
LIBUC_RANLIB = $(LIBUC_PREFIX)ranlib | ||||
LIBUC_AS = $(LIBUC_PREFIX)as | ||||
LIBUC_LD = $(LIBUC_PREFIX)ld | ||||
LIBUC_SIZE = $(LIBUC_PREFIX)size | ||||
LIBUC_STRIP = $(LIBUC_PREFIX)strip -s | ||||
LIBUC_READELF = $(LIBUC_PREFIX)readelf | ||||
LIBUC_OBJCOPY=$(LIBUC_PREFIX)objcopy | ||||
LIBUC_OBJDUMP=$(LIBUC_PREFIX)objdump | ||||
#--------------------------------------------------------------------------------- | ||||
# GCC FLAGS | ||||
#--------------------------------------------------------------------------------- | ||||
LIBUC_FMCU = -mcpu=cortex-m4 | ||||
LIBUC_CFLAGS = -g -O3 -mlittle-endian -mthumb $(LIBUC_FMCU) | ||||
jeandet@pc-de-jeandet3.LAB-LPP.LOCAL
|
r18 | LIBUC_CFLAGS += -std=c99 #-ffreestanding | ||
jeandet@pc-de-jeandet3.lab-lpp.local
|
r16 | LIBUC_LDFLAGS = | ||
LIBUC_ODFLAGS = -x --syms | ||||
LIBUC_CPFLAGS = | ||||
LIBUC_CFLAGS_WARN_ON = -Wall | ||||
LIBUC_CFLAGS_WARN_OFF = -w | ||||
LIBUC_CFLAGS_RELEASE = -O2 | ||||
LIBUC_CFLAGS_DEBUG = -g | ||||
LIBUC_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -g | ||||
LIBUC_CFLAGS_STATIC_LIB = -fPIC | ||||
LIBUC_CFLAGS_SOFT_FPU = -msoft-float | ||||
LIBUC_CFLAGS_HARD_FPU = | ||||
LIBUC_CXXFLAGS = $(LIBUC_FMCU) | ||||
LIBUC_CXXFLAGS += -g -gdwarf-2 | ||||
LIBUC_CXXFLAGS += -Wextra -Wundef -Wcast-align -mthumb -msoft-float | ||||
LIBUC_CXXFLAGS_WARN_ON = -Wall | ||||
LIBUC_CXXFLAGS_WARN_OFF = -w | ||||
LIBUC_CXXFLAGS_RELEASE = -O2 | ||||
LIBUC_CXXFLAGS_DEBUG = -g | ||||
LIBUC_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -g | ||||
LIBUC_CXXFLAGS_STATIC_LIB = -fPIC | ||||
LIBUC_CXXFLAGS_SOFT_FPU = -msoft-float | ||||
LIBUC_CXXFLAGS_HARD_FPU = | ||||
#--------------------------------------------------------------------------------- | ||||
# DEVICE SPECIAL FILES | ||||
#--------------------------------------------------------------------------------- | ||||
jeandet@pc-de-jeandet3.LAB-LPP.LOCAL
|
r18 | LINKER_SCRIPT = $(LIBUC)/lib/src/stm32f4/CPU/$(CPUMODEL)/stm32_flash.ld | ||
jeandet@pc-de-jeandet3.lab-lpp.local
|
r16 | STM32F4_INCDIR = $(ARCHFOLDER) | ||
jeandet@pc-de-jeandet3.LAB-LPP.LOCAL
|
r18 | INCLUDES = $(STM32F4_INCDIR) | ||
jeandet@pc-de-jeandet3.lab-lpp.local
|
r16 | CFLAGS = $(LIBUC_CFLAGS) | ||
jeandet@pc-de-jeandet3.LAB-LPP.LOCAL
|
r18 | SOURCES += syscalls.c | ||
SOURCES += startup_stm32f4xx.s | ||||
SOURCES += fs.c | ||||
jeandet@pc-de-jeandet3.lab-lpp.local
|
r16 | |||
jeandet@pc-de-jeandet3.LAB-LPP.LOCAL
|
r18 | APPOBJECTFILES += $(OBJDIR)/syscalls.o | ||
APPOBJECTFILES += $(OBJDIR)/startup_stm32f4xx.o | ||||
APPOBJECTFILES += $(OBJDIR)/fs.o | ||||
first: all | ||||
jeandet@pc-de-jeandet3.lab-lpp.local
|
r16 | |||
jeandet@pc-de-jeandet3.LAB-LPP.LOCAL
|
r18 | $(OBJDIR)/syscalls.o: $(LIBUC)/rules/stm32f4-arm-none-eabi-gcc/syscalls.c $(OBJDIR) | ||
jeandet@pc-de-jeandet3.lab-lpp.local
|
r16 | $(LIBUC_CC) -O3 -I $(INCLUDES) -c $(CFLAGS) $< -o $@ | ||
jeandet@pc-de-jeandet3.LAB-LPP.LOCAL
|
r18 | $(OBJDIR)/startup_stm32f4xx.o: $(LIBUC)/lib/src/stm32f4/CPU/$(CPUMODEL)/startup_stm32f4xx.s $(OBJDIR) | ||
$(LIBUC_CC) -O3 -I $(INCLUDES) -c $(CFLAGS) $< -o $@ | ||||
jeandet@pc-de-jeandet3.lab-lpp.local
|
r16 | |||
jeandet@pc-de-jeandet3.LAB-LPP.LOCAL
|
r18 | $(OBJDIR)/fs.o: $(LIBUC)/lib/src/stm32f4/CPU/$(CPUMODEL)/fs.c $(OBJDIR) | ||
$(LIBUC_CC) -O3 -I $(INCLUDES) -c $(CFLAGS) $< -o $@ | ||||
jeandet@pc-de-jeandet3.lab-lpp.local
|
r16 | |||