@@-- 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 @@-- @_ASN1_Modules_@ : List of all ASN.1 modules MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) OUTDIR := $(dir $(MAKEFILE_PATH)) all: dataview/dataview-uniq.asn @@INLINE(dataview/dataview-uniq.asn:)( )(\n)@@ @@TABLE@@ @_ASN1_Files_@ @@END_TABLE@@ @@END_INLINE@@ mkdir -p dataview/.cache @@-- Create dataview-uniq.asn @@INLINE( )( )(\n)@@ for f in @@TABLE@@ @_ASN1_Files_@ @@END_TABLE@@ ; do cat $$f; echo; done > dataview/dataview-uniq.asn @@END_INLINE@@ @@-- Create system_config.h by concatenating all functions partial system config files @@INLINE( )( )(\n)@@ for f in @@TABLE@@ @@IF@@ not @_Is_Type_@ @_LOWER:Function_Names_@/@_Language_@/wrappers/@_LOWER:Function_Names_@_system_config.h @@END_IF@@ @@END_TABLE@@ ; do cat $$f; echo; done > system_config.h @@END_INLINE@@ @@-- Generate DataView.aadl in AADLV1 as this is needed by aadl2glueC PROJECT_CACHE=dataview/.cache asn2aadlPlus dataview/dataview-uniq.asn dataview/dataview_aadlv1.aadl @@-- For each function generate the glue code from DMT based on the dataview @@TABLE@@ @@IF@@ not @_Is_Type_@ PROJECT_CACHE=dataview/.cache aadl2glueC -o @_LOWER:Function_Names_@/@_Language_@/wrappers dataview/dataview_aadlv1.aadl @_LOWER:Function_Names_@/@_Language_@/wrappers/@_LOWER:Function_Names_@_mini_cv.aadl @@END_IF@@ @@END_TABLE@@ @@-- Then generate Dataviews once per target language - first for C, it is needed in any case mkdir -p dataview/C && PROJECT_CACHE=dataview/.cache asn2dataModel -o dataview/C -toC dataview/dataview-uniq.asn \ @@INLINE( )( \\\n )(\n)@@ @@TABLE@@ @_REPLACE(,/ ):CP_Files_@ @@END_TABLE@@ @@END_INLINE@@ @@TABLE@@ @@IF@@ @_Unique_Languages_@ = "Ada" or @_Unique_Languages_@ = "SDL" @@SET@@ Enable=FALSE @@SET@@ Need_Ada=TRUE @@ELSIF@@ @_Unique_Languages_@ = "C" or @_Unique_Languages_@ = "CPP" or @_Unique_Languages_@ = "Blackbox_C" or @_Unique_Languages_@ = "GUI" @@SET@@ Enable=FALSE @@ELSE@@ @@SET@@ Enable=TRUE @@SET@@ Lang=@_Unique_Languages_@ @@END_IF@@ @@IF@@ Enable=TRUE @@INLINE( )(\n )(\n)@@ mkdir -p dataview/@_Lang_@ PROJECT_CACHE=dataview/.cache asn2dataModel -o dataview/@_Lang_@ -to@_Lang_@ dataview/dataview-uniq.asn \ @@INLINE( )( \\\n )(\n )@@ @@TABLE@@ @_REPLACE(,/ ):CP_Files_@ @@END_TABLE@@ @@END_INLINE@@ @@END_INLINE@@ @@END_IF@@ @@END_TABLE@@ @@IF@@ @_Need_Ada_@=TRUE mkdir -p dataview/Ada && PROJECT_CACHE=dataview/.cache asn2dataModel -o dataview/Ada -toAda dataview/dataview-uniq.asn \ @@INLINE( )( \\\n )(\n)@@ @@TABLE@@ @_REPLACE(,/ ):CP_Files_@ @@END_TABLE@@ @@END_INLINE@@ cd dataview/Ada && rm -f gnat.cfg GPS_project.gpr IgnoredExaminerWarnings.wrn runSpark.sh @@END_IF@@ 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 && msgPrinterASN1 ../dataview-uniq.asn @@-- Then symlink the files for each function @@TABLE@@ @@IF@@ @_Language_@ = "SDL" ln -fs ${OUTDIR}/dataview/dataview-uniq.asn @_LOWER:Function_Names_@/@_Language_@/src @@END_IF@@ @@END_TABLE@@ function-types-linux: @@TABLE@@ @@IF@@ @_Is_Type_@ cd @_LOWER:Function_Names_@/@_Language_@ && make compile-linux @@END_IF@@ @@END_TABLE@@ function-instances-linux: function-types-linux @@TABLE@@ @@IF@@ not @_Is_Type_@ cd @_LOWER:Function_Names_@/@_Language_@ && make compile-linux @@END_IF@@ @@END_TABLE@@ compile-all-linux: dataviews function-instances-linux