forked from phoenix-rtos/phoenix-rtos-usb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.armv7
51 lines (42 loc) · 1.44 KB
/
Makefile.armv7
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
#
# Makefile for phoenix-rtos-usb
#
# ARMv7 (Cortex-M3/M4) options
#
# Copyright 2018 Phoenix Systems
#
CROSS ?= arm-phoenix-
SUBDIRS = multi/stm32-multi
MKDEP = $(CROSS)gcc -MM
MKDEPFLAGS = $(CFLAGS)
CC = $(CROSS)gcc
ifeq ($(DEBUG), 1)
CFLAGS += -Og -g
else
CFLAGS += -O2 -DNDEBUG
endif
ifneq (, $(findstring imxrt, $(TARGET)))
#FIXME: -mfpu=fpv5-d16 does not work with current toolchain
CFLAGS += -Wall -Wstrict-prototypes -g -I$(SRCDIR) -nostartfiles -nostdlib\
-mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-sp-d16 -mthumb -fomit-frame-pointer\
-ffreestanding -mno-unaligned-access\
-fpic -fpie -msingle-pic-base -mno-pic-data-is-text-relative\
-DVERSION=\"$(VERSION)\" -DARCH=\"arch/armv7/arch.h\" -DNOMMU
else
CFLAGS += -Wall -Wstrict-prototypes -g -I$(SRCDIR) -nostartfiles -nostdlib\
-mcpu=cortex-m3 -mthumb -fomit-frame-pointer -ffreestanding -mno-unaligned-access\
-fpic -fpie -msingle-pic-base -mno-pic-data-is-text-relative\
-DVERSION=\"$(VERSION)\" -DARCH=\"arch/armv7/arch.h\" -DNOMMU
endif
CFLAGS += -fdata-sections -ffunction-sections
AR = $(CROSS)ar
ARFLAGS = -r
LD = $(CROSS)ld
LDFLAGS = -nostdlib -e _start --section-start .text=0 -Tbss=20000000 -z max-page-size=0x10
LDFLAGS += --gc-sections
GCCLIB := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
PHOENIXLIB := $(shell $(CC) $(CFLAGS) -print-file-name=libphoenix.a)
LDLIBS := $(PHOENIXLIB) $(GCCLIB)
OBJCOPY = $(CROSS)objcopy
OBJDUMP = $(CROSS)objdump
STRIP = $(CROSS)strip