-
Notifications
You must be signed in to change notification settings - Fork 33
/
Makefile.common
54 lines (45 loc) · 1.38 KB
/
Makefile.common
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
#
# Copyright 2015 Stephen Street <stephen@redrocketcomputing.com>
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
ifeq (${.DEFAULT_GOAL},)
.DEFAULT_GOAL := all
endif
ifeq ("$(origin V)", "command line")
VERBOSE = ${V}
endif
ifndef VERBOSE
VERBOSE = 0
endif
ifeq (${VERBOSE},1)
quiet =
Q =
else
quiet = (${1})
Q = @
endif
export TOOLS_ROOT ?= ${PROJECT_ROOT}/tools
export BUILD_ROOT ?= ${OUTPUT_ROOT}/${BUILD_TYPE}
CC := ${CROSS_COMPILE}gcc
CXX := ${CROSS_COMPILE}g++
LD := ${CROSS_COMPILE}gcc
AR := ${CROSS_COMPILE}ar
AS := ${CROSS_COMPILE}as
OBJCOPY := ${CROSS_COMPILE}objcopy
OBJDUMP := ${CROSS_COMPILE}objdump
SIZE := ${CROSS_COMPILE}size
NM := ${CROSS_COMPILE}nm
FIND := find
CROSS_FLAGS := -mthumb -mcpu=cortex-m${CORTEX_M}
ARFLAGS := cr
ASFLAGS := ${CROSS_FLAGS}
CFLAGS := ${CROSS_FLAGS} -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -Wunused -Wuninitialized -Wmissing-declarations -std=c11 -mpoke-function-name -funwind-tables -fno-omit-frame-pointer
CPPFLAGS += -DBUILD_TYPE="${BUILD_TYPE}"
LDFLAGS := ${CROSS_FLAGS} -Wl,--gc-sections -Wl,--cref -Wl,-Map,"$(basename ${TARGET}).map"
LDLIBS :=
LOADLIBES :=
-include ${PROJECT_ROOT}/Makefile.${BUILD_TYPE}
-include ${SOURCE_DIR}/Makefile.${BUILD_TYPE}