]> begriffs open source - cmsis-freertos/blob - Demo/ARM7_AT91FR40008_GCC/Makefile
Set error state if no delay or already expired
[cmsis-freertos] / Demo / ARM7_AT91FR40008_GCC / Makefile
1 #/*
2 # * FreeRTOS Kernel V10.1.1
3 # * Copyright (C) 2018 Amazon.com, Inc. or its affiliates.  All Rights Reserved.
4 # *
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:
11 # *
12 # * The above copyright notice and this permission notice shall be included in all
13 # * copies or substantial portions of the Software.
14 # *
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.
21 # *
22 # * http://www.FreeRTOS.org
23 # * http://aws.amazon.com/freertos
24 # *
25 # * 1 tab == 4 spaces!
26 # */
27
28 CC=arm-elf-gcc
29 OBJCOPY=arm-elf-objcopy
30 ARCH=arm-elf-ar
31 CRT0=boot.s
32
33 #
34 # CFLAGS common to both the THUMB and ARM mode builds
35 #
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 \
39                 -fno-dwarf2-cfi-asm
40
41 ifeq ($(USE_THUMB_MODE),YES)
42         CFLAGS += -mthumb-interwork -D THUMB_INTERWORK
43         THUMB_FLAGS=-mthumb
44 endif
45
46
47 LINKER_FLAGS=-Xlinker -ortosdemo.elf -Xlinker -M -Xlinker -Map=rtosdemo.map
48
49 #
50 # Source files that can be built to THUMB mode.
51 #
52 THUMB_SRC = \
53 main.c \
54 serial/serial.c \
55 ParTest/ParTest.c \
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 \
66 ../../Source/list.c \
67 ../../Source/portable/MemMang/heap_2.c \
68 ../../Source/portable/GCC/ARM7_AT91FR40008/port.c
69
70 #
71 # Source files that must be built to ARM mode.
72 #
73 ARM_SRC = \
74 ../../Source/portable/GCC/ARM7_AT91FR40008/portISR.c \
75 serial/serialISR.c
76
77 #
78 # Define all object files.
79 #
80 ARM_OBJ = $(ARM_SRC:.c=.o)
81 THUMB_OBJ = $(THUMB_SRC:.c=.o)
82
83 rtosdemo.hex : rtosdemo.elf
84         $(OBJCOPY) rtosdemo.elf -O ihex rtosdemo.hex
85
86 rtosdemo.elf : $(ARM_OBJ) $(THUMB_OBJ) $(CRT0) Makefile
87         $(CC) $(CFLAGS) $(ARM_OBJ) $(THUMB_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)
88
89 $(THUMB_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
90         $(CC) -c $(THUMB_FLAGS) $(CFLAGS) $< -o $@
91
92 $(ARM_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
93         $(CC) -c $(CFLAGS) $< -o $@
94
95 clean :
96         touch Makefile
97         rm $(ARM_OBJ)
98         rm $(THUMB_OBJ)
99