From 11a52e4e88bcad1e6bddcf02f78e1cc5eaaec508 Mon Sep 17 00:00:00 2001 From: Aditya Naik Date: Mon, 3 Aug 2020 14:42:06 -0400 Subject: RTOS skeleton with (UNIX) POSIX calls. Reorg of stream files --- makefile | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'makefile') diff --git a/makefile b/makefile index e2c01c4..3e03b94 100644 --- a/makefile +++ b/makefile @@ -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 -- cgit v1.2.3