]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/ColdFire_MCF5282_Eclipse/RTOSDemo/Makefile
Add FreeRTOS-Plus directory.
[freertos] / FreeRTOS / Demo / ColdFire_MCF5282_Eclipse / RTOSDemo / Makefile
1 RM := rm -rf\r
2 \r
3 # Set the optimisation level - this should be set to 0, 1, 2, 3 or s (s for size).\r
4 OPTIM=s\r
5 \r
6 ###############################################################################\r
7 # List the directories that contain files to be built.\r
8 ###############################################################################\r
9 \r
10 # These two directories contain the FreeRTOS.org kernel source files.\r
11 FREERTOS_SOURCE_DIR=./../../../Source\r
12 PORT_SOURCE_DIR=./../../../Source/portable/GCC/ColdFire_V2\r
13 \r
14 # This directory contains the standard demo files that get included in every\r
15 # FreeRTOS.org demo.  They define tasks that demonstrate the API usage and \r
16 # test the FreeRTOS.org port.\r
17 COMMON_DEMO_SOURCE_DIR=./../../Common/Minimal\r
18 \r
19 # The lwIP stack source files.\r
20 LWIP_ROOT_DIR=./../../Common/ethernet/lwIP_130\r
21 \r
22 VPATH=          $(FREERTOS_SOURCE_DIR) : \\r
23                         $(PORT_SOURCE_DIR) : \\r
24                         $(COMMON_DEMO_SOURCE_DIR) : \\r
25                         $(FREERTOS_SOURCE_DIR)/portable/MemMang : \\r
26                         . : \\r
27                         ./ParTest : \\r
28                         ./serial\r
29 \r
30 \r
31 ###############################################################################\r
32 # Define a few constants to be used during the build.\r
33 ###############################################################################\r
34 \r
35 OUTPUT_DIR=./bin\r
36 CPU=528x\r
37 LINKER_SCRIPT=m5282evb-dram_code-rambar_data-hosted.ld\r
38 OUTPUT_FILENAME=RTOSDemo.elf\r
39 CC=m68k-elf-gcc\r
40 AS=m68K-elf-as\r
41 \r
42 \r
43 ###############################################################################\r
44 # List the files to include in the build.  These files will be located from the\r
45 # VPATH defined above.\r
46 ###############################################################################\r
47 \r
48 # The FreeRTOS.org source files.\r
49 FreeRTOS_OBJS=                  $(OUTPUT_DIR)/portasm.o \\r
50                                                 $(OUTPUT_DIR)/port.o \\r
51                                                 $(OUTPUT_DIR)/list.o \\r
52                                                 $(OUTPUT_DIR)/tasks.o \\r
53                                                 $(OUTPUT_DIR)/queue.o \\r
54                                                 $(OUTPUT_DIR)/heap_2.o\r
55 \r
56 # The demo app source files.\r
57 Demo_OBJS=                              $(OUTPUT_DIR)/main.o \\r
58                                                 $(OUTPUT_DIR)/serial.o \\r
59                                                 $(OUTPUT_DIR)/comtest.o \\r
60                                                 $(OUTPUT_DIR)/flash.o \\r
61                                                 $(OUTPUT_DIR)/ParTest.o \\r
62                                                 $(OUTPUT_DIR)/BlockQ.o \\r
63                                                 $(OUTPUT_DIR)/death.o \\r
64                                                 $(OUTPUT_DIR)/integer.o \\r
65                                                 $(OUTPUT_DIR)/PollQ.o \\r
66                                                 $(OUTPUT_DIR)/semtest.o \\r
67                                                 $(OUTPUT_DIR)/GenQTest.o \\r
68                                                 $(OUTPUT_DIR)/QPeek.o \\r
69                                                 $(OUTPUT_DIR)/recmutex.o \\r
70                                                 $(OUTPUT_DIR)/IntQueueTimer.o \\r
71                                                 $(OUTPUT_DIR)/IntQueue.o \\r
72                                                 $(OUTPUT_DIR)/FreeRTOS_Tick_Setup.o\r
73 \r
74 OBJS = $(FreeRTOS_OBJS) $(Demo_OBJS)\r
75                         \r
76 C_DEPS = $(OBJS:.o=.d)\r
77 \r
78 INCLUDE_PATHS=  -I"$(FREERTOS_SOURCE_DIR)/include" \\r
79                                 -I"include" \\r
80                                 -I"$(COMMON_DEMO_SOURCE_DIR)/../include" \\r
81                                 -I"$(PORT_SOURCE_DIR)" \\r
82                                 -I./MCF5282 \\r
83                                 -I.\r
84 \r
85 CFLAGS=         $(INCLUDE_PATHS) \\r
86                         -D COLDFIRE_V2_GCC \\r
87                         -O$(OPTIM) \\r
88                         -fno-strict-aliasing \\r
89                         -g3 \\r
90                         -Wall \\r
91                         -Wextra \\r
92                         -c \\r
93                         -ffunction-sections \\r
94                         -fdata-sections \\r
95                         -fmessage-length=0 \\r
96                         -funsigned-char \\r
97                         -Wextra \\r
98                         -mcpu=$(CPU) \\r
99                         -MMD \\r
100                         -MP \\r
101                         -MF"$(@:%.o=%.d)" \\r
102                         -MT"$(@:%.o=%.d)"\r
103 \r
104 ASFLAGS=        -m528x \\r
105                         -g3 \\r
106                         --register-prefix-optional \\r
107             --bitwise-or\r
108 \r
109 LIBS=\r
110 \r
111 # Add inputs and outputs from these tool invocations to the build variables \r
112 \r
113 # All Target\r
114 all: $(OUTPUT_DIR)/$(OUTPUT_FILENAME)\r
115 \r
116 # Tool invocations \r
117 $(OUTPUT_DIR)/$(OUTPUT_FILENAME): $(OBJS)\r
118         $(CC) -nostartfiles --gc-sections -Xlinker -Map=$(OUTPUT_DIR)/output.map -mcpu=$(CPU) -T $(LINKER_SCRIPT) -o"$(OUTPUT_DIR)/$(OUTPUT_FILENAME)"  $(OBJS) $(USER_OBJS) $(LIBS)\r
119 \r
120 $(OUTPUT_DIR)/%.o: %.c Makefile\r
121         $(CC) $(CFLAGS) -o"$@" "$<"\r
122 \r
123 $(OUTPUT_DIR)/%.o: %.S\r
124         $(AS) $(ASFLAGS) -o"$@" "$<"\r
125 \r
126 # Other Targets\r
127 clean:\r
128         -$(RM) $(OBJS) $(C_DEPS) $(EXECUTABLES) $(OUTPUT_DIR)/$(OUTPUT_FILENAME)\r
129         -@echo ' '\r
130 \r
131 #\r
132 # The rule to create the target directory\r
133 #\r
134 $(OUTPUT_DIR):\r
135         @mkdir $(OUTPUT_DIR)\r
136 \r
137 \r
138 .PHONY: all clean dependents\r
139 .SECONDARY: post-build\r
140 \r
141 -include $(wildcard $(OUTPUT_DIR)/*.d) __dummy__\r
142 \r