Build an application
A c++ application has to be compiled and linked, and you can use make to do this. ProviewR
contains a rule file, $pwr_exe/pwrp_rules.mk, that contains rules for compilation.
A makefile for the application ra_myappl on the directory $pwrp_src/myappl can look
like this ($pwrp_src/myappl/makefile):
ra_myappl_top : ra_myappl
include $(pwr_exe)/pwrp_rules.mk
ra_myappl_modules : \
$(pwrp_obj)/ra_myappl.o \
$(pwrp_exe)/ra_myappl
ra_myappl : ra_myappl_modules
@ echo "ra_myappl built"
#
# Modules
#
$(pwrp_obj)/ra_myappl.o : $(pwrp_src)/myappl/ra_myappl.cpp \
$(pwrp_src)/myappl/ra_myappl.h
$(pwrp_exe)/ra_myappl : $(pwrp_obj)/ra_myappl.o
@ echo "Link $(tname)"
@ $(ldxx) $(linkflags) -o $(target) $(source) -lpwr_rt -lpwr_co \
-lpwr_msg_dummy -lrpcsvc -lpthread -lm -lrt
The makefile is executed by positioning on the directory and writing make
make
You can also insert the build command into the Application object for the application
in the attribute BuildCmd. In this case the build command is
make --directory $pwrp_src/myappl -f makefile
This command is executed when the node is built from the configurator. This is a
way to ensure that all applications are updated when the node is built.