]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/Posix_GCC/src/SConscript
commit 9f316c246baafa15c542a5aea81a94f26e3d6507
[freertos] / FreeRTOS / Demo / Posix_GCC / src / SConscript
1 # FreeRTOS Kernel V10.3.0
2 # Copyright (C) 2020 Cambridge Consultants Ltd.
3 #
4 # Permission is hereby granted, free of charge, to any person obtaining a copy of
5 # this software and associated documentation files (the "Software"), to deal in
6 # the Software without restriction, including without limitation the rights to
7 # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8 # the Software, and to permit persons to whom the Software is furnished to do so,
9 # subject to the following conditions:
10 #
11 # The above copyright notice and this permission notice shall be included in all
12 # copies or substantial portions of the Software.
13 #
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16 # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17 # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18 # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 #
21 # http://www.FreeRTOS.org
22 # http://aws.amazon.com/freertos
23
24 Import("env")
25
26 env.Append(CPPPATH = [
27     ".",
28     "FreeRTOS/Source/include",
29     "FreeRTOS/Source/portable/ThirdParty/GCC/Posix",
30     "FreeRTOS/Demo/Common/include",
31     "FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include",
32 ])
33
34 env.Append(LIBS = [
35     "pthread",
36 ])
37
38 src = [
39     "console.c",
40     "main.c",
41     "main_blinky.c",
42     "main_full.c",
43     "run-time-stats-utils.c",
44
45     # FreeRTOS kernel
46     "FreeRTOS/Source/event_groups.c",
47     "FreeRTOS/Source/list.c",
48     "FreeRTOS/Source/queue.c",
49     "FreeRTOS/Source/stream_buffer.c",
50     "FreeRTOS/Source/tasks.c",
51     "FreeRTOS/Source/timers.c",
52
53     # Memory manager (use malloc()/free()).
54     "FreeRTOS/Source/portable/MemMang/heap_3.c",
55
56     # Posix port.
57     "FreeRTOS/Source/portable/ThirdParty/GCC/Posix/port.c",
58
59     # Demo library.
60     "FreeRTOS/Demo/Common/Minimal/AbortDelay.c",
61     "FreeRTOS/Demo/Common/Minimal/BlockQ.c",
62     "FreeRTOS/Demo/Common/Minimal/blocktim.c",
63     "FreeRTOS/Demo/Common/Minimal/countsem.c",
64     "FreeRTOS/Demo/Common/Minimal/death.c",
65     "FreeRTOS/Demo/Common/Minimal/dynamic.c",
66     "FreeRTOS/Demo/Common/Minimal/EventGroupsDemo.c",
67     "FreeRTOS/Demo/Common/Minimal/flop.c",
68     "FreeRTOS/Demo/Common/Minimal/GenQTest.c",
69     "FreeRTOS/Demo/Common/Minimal/integer.c",
70     "FreeRTOS/Demo/Common/Minimal/IntSemTest.c",
71     "FreeRTOS/Demo/Common/Minimal/MessageBufferAMP.c",
72     "FreeRTOS/Demo/Common/Minimal/MessageBufferDemo.c",
73     "FreeRTOS/Demo/Common/Minimal/PollQ.c",
74     "FreeRTOS/Demo/Common/Minimal/QPeek.c",
75     "FreeRTOS/Demo/Common/Minimal/QueueOverwrite.c",
76     "FreeRTOS/Demo/Common/Minimal/QueueSet.c",
77     "FreeRTOS/Demo/Common/Minimal/QueueSetPolling.c",
78     "FreeRTOS/Demo/Common/Minimal/recmutex.c",
79     "FreeRTOS/Demo/Common/Minimal/semtest.c",
80     "FreeRTOS/Demo/Common/Minimal/StaticAllocation.c",
81     "FreeRTOS/Demo/Common/Minimal/StreamBufferDemo.c",
82     "FreeRTOS/Demo/Common/Minimal/StreamBufferInterrupt.c",
83     "FreeRTOS/Demo/Common/Minimal/TaskNotify.c",
84     "FreeRTOS/Demo/Common/Minimal/TimerDemo.c",
85 ]
86
87 if GetOption("coverage"):
88     env.Append(CPPDEFINES = [
89         "projCOVERAGE_TEST=1",
90     ])
91
92     env.Append(CFLAGS = [
93         "-fprofile-arcs",
94         "-ftest-coverage",
95     ])
96     env.Append(LINKFLAGS = [
97         "-fprofile-arcs",
98         "-ftest-coverage",
99     ])
100
101     src += [
102         "code_coverage_additions.c",
103     ]
104 else:
105     env.Append(CPPDEFINES = [
106         "projCOVERAGE_TEST=0",
107     ])
108
109     src += [
110         # Trace library.
111         "FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcKernelPort.c",
112         "FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcSnapshotRecorder.c",
113         "FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcStreamingRecorder.c",
114         "FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/streamports/File/trcStreamingPort.c",
115     ]
116
117 # Build the simple "blinky" demo application, or the full test
118 # applicaton?
119 if GetOption("simple"):
120     env.Append(CPPDEFINES = [
121         "mainCREATE_SIMPLE_BLINKY_DEMO_ONLY=1",
122     ])
123
124 env.Program("posix_demo", src)