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
32 WARNINGS=-Wall -Wextra -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare \
33 -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wunused
36 # CFLAGS common to both the THUMB and ARM mode builds
38 CFLAGS=$(WARNINGS) -D $(RUN_MODE) -D GCC_ARM7 -I. -I../../Source/include \
39 -I../Common/include $(DEBUG) -mcpu=arm7tdmi -T$(LDSCRIPT) \
40 $(OPTIM) -fomit-frame-pointer -fno-strict-aliasing -fno-dwarf2-cfi-asm
42 ifeq ($(USE_THUMB_MODE),YES)
43 CFLAGS += -mthumb-interwork -D THUMB_INTERWORK
48 LINKER_FLAGS=-Xlinker -ortosdemo.elf -Xlinker -M -Xlinker -Map=rtosdemo.map
50 RTOS_SOURCE_DIR=../../Source
51 DEMO_SOURCE_DIR=../Common/Minimal
53 # Source files that can be built to THUMB mode.
59 $(DEMO_SOURCE_DIR)/integer.c \
60 $(DEMO_SOURCE_DIR)/flash.c \
61 $(DEMO_SOURCE_DIR)/PollQ.c \
62 $(DEMO_SOURCE_DIR)/comtest.c \
63 $(DEMO_SOURCE_DIR)/flop.c \
64 $(DEMO_SOURCE_DIR)/semtest.c \
65 $(DEMO_SOURCE_DIR)/dynamic.c \
66 $(DEMO_SOURCE_DIR)/BlockQ.c \
67 $(RTOS_SOURCE_DIR)/tasks.c \
68 $(RTOS_SOURCE_DIR)/queue.c \
69 $(RTOS_SOURCE_DIR)/list.c \
70 $(RTOS_SOURCE_DIR)/portable/MemMang/heap_2.c \
71 $(RTOS_SOURCE_DIR)/portable/GCC/ARM7_LPC2000/port.c
74 # Source files that must be built to ARM mode.
77 $(RTOS_SOURCE_DIR)/portable/GCC/ARM7_LPC2000/portISR.c \
81 # Define all object files.
83 ARM_OBJ = $(ARM_SRC:.c=.o)
84 THUMB_OBJ = $(THUMB_SRC:.c=.o)
86 rtosdemo.hex : rtosdemo.elf
87 $(OBJCOPY) rtosdemo.elf -O ihex rtosdemo.hex
89 rtosdemo.elf : $(ARM_OBJ) $(THUMB_OBJ) $(CRT0) Makefile
90 $(CC) $(CFLAGS) $(ARM_OBJ) $(THUMB_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)
92 $(THUMB_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
93 $(CC) -c $(THUMB_FLAGS) $(CFLAGS) $< -o $@
95 $(ARM_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
96 $(CC) -c $(CFLAGS) $< -o $@
99 rm -rf $(ARM_OBJ) $(THUMB_OBJ)