-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfig.mk
88 lines (67 loc) · 1.89 KB
/
Config.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#
# Project directories
#
BINDIR = $(ROOT)/bin
SRCDIR = $(ROOT)/src
INCDIR = $(ROOT)/include
FIRMDIR = $(ROOT)/firmware
TESTDIR = $(ROOT)/tests
SRCDIR_TEST = $(ROOT)/tests
BINDIR_TEST = $(ROOT)/tests/bin
LIBDIR_TEST = $(ROOT)/tests/libtap
LIBSRC_TEST = $(LIBDIR_TEST)/tap.c
LIBOBJ_TEST = $(BINDIR_TEST)/tap.o
SUBDIRS = $(SRCDIR)
#
# Files
#
ASMEXT = s
CEXT = c
CPPEXT = cpp
HEXT = h
OEXT = o
CEXT_TEST = test.c
OEXT_TEST = test.o
OUTBIN = output.bin
OUTNAME = output.elf
#
# Device
#
# Makefile for IFI VeX Cortex Microcontroller (STM32F103VD series)
DEVICE = VexCortex
# Libraries to include in the link (use -L and -l) e.g. -lm, -lmyLib
LIBRARIES = $(FIRMDIR)/libccos.a -lgcc -lm
# Prefix for ARM tools (must be on the path)
MCUPREFIX = arm-none-eabi-
# Assembler
MCUAFLAGS = -mthumb -mcpu=cortex-m3 -mlittle-endian
# Compiler
MCUCFLAGS = -mthumb -mcpu=cortex-m3 -mlittle-endian
# Linker
MCULFLAGS = -nostartfiles -Wl,-static -Bfirmware -Wl,-u,VectorTable -Wl,-T -Xlinker $(FIRMDIR)/cortex.ld
# Prepares the elf file by converting it to a binary that java can write
MCUPREPARE = $(OBJCOPY) $(OUT) -O binary $(BINDIR)/$(OUTBIN)
# Advanced sizing flags
SIZEFLAGS =
# Uploads program using java
UPLOAD = @java -jar $(FIRMDIR)/uniflash.jar vex $(BINDIR)/$(OUTBIN)
#
# Program Flags
#
AFLAGS := $(MCUAFLAGS)
ARFLAGS := $(MCUCFLAGS)
CCFLAGS := -c -Wall $(MCUCFLAGS) -Os -ffunction-sections -fsigned-char -fomit-frame-pointer -fsingle-precision-constant
CFLAGS := $(CCFLAGS) -std=gnu99 -Werror=implicit-function-declaration
CPPFLAGS := $(CCFLAGS) -fno-exceptions -fno-rtti -felide-constructors
LDFLAGS := -Wall $(MCUCFLAGS) $(MCULFLAGS) -Wl,--gc-sections
CFLAGS_TEST := -c -Wall -std=gnu99 -Werror=implicit-function-declaration
LDFLAGS_TEST := -Wall -Wl,--gc-sections
#
# Tools
#
AR := $(MCUPREFIX)ar
AS := $(MCUPREFIX)as
CC := $(MCUPREFIX)gcc
CPPCC := $(MCUPREFIX)g++
OBJCOPY := $(MCUPREFIX)objcopy
CC_TEST := gcc