@@-- The following tags are available in this template: @@-- @@-- @_Function_Names_@ : Combined table: list of fuction names... @@-- @_Language_@ : ... and corresponding implementation language @@-- @_Is_Type_@ : ... and flag if it is a function type @@-- @_CP_Files_@ : List of all context parameters ASN.1 files @@-- @_Unique_Languages_@ : List of all languages used in the system @@-- @_ASN1_Files_@ : List of all ASN.1 files @@-- @_ACN_Files_@ : List of all ACN files @@-- @_ASN1_Modules_@ : List of all ASN.1 modules # MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) MAKEFILE_PATH := $(lastword $(MAKEFILE_LIST)) OUTDIR := $(dir $(MAKEFILE_PATH)) DATAVIEW_PATH := ${OUTDIR}/dataview DATAVIEW_UNIQ := ${DATAVIEW_PATH}/dataview-uniq.asn @@IF@@ @_ACN_Files'Length_@ > 0 DATAVIEW_ACN := ${DATAVIEW_PATH}/dataview-uniq.acn @@ELSE@@ DATAVIEW_ACN := @@END_IF@@ DATAVIEW_AADLV1 := ${DATAVIEW_PATH}/dataview_aadlv1.aadl # Project cache folder is used to speed up all ASN.1-related processing export PROJECT_CACHE=${HOME}/.taste_AST_cache all: build-default @@-- global check to see if dataview in Ada is needed @@TABLE@@ @@IF@@ @_Unique_Languages_@ = "Ada" or @_Unique_Languages_@ = "SDL" @@SET@@ Need_Ada=TRUE @@END_IF@@ @@END_TABLE@@ dataview: ${DATAVIEW_PATH}/built @@INLINE(${DATAVIEW_PATH}/built: dataview/C/built )( )()@@ @@IF@@ @_Need_Ada_@ = TRUE dataview/Ada/built @@END_IF@@ @@TABLE@@ @@IF@@ @_Unique_Languages_@ /= "Ada" and @_Unique_Languages_@ /= "SDL" and @_Unique_Languages_@ /= "C" and @_Unique_Languages_@ /= "CPP" and @_Unique_Languages_@ /= "Blackbox_C" and @_Unique_Languages_@ /= "GUI" dataview/@_Unique_Languages_@/built @@ELSIF@@ @_Unique_Languages_@ = GUI dataview/Python/built @@END_IF@@ @@END_TABLE@@ # Build dataviews for all languages @@END_INLINE@@ touch $@ # Build based on the deployment view build-default: aadl2glueC build/system_config.h ${DATAVIEW_PATH}/built build/deploymentview_final/Makefile $(MAKE) -j -C build -f Makefile.taste build-rtems-ada: aadl2glueC build/system_config.h ${DATAVIEW_PATH}/built build/deploymentview_final/Makefile $(MAKE) -j -C build -f Makefile.taste rtems_ada air: aadl2glueC build/system_config.h ${DATAVIEW_PATH}/built build/deploymentview_final/Makefile $(MAKE) -j -C build -f Makefile.taste air # Rule to invoke Ocarina (generation of POHI middleware code) build/deploymentview_final/Makefile: build/main.aadl cd build && ocarina -x main.aadl # Create dataview-uniq.asn by concatenating all asn1 input files ${DATAVIEW_UNIQ}: @_REPLACE_ALL(,/):ASN1_Files_@ mkdir -p ${PROJECT_CACHE} && mkdir -p ${DATAVIEW_PATH} @@-- Don't use cat, because files need newlines in between sed -e '$$s/$$/\n/' -s $^ > $@ @@IF@@ @_ACN_Files'Length_@ > 0 # Create dataview-uniq.acn by concatenating all input files ${DATAVIEW_ACN}: @_REPLACE_ALL(,/):ACN_Files_@ mkdir -p ${DATAVIEW_PATH} @@-- Don't use cat, because files need newlines in between sed -e '$$s/$$/\n/' -s $^ > $@ @@END_IF@@ build/system_config.h: $(wildcard */*/wrappers/*_system_config.h) cat $^ > $@ @@INLINE(aadl2glueC: )( )()@@ @@TABLE@@ @@IF@@ not @_Is_Type_@ @_LOWER:Function_Names_@/@_Language_@/wrappers/aadl2glueC_built @@END_IF@@ @@END_TABLE@@ @@END_INLINE@@ ${DATAVIEW_AADLV1}: ${DATAVIEW_UNIQ} @@-- Generate DataView.aadl in AADLV1 as this is needed by aadl2glueC asn2aadlPlus $< $@ @@-- For each function generate the glue code from DMT based on the dataview @@TABLE@@ @@IF@@ not @_Is_Type_@ @_LOWER:Function_Names_@/@_Language_@/wrappers/aadl2glueC_built: @_LOWER:Function_Names_@/@_Language_@/wrappers/@_LOWER:Function_Names_@_mini_cv.aadl ${DATAVIEW_AADLV1} aadl2glueC -o $(dir $@) $^ touch $@ @@END_IF@@ @@END_TABLE@@ @@-- Then generate Dataviews once per target language - first for C, it is needed in any case dataview/C/built: ${DATAVIEW_UNIQ} ${DATAVIEW_ACN} mkdir -p $(dir $@) # asn2dataModel does not take the ACN files, and only calls asn1.exe # asn2dataModel -o $(dir $@) -toC ${DATAVIEW_UNIQ} ${DATAVIEW_ACN} asn1.exe -typePrefix asn1Scc -equal -fp AUTO -o $(dir $@) -c -uPER -ACN ${DATAVIEW_UNIQ} ${DATAVIEW_ACN} @_REPLACE_ALL(,/):CP_Files_@ cp $(shell taste-config --prefix)/share/AutoGUI/debug_messages.? dataview/C cp $(shell taste-config --prefix)/share/AutoGUI/timeInMS.? dataview/C cd dataview/C && msgPrinter ../dataview-uniq.asn cd dataview/C && msgPrinterASN1 ../dataview-uniq.asn touch $@ @@TABLE@@ @@IF@@ @_Unique_Languages_@ = "Ada" or @_Unique_Languages_@ = "SDL" @@SET@@ Need_Ada=TRUE @@ELSIF@@ @_Unique_Languages_@ = "C" or @_Unique_Languages_@ = "CPP" or @_Unique_Languages_@ = "Blackbox_C" @@-- do nothing, C is always done, only once @@ELSIF@@ @_Unique_Languages_@ = "GUI" @@-- for DMT, GUI means Python dataview/Python/built: dataview/C/built mkdir -p $(dir $@) asn2dataModel -o $(dir $@) -toPython ${DATAVIEW_UNIQ} @@-- Ignore context parameters for python interface $(MAKE) -j1 -C dataview/Python -f Makefile.python @@TABLE@@ @@IF@@ @_Language_@ = GUI cp dataview/Python/* @_LOWER:Function_Names_@/GUI/wrappers/python cp dataview/C/timeInMS.[ch] dataview/C/debug_messages.c @_LOWER:Function_Names_@/GUI/wrappers/python cd @_LOWER:Function_Names_@/GUI/wrappers/python && \ gcc -g -fPIC -c `python-config --cflags` gui_api.c ../../src/queue_manager.c timeInMS.c debug_messages.c -I. -I../../src && \ gcc -g -shared -o PythonAccess.so gui_api.o queue_manager.o timeInMS.o debug_messages.o `python-config --ldflags` -lrt mkdir -p binaries/@_LOWER:Function_Names_@_GUI cp -f @_LOWER:Function_Names_@/GUI/wrappers/python/* binaries/@_LOWER:Function_Names_@_GUI cp -f @_LOWER:Function_Names_@/GUI/wrappers/*.py binaries/@_LOWER:Function_Names_@_GUI cp -f @_LOWER:Function_Names_@/GUI/wrappers/*.ui binaries/@_LOWER:Function_Names_@_GUI @@END_IF@@ @@END_TABLE@@ touch $@ @@ELSE@@ dataview/@_Unique_Languages_@/built: ${DATAVIEW_UNIQ} @@INLINE( )(\n )(\n)@@ mkdir -p $(dir $@) && asn2dataModel -o $(dir $@) -to@_Unique_Languages_@ ${DATAVIEW_UNIQ} \ @@INLINE( )( \\\n )(\n )@@ @@TABLE@@ @_REPLACE(,/ ):CP_Files_@ @@END_TABLE@@ @@END_INLINE@@ @@END_INLINE@@ touch $@ @@END_IF@@ @@END_TABLE@@ @@IF@@ @_Need_Ada_@=TRUE dataview/Ada/built: ${DATAVIEW_UNIQ} mkdir -p $(dir $@) asn2dataModel -o $(dir $@) -toAda ${DATAVIEW_UNIQ} \ @@INLINE( )( \\\n )(\n)@@ @@TABLE@@ @_REPLACE(,/ ):CP_Files_@ @@END_TABLE@@ @@END_INLINE@@ touch $@ cd dataview/Ada rm -f gnat.cfg GPS_project.gpr IgnoredExaminerWarnings.wrn runSpark.sh @@END_IF@@ @@-- Then symlink the files for each function @@TABLE@@ @@IF@@ @_Language_@ = "SDL" ln -fs ../../../${DATAVIEW_UNIQ} @_LOWER:Function_Names_@/@_Language_@/src @@END_IF@@ @@END_TABLE@@ function-types-linux: @@TABLE@@ @@IF@@ @_Is_Type_@ $(MAKE) -j -C @_LOWER:Function_Names_@/@_Language_@ compile-linux @@END_IF@@ @@END_TABLE@@ function-instances-linux: function-types-linux @@TABLE@@ @@IF@@ not @_Is_Type_@ $(MAKE) -C @_LOWER:Function_Names_@/@_Language_@ -j compile-linux @@END_IF@@ @@END_TABLE@@ compile-all-linux: dataviews function-instances-linux clean: rm -rf binaries/* $(MAKE) -C build -f Makefile.taste clean .PHONY: clean compile-all-linux function-instances-linux function-types-linux build-default dataview build-rtems-ada