代码拉取完成,页面将自动刷新
TARGET=exec
BUILD_DIR ?= ./build
# -------------------------
FREERTOS_VERSION="V10.2.1"
FREERTOS_INCLUDE_DIRS := \
FreeRTOS/Source/include
FREERTOS_SOURCES := \
FreeRTOS/Source/croutine.c \
FreeRTOS/Source/event_groups.c\
FreeRTOS/Source/list.c\
FreeRTOS/Source/queue.c \
FreeRTOS/Source/stream_buffer.c \
FreeRTOS/Source/tasks.c \
FreeRTOS/Source/timers.c
# -------------------------
SRCS += $(FREERTOS_SOURCES)
INCLUDE_DIRS += $(FREERTOS_INCLUDE_DIRS)
# -------------------------
EXAMPLE_INCLUDE_DIRS := \
example
EXAMPLE_SOURCES := \
example/main.c
# -------------------------
SRCS += $(EXAMPLE_SOURCES)
INCLUDE_DIRS += $(EXAMPLE_INCLUDE_DIRS)
# -------------------------
PORT_INCLUDE_DIRS := \
portable/GCC/Linux/
PORT_SOURCES := \
portable/GCC/Linux/port.c\
portable/GCC/Linux/heap_4.c
# -------------------------
SRCS += $(PORT_SOURCES)
INCLUDE_DIRS += $(PORT_INCLUDE_DIRS)
LDFLAGS += -lrt -lpthread -lstdc++ -T freertos_linux.ld
CPPFLAGS += -ggdb -Wall -Wextra -Wundef -Wshadow
# Build files
OBJS := $(SRCS:%=$(BUILD_DIR)/%.o)
DEPS := $(OBJS:.o=.d)
INC_FLAGS := $(addprefix -I,$(INCLUDE_DIRS))
$(info srcs [${INC_FLAGS}])
# Link
$(BUILD_DIR)/$(TARGET): $(OBJS)
$(CC) $(OBJS) -o $@ $(LDFLAGS)
# Build C sources
$(BUILD_DIR)/%.c.o: %.c
mkdir -p $(dir $@)
$(CC) $(CPPFLAGS) $(CFLAGS) $(INC_FLAGS) -c $< -o $@
# Build C++ sources
$(BUILD_DIR)/%.cpp.o: %.cpp
mkdir -p $(dir $@)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(INC_FLAGS) -c $< -o $@
.PHONY: get_freertos clean
# Checkout FreeRTOS from SVN Repository
get_freertos:
svn checkout https://svn.code.sf.net/p/freertos/code/tags/$(FREERTOS_VERSION)/FreeRTOS/Source FreeRTOS/Source
clean:
$(RM) -r $(BUILD_DIR)
-include $(DEPS)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。