| Line 1... |
Line 1... |
| 1 |
CCACHE ?= $(shell which ccache)
|
1 |
CCACHE ?= $(shell which ccache)
|
| - |
|
2 |
|
| - |
|
3 |
CROSS ?= arm-none-eabi-
|
| - |
|
4 |
ifeq ($(shell which $(CROSS)gcc),)
|
| 2 |
CROSS ?= arm-elf-eabi-
|
5 |
CROSS := arm-elf-eabi-
|
| - |
|
6 |
endif
|
| - |
|
7 |
|
| - |
|
8 |
FLTO ?= -flto -flto-partition=none
|
| - |
|
9 |
ifneq ($(shell LC_ALL=C $(CROSS)gcc -flto 2>&1 | grep 'unrecognized command line option'),)
|
| - |
|
10 |
FLTO :=
|
| - |
|
11 |
endif
|
| - |
|
12 |
|
| 3 |
CC := $(CCACHE) $(CROSS)gcc
|
13 |
CC := $(CCACHE) $(CROSS)gcc
|
| 4 |
LD := $(CROSS)ld
|
14 |
LD := $(CROSS)ld
|
| 5 |
OBJCOPY := $(CROSS)objcopy
|
15 |
OBJCOPY := $(CROSS)objcopy
|
| 6 |
OBJDUMP := $(CROSS)objdump
|
16 |
OBJDUMP := $(CROSS)objdump
|
| 7 |
|
17 |
|
| 8 |
CFLAGS_GENERAL := -c -ffunction-sections -fdata-sections -fmessage-length=0 -Wall $(CFLAGS_GENERAL)
|
18 |
CFLAGS_GENERAL := -c -ffunction-sections -fdata-sections -fmessage-length=0 -Wall $(CFLAGS_GENERAL)
|
| 9 |
CFLAGS_ASM := -x assembler-with-cpp $(CFLAGS_ASM)
|
19 |
CFLAGS_ASM := -x assembler-with-cpp $(CFLAGS_ASM)
|
| 10 |
CFLAGS_debug := -O0 -g3 -gdwarf-2 $(CFLAGS_DEBUG)
|
20 |
CFLAGS_debug := -O0 -g3 -gdwarf-2 $(CFLAGS_DEBUG)
|
| 11 |
CFLAGS_release := -flto -flto-partition=none -Os -fno-pie -fno-stack-protector -fomit-frame-pointer $(CFLAGS_RELEASE)
|
21 |
CFLAGS_release := $(FLTO) -Os -fno-pie -fno-stack-protector -fomit-frame-pointer $(CFLAGS_RELEASE)
|
| 12 |
LDFLAGS_GENERAL := -nostdlib --gc-sections $(LDFLAGS_GENERAL)
|
22 |
LDFLAGS_GENERAL := -nostdlib --gc-sections $(LDFLAGS_GENERAL)
|
| 13 |
LDFLAGS_debug := -O0 $(LDFLAGS_DEBUG)
|
23 |
LDFLAGS_debug := -O0 $(LDFLAGS_DEBUG)
|
| 14 |
LDFLAGS_release := -flto -flto-partition=none -Os $(LDFLAGS_RELEASE)
|
24 |
LDFLAGS_release := $(FLTO) -Os $(LDFLAGS_RELEASE)
|
| 15 |
PPFLAGS_GENERAL := -DTARGET_$(subst /,_,$(TARGET)) -DTARGET=$(TARGET) -DCONFIG_H=target/$(TARGET)/config.h -DTARGET_H=target/$(TARGET)/target.h -Isrc
|
25 |
PPFLAGS_GENERAL := -DTARGET_$(subst /,_,$(TARGET)) -DTARGET=$(TARGET) -DCONFIG_H=target/$(TARGET)/config.h -DTARGET_H=target/$(TARGET)/target.h -Isrc
|
| 16 |
PPFLAGS_debug := -DDEBUG
|
26 |
PPFLAGS_debug := -DDEBUG
|
| 17 |
PPFLAGS_release := -DRELEASE
|
27 |
PPFLAGS_release := -DRELEASE
|
| 18 |
PPONLY_FLAGS := -E -P -x c -DASM_FILE
|
28 |
PPONLY_FLAGS := -E -P -x c -DASM_FILE
|
| 19 |
SPEC_FLAGS := -E -P -v -dD
|
29 |
SPEC_FLAGS := -E -P -v -dD
|