]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/ARM7_AT91FR40008_GCC/Makefile
Update to MIT licensed FreeRTOS V10.0.0 - see https://www.freertos.org/History.txt
[freertos] / FreeRTOS / Demo / ARM7_AT91FR40008_GCC / Makefile
1 #/*\r
2 # * FreeRTOS Kernel V10.0.0\r
3 # * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
4 # *\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
11 # *\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
15 # *\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
22 # *\r
23 # * http://www.FreeRTOS.org\r
24 # * http://aws.amazon.com/freertos\r
25 # *\r
26 # * 1 tab == 4 spaces!\r
27 # */\r
28 \r
29 CC=arm-elf-gcc\r
30 OBJCOPY=arm-elf-objcopy\r
31 ARCH=arm-elf-ar\r
32 CRT0=boot.s\r
33 \r
34 #\r
35 # CFLAGS common to both the THUMB and ARM mode builds\r
36 #\r
37 CFLAGS=-Wall -Wextra -D $(RUN_MODE) -D GCC_AT91FR40008 -I. -I../../Source/include \\r
38                 -I../Common/include $(DEBUG) -mcpu=arm7tdmi -T$(LDSCRIPT) \\r
39                 -Wcast-align $(OPTIM) -fomit-frame-pointer -fno-strict-aliasing \\r
40                 -fno-dwarf2-cfi-asm\r
41 \r
42 ifeq ($(USE_THUMB_MODE),YES)\r
43         CFLAGS += -mthumb-interwork -D THUMB_INTERWORK\r
44         THUMB_FLAGS=-mthumb\r
45 endif\r
46 \r
47 \r
48 LINKER_FLAGS=-Xlinker -ortosdemo.elf -Xlinker -M -Xlinker -Map=rtosdemo.map\r
49 \r
50 #\r
51 # Source files that can be built to THUMB mode.\r
52 #\r
53 THUMB_SRC = \\r
54 main.c \\r
55 serial/serial.c \\r
56 ParTest/ParTest.c \\r
57 ../Common/Minimal/integer.c \\r
58 ../Common/Minimal/flash.c \\r
59 ../Common/Minimal/PollQ.c \\r
60 ../Common/Minimal/comtest.c \\r
61 ../Common/Minimal/flop.c \\r
62 ../Common/Minimal/semtest.c \\r
63 ../Common/Minimal/dynamic.c \\r
64 ../Common/Minimal/BlockQ.c \\r
65 ../../Source/tasks.c \\r
66 ../../Source/queue.c \\r
67 ../../Source/list.c \\r
68 ../../Source/portable/MemMang/heap_2.c \\r
69 ../../Source/portable/GCC/ARM7_AT91FR40008/port.c\r
70 \r
71 #\r
72 # Source files that must be built to ARM mode.\r
73 #\r
74 ARM_SRC = \\r
75 ../../Source/portable/GCC/ARM7_AT91FR40008/portISR.c \\r
76 serial/serialISR.c\r
77 \r
78 #\r
79 # Define all object files.\r
80 #\r
81 ARM_OBJ = $(ARM_SRC:.c=.o)\r
82 THUMB_OBJ = $(THUMB_SRC:.c=.o)\r
83 \r
84 rtosdemo.hex : rtosdemo.elf\r
85         $(OBJCOPY) rtosdemo.elf -O ihex rtosdemo.hex\r
86 \r
87 rtosdemo.elf : $(ARM_OBJ) $(THUMB_OBJ) $(CRT0) Makefile\r
88         $(CC) $(CFLAGS) $(ARM_OBJ) $(THUMB_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)\r
89 \r
90 $(THUMB_OBJ) : %.o : %.c $(LDSCRIPT) Makefile\r
91         $(CC) -c $(THUMB_FLAGS) $(CFLAGS) $< -o $@\r
92 \r
93 $(ARM_OBJ) : %.o : %.c $(LDSCRIPT) Makefile\r
94         $(CC) -c $(CFLAGS) $< -o $@\r
95 \r
96 clean :\r
97         touch Makefile\r
98         rm $(ARM_OBJ)\r
99         rm $(THUMB_OBJ)\r
100 \r