2 # * FreeRTOS Kernel V10.1.1
3 # * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5 # * Permission is hereby granted, free of charge, to any person obtaining a copy of
6 # * this software and associated documentation files (the "Software"), to deal in
7 # * the Software without restriction, including without limitation the rights to
8 # * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 # * the Software, and to permit persons to whom the Software is furnished to do so,
10 # * subject to the following conditions:
12 # * The above copyright notice and this permission notice shall be included in all
13 # * copies or substantial portions of the Software.
15 # * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 # * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 # * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 # * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 # * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 # * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 # * http://www.FreeRTOS.org
23 # * http://aws.amazon.com/freertos
25 # * 1 tab == 4 spaces!
29 OBJCOPY=arm-elf-objcopy
34 # CFLAGS common to both the THUMB and ARM mode builds
36 CFLAGS=-Wall -Wextra -D $(RUN_MODE) -D GCC_AT91FR40008 -I. -I../../Source/include \
37 -I../Common/include $(DEBUG) -mcpu=arm7tdmi -T$(LDSCRIPT) \
38 -Wcast-align $(OPTIM) -fomit-frame-pointer -fno-strict-aliasing \
41 ifeq ($(USE_THUMB_MODE),YES)
42 CFLAGS += -mthumb-interwork -D THUMB_INTERWORK
47 LINKER_FLAGS=-Xlinker -ortosdemo.elf -Xlinker -M -Xlinker -Map=rtosdemo.map
50 # Source files that can be built to THUMB mode.
56 ../Common/Minimal/integer.c \
57 ../Common/Minimal/flash.c \
58 ../Common/Minimal/PollQ.c \
59 ../Common/Minimal/comtest.c \
60 ../Common/Minimal/flop.c \
61 ../Common/Minimal/semtest.c \
62 ../Common/Minimal/dynamic.c \
63 ../Common/Minimal/BlockQ.c \
64 ../../Source/tasks.c \
65 ../../Source/queue.c \
67 ../../Source/portable/MemMang/heap_2.c \
68 ../../Source/portable/GCC/ARM7_AT91FR40008/port.c
71 # Source files that must be built to ARM mode.
74 ../../Source/portable/GCC/ARM7_AT91FR40008/portISR.c \
78 # Define all object files.
80 ARM_OBJ = $(ARM_SRC:.c=.o)
81 THUMB_OBJ = $(THUMB_SRC:.c=.o)
83 rtosdemo.hex : rtosdemo.elf
84 $(OBJCOPY) rtosdemo.elf -O ihex rtosdemo.hex
86 rtosdemo.elf : $(ARM_OBJ) $(THUMB_OBJ) $(CRT0) Makefile
87 $(CC) $(CFLAGS) $(ARM_OBJ) $(THUMB_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)
89 $(THUMB_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
90 $(CC) -c $(THUMB_FLAGS) $(CFLAGS) $< -o $@
92 $(ARM_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
93 $(CC) -c $(CFLAGS) $< -o $@