diff options
| author | Aditya Naik | 2020-08-03 14:42:06 -0400 |
|---|---|---|
| committer | Aditya Naik | 2020-08-03 14:42:06 -0400 |
| commit | 11a52e4e88bcad1e6bddcf02f78e1cc5eaaec508 (patch) | |
| tree | d7f725c30e618994a0650607ede73ab3efc72c67 /makefile | |
| parent | 81b3f3d5336eab67e8eb21bb4011e552f3895a4e (diff) | |
RTOS skeleton with (UNIX) POSIX calls. Reorg of stream files
Diffstat (limited to 'makefile')
| -rw-r--r-- | makefile | 28 |
1 files changed, 16 insertions, 12 deletions
@@ -1,6 +1,6 @@ # Target also determines which file is being compiled
-TARGET = master
-
+TARGET = master_rtos
+PORT = posix
######################################
# building variables
@@ -25,9 +25,16 @@ C_SOURCES = \ lib/nanopb/pb_decode.c \
lib/nanopb/pb_encode.c \
lib/nanopb/pb_common.c \
+lib/FreeRTOS/FreeRTOS/Source/tasks.c \
+lib/FreeRTOS/FreeRTOS/Source/list.c \
+lib/FreeRTOS/FreeRTOS/Source/queue.c \
+lib/FreeRTOS/FreeRTOS/Source/stream_buffer.c \
+lib/FreeRTOS/FreeRTOS/Source/timers.c \
+src/heap_4.c \
src/handshake.pb.c \
src/data.pb.c \
-src/stream_i2c.c
+src/master_posix.c \
+
# set the main C source based on whether we're compiling the master or slave
C_SOURCES+=$(addprefix src/, $(TARGET).c)
@@ -35,7 +42,7 @@ C_SOURCES+=$(addprefix src/, $(TARGET).c) #######################################
# binaries
#######################################
-PREFIX = arm-none-eabi-
+
# The gcc compiler bin path can be either defined in make command via GCC_PATH variable (> make GCC_PATH=xxx)
# either it can be added to the PATH environment variable.
ifdef GCC_PATH
@@ -66,12 +73,12 @@ AS_INCLUDES = C_INCLUDES = \
-Iinclude \
-Ilib/cmsis \
--Ilib/nanopb
-
+-Ilib/nanopb \
+-Ilib/FreeRTOS/FreeRTOS/Source/include/ \
# Define the chip we're building for and include its makefile
-# Variable ASM_FILE will be defined in the included port makefile
-PORT = stm32f4
+# Variables ASM_FILE, LDFLAGS, PREFIX will be defined in the included port makefile
+# Port-specific stream functions (ex. stream_i2c, stream_stdio) are included by the port makefile
PORT_DIR = ports/$(PORT)
include $(PORT_DIR)/makefile
ASM_SOURCES=$(PORT_DIR)/$(ASM_FILE)
@@ -91,13 +98,10 @@ CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)" #######################################
# LDFLAGS
#######################################
-# link script
-# LDSCRIPT = STM32F401CCUx_FLASH.ld
# libraries
-LIBS = -lc -lm -lnosys
+LIBS = -lc -lm -lpthread -lrt
LIBDIR =
-LDFLAGS = $(MCU) -specs=nosys.specs -specs=nano.specs -u _printf_float -T$(PORT_DIR)/$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections
# default action: build all
all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
|
