2 # * FreeRTOS Kernel V10.0.0
\r
3 # * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
\r
5 # * Permission is hereby granted, free of charge, to any person obtaining a copy of
\r
6 # * this software and associated documentation files (the "Software"), to deal in
\r
7 # * the Software without restriction, including without limitation the rights to
\r
8 # * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
\r
9 # * the Software, and to permit persons to whom the Software is furnished to do so,
\r
10 # * subject to the following conditions:
\r
12 # * The above copyright notice and this permission notice shall be included in all
\r
13 # * copies or substantial portions of the Software. If you wish to use our Amazon
\r
14 # * FreeRTOS name, please do so in a fair use way that does not cause confusion.
\r
16 # * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
17 # * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
\r
18 # * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
\r
19 # * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
\r
20 # * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
21 # * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
23 # * http://www.FreeRTOS.org
\r
24 # * http://aws.amazon.com/freertos
\r
26 # * 1 tab == 4 spaces!
\r
30 OBJCOPY=arm-elf-objcopy
\r
33 WARNINGS=-Wall -Wextra -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare \
\r
34 -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wunused
\r
37 # CFLAGS common to both the THUMB and ARM mode builds
\r
39 CFLAGS=$(WARNINGS) -D $(RUN_MODE) -D GCC_ARM7 -I. -I../../Source/include \
\r
40 -I../Common/include $(DEBUG) -mcpu=arm7tdmi -T$(LDSCRIPT) \
\r
41 $(OPTIM) -fomit-frame-pointer -fno-strict-aliasing -fno-dwarf2-cfi-asm
\r
43 ifeq ($(USE_THUMB_MODE),YES)
\r
44 CFLAGS += -mthumb-interwork -D THUMB_INTERWORK
\r
49 LINKER_FLAGS=-Xlinker -ortosdemo.elf -Xlinker -M -Xlinker -Map=rtosdemo.map
\r
51 RTOS_SOURCE_DIR=../../Source
\r
52 DEMO_SOURCE_DIR=../Common/Minimal
\r
54 # Source files that can be built to THUMB mode.
\r
60 $(DEMO_SOURCE_DIR)/integer.c \
\r
61 $(DEMO_SOURCE_DIR)/flash.c \
\r
62 $(DEMO_SOURCE_DIR)/PollQ.c \
\r
63 $(DEMO_SOURCE_DIR)/comtest.c \
\r
64 $(DEMO_SOURCE_DIR)/flop.c \
\r
65 $(DEMO_SOURCE_DIR)/semtest.c \
\r
66 $(DEMO_SOURCE_DIR)/dynamic.c \
\r
67 $(DEMO_SOURCE_DIR)/BlockQ.c \
\r
68 $(RTOS_SOURCE_DIR)/tasks.c \
\r
69 $(RTOS_SOURCE_DIR)/queue.c \
\r
70 $(RTOS_SOURCE_DIR)/list.c \
\r
71 $(RTOS_SOURCE_DIR)/portable/MemMang/heap_2.c \
\r
72 $(RTOS_SOURCE_DIR)/portable/GCC/ARM7_LPC2000/port.c
\r
75 # Source files that must be built to ARM mode.
\r
78 $(RTOS_SOURCE_DIR)/portable/GCC/ARM7_LPC2000/portISR.c \
\r
82 # Define all object files.
\r
84 ARM_OBJ = $(ARM_SRC:.c=.o)
\r
85 THUMB_OBJ = $(THUMB_SRC:.c=.o)
\r
87 rtosdemo.hex : rtosdemo.elf
\r
88 $(OBJCOPY) rtosdemo.elf -O ihex rtosdemo.hex
\r
90 rtosdemo.elf : $(ARM_OBJ) $(THUMB_OBJ) $(CRT0) Makefile
\r
91 $(CC) $(CFLAGS) $(ARM_OBJ) $(THUMB_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)
\r
93 $(THUMB_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
\r
94 $(CC) -c $(THUMB_FLAGS) $(CFLAGS) $< -o $@
\r
96 $(ARM_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
\r
97 $(CC) -c $(CFLAGS) $< -o $@
\r
100 rm -rf $(ARM_OBJ) $(THUMB_OBJ)
\r