Example of a parallel algorithm in a FreeRTOS simulation
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

127 lines
2.6 KiB

# ######## Build options ########
verbose = 0
######## Build setup ########
# SRCROOT should always be the current directory
SRCROOT = $(CURDIR)
# .o directory
ODIR = obj
# Source VPATHS
VPATH += $(SRCROOT)/Source
VPATH += $(SRCROOT)/Source/portable/MemMang
VPATH += $(SRCROOT)/Source/portable/GCC/POSIX
VPATH += $(SRCROOT)/Project/FileIO
VPATH += $(SRCROOT)/Project
# FreeRTOS Objects
C_FILES += croutine.c
C_FILES += event_groups.c
C_FILES += list.c
C_FILES += queue.c
C_FILES += tasks.c
C_FILES += timers.c
# portable Objects
C_FILES += heap_3.c
C_FILES += port.c
# Main Object
C_FILES += demo.c
C_FILES += nodes.c
# Include Paths
INCLUDES += -I$(SRCROOT)/Source/include
INCLUDES += -I$(SRCROOT)/Source/portable/GCC/POSIX/
INCLUDES += -I$(SRCROOT)/Project
# Generate OBJS names
OBJS = $(patsubst %.c,%.o,$(C_FILES))
######## C Flags ########
# Warnings
CWARNS += -W
CWARNS += -Wall
CWARNS += -Werror
CWARNS += -Wextra
CWARNS += -Wformat
CWARNS += -Wmissing-braces
CWARNS += -Wno-cast-align
CWARNS += -Wparentheses
CWARNS += -Wshadow
CWARNS += -Wno-sign-compare
CWARNS += -Wswitch
CWARNS += -Wuninitialized
CWARNS += -Wunknown-pragmas
CWARNS += -Wunused-function
CWARNS += -Wunused-label
CWARNS += -Wunused-parameter
CWARNS += -Wunused-value
CWARNS += -Wunused-variable
#CWARNS += -Wmissing-prototypes
#CWARNS += -Wno-unused-function
CFLAGS += -m32
CFLAGS += -DDEBUG=1
#CFLAGS += -g -DUSE_STDIO=1 -D__GCC_POSIX__=1
CFLAGS += -g -UUSE_STDIO -D__GCC_POSIX__=1
ifneq ($(shell uname), Darwin)
CFLAGS += -pthread
endif
# MAX_NUMBER_OF_TASKS = max pthreads used in the POSIX port.
# Default value is 64 (_POSIX_THREAD_THREADS_MAX), the minimum number required by POSIX.
CFLAGS += -DMAX_NUMBER_OF_TASKS=300
CFLAGS += $(INCLUDES) $(CWARNS) -O2
######## Makefile targets ########
# Rules
.PHONY : all
all: setup FreeRTOS-Demo
.PHONY : setup
setup:
# Make obj directory
@mkdir -p $(ODIR)
# Fix to place .o files in ODIR
_OBJS = $(patsubst %,$(ODIR)/%,$(OBJS))
$(ODIR)/%.o: %.c
# If verbose, print gcc execution, else hide
ifeq ($(verbose),1)
@echo ">> Compiling $<"
$(CC) $(CFLAGS) -c -o $@ $<
else
@echo ">> Compiling $(notdir $<)"
@$(CC) $(CFLAGS) -c -o $@ $<
endif
FreeRTOS-Demo: $(_OBJS)
@echo ">> Linking $@..."
ifeq ($(verbose),1)
$(CC) $(CFLAGS) $^ $(LINKFLAGS) $(LIBS) -o $@
else
@$(CC) $(CFLAGS) $^ $(LINKFLAGS) $(LIBS) -o $@
endif
@echo "-------------------------"
@echo "BUILD COMPLETE: $@"
@echo "-------------------------"
.PHONY : clean
clean:
@-rm -rf $(ODIR) FreeRTOS-Demo
@echo "--------------"
@echo "CLEAN COMPLETE"
@echo "--------------"

Du besuchst diese Seite mit einem veralteten IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.
You are visiting this site with an outdated IPv4 internet access. You may experience problems with accessibility and performance in the future. Please ask your ISP or network administrator for IPv6 support.
Weitere Infos | More Information
Klicke zum schließen | Click to close