-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathfreertos.target
More file actions
57 lines (42 loc) · 1.39 KB
/
freertos.target
File metadata and controls
57 lines (42 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Turn on all warnings except missing-braces
# (no-missing-braces is for protoc generated code)
CC = gcc -Wall -Wextra -Wno-missing-braces -Wno-deprecated
AR = ar rc
OUTPUT_DIR = build/debug
FREERTOS_KERNEL = osal/freertos/FreeRTOS-Kernel
DIRs += $(shell find ./src -maxdepth 3 -type d)
DIRs += osal/
DIRs += osal/freertos
DIRs += $(FREERTOS_KERNEL)
DIRs += $(FREERTOS_KERNEL)/portable/ThirdParty/GCC/Posix
DIRs += $(FREERTOS_KERNEL)/portable/ThirdParty/GCC/Posix/utils
#CFLAGS += -DPRINTDEBUG
CFLAGS += $(foreach dir, $(DIRs), -I $(dir))
CFLAGS += -DOSAL_FREERTOS_LINUX
LIBSRC = $(foreach dir, $(DIRs), $(wildcard $(dir)/*.c))
LIBOBJ_nodir = $(notdir $(LIBSRC))
LIBOBJ = $(patsubst %.c,%.o,$(LIBOBJ_nodir))
LIBOBJ += heap_3.o
LIB_OBJECT = csmp_agent_lib_freertos.a
vpath %.c $(DIRs)
INC += \
-Iosal/ \
-Iosal/freertos/ \
-I$(FREERTOS_KERNEL)/include \
-I$(FREERTOS_KERNEL)/portable/ThirdParty/GCC/Posix/ \
-I$(FREERTOS_KERNEL)/portable/ThirdParty/GCC/Posix/utils/
$(LIB_OBJECT): $(addprefix $(OUTPUT_DIR)/, $(LIBOBJ))
@echo 'Building $@'
$(AR) $@ $^
# Heap3 management for FreeRTOS
$(OUTPUT_DIR)/heap_3.o: $(FREERTOS_KERNEL)/portable/MemMang/heap_3.c
@echo 'Building $<'
@mkdir -p $(@D)
@$(CC) $(CFLAGS) -c -o $@ $< $(LIBS) -I $(INC)
$(OUTPUT_DIR)/%.o: %.c
@echo 'Building $<'
@mkdir -p $(@D)
@$(CC) $(CFLAGS) -c -o $@ $< $(LIBS) -I $(INC)
clean:
$(RM) -rf $(BUILD_DIR)
$(RM) $(PROJECTNAME).a