3 # Set the optimisation level - this should be set to 0, 1, 2, 3 or s (s for size).
\r
6 ###############################################################################
\r
7 # List the directories that contain files to be built.
\r
8 ###############################################################################
\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
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
19 # The lwIP stack source files.
\r
20 LWIP_ROOT_DIR=./../../Common/ethernet/lwIP_130
\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
31 ###############################################################################
\r
32 # Define a few constants to be used during the build.
\r
33 ###############################################################################
\r
37 LINKER_SCRIPT=m5282evb-dram_code-rambar_data-hosted.ld
\r
38 OUTPUT_FILENAME=RTOSDemo.elf
\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
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
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
74 OBJS = $(FreeRTOS_OBJS) $(Demo_OBJS)
\r
76 C_DEPS = $(OBJS:.o=.d)
\r
78 INCLUDE_PATHS= -I"$(FREERTOS_SOURCE_DIR)/include" \
\r
80 -I"$(COMMON_DEMO_SOURCE_DIR)/../include" \
\r
81 -I"$(PORT_SOURCE_DIR)" \
\r
85 CFLAGS= $(INCLUDE_PATHS) \
\r
86 -D COLDFIRE_V2_GCC \
\r
88 -fno-strict-aliasing \
\r
93 -ffunction-sections \
\r
95 -fmessage-length=0 \
\r
101 -MF"$(@:%.o=%.d)" \
\r
106 --register-prefix-optional \
\r
111 # Add inputs and outputs from these tool invocations to the build variables
\r
114 all: $(OUTPUT_DIR)/$(OUTPUT_FILENAME)
\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
120 $(OUTPUT_DIR)/%.o: %.c Makefile
\r
121 $(CC) $(CFLAGS) -o"$@" "$<"
\r
123 $(OUTPUT_DIR)/%.o: %.S
\r
124 $(AS) $(ASFLAGS) -o"$@" "$<"
\r
128 -$(RM) $(OBJS) $(C_DEPS) $(EXECUTABLES) $(OUTPUT_DIR)/$(OUTPUT_FILENAME)
\r
132 # The rule to create the target directory
\r
135 @mkdir $(OUTPUT_DIR)
\r
138 .PHONY: all clean dependents
\r
139 .SECONDARY: post-build
\r
141 -include $(wildcard $(OUTPUT_DIR)/*.d) __dummy__
\r