-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile.back
50 lines (34 loc) · 1.4 KB
/
Makefile.back
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
CC := gcc # arm-linux-gnueabihf-gcc
# Toolchain from 'sudo apt install gcc-arm-linux-gnueabihf'
BIN := posix_demo
BUILD_DIR := build
FREERTOS_DIR_REL := ./FreeRTOS/FreeRTOS
FREERTOS_DIR := $(abspath $(FREERTOS_DIR_REL))
INCLUDE_DIRS := -I.
INCLUDE_DIRS += -I${FREERTOS_DIR}/Source/include
INCLUDE_DIRS += -I${FREERTOS_DIR}/Source/portable/ThirdParty/GCC/Posix
INCLUDE_DIRS += -I${FREERTOS_DIR}/Source/portable/ThirdParty/GCC/Posix/utils
INCLUDE_DIRS += -I${FREERTOS_DIR}/Demo/Common/include
INCLUDE_DIRS += -I${FREERTOS_DIR}/Demo/Posix_GCC
SOURCE_FILES := $(wildcard *.c)
SOURCE_FILES += $(wildcard ${FREERTOS_DIR}/Source/*.c)
# Memory manager (use malloc() / free())
SOURCE_FILES += ${FREERTOS_DIR}/Source/portable/MemMang/heap_3.c
# Posix port
SOURCE_FILES += ${FREERTOS_DIR}/Source/portable/ThirdParty/GCC/Posix/utils/wait_for_event.c
SOURCE_FILES += ${FREERTOS_DIR}/Source/portable/ThirdParty/GCC/Posix/port.c
CFLAGS := -ggdb3 -O0 -DprojCOVERAGE_TEST=0 -D_WINDOWS_
LDFLAGS := -ggdb3 -O0 -pthread
OBJ_FILES = $(SOURCE_FILES:%.c=$(BUILD_DIR)/%.o)
DEP_FILE = $(OBJ_FILES:%.o=%.d)
${BIN} : $(BUILD_DIR)/$(BIN)
${BUILD_DIR}/${BIN} : ${OBJ_FILES}
-mkdir -p ${@D}
$(CC) $^ $(CFLAGS) $(INCLUDE_DIRS) ${LDFLAGS} -o $@
-include ${DEP_FILE}
${BUILD_DIR}/%.o : %.c
-mkdir -p $(@D)
$(CC) $(CFLAGS) ${INCLUDE_DIRS} -MMD -c $< -o $@
.PHONY: clean
clean:
-rm -rf $(BUILD_DIR)