Commit 565a4825 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Improve and document generated makefile

parent bde990bb
......@@ -11,6 +11,8 @@
# MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MAKEFILE_PATH := $(lastword $(MAKEFILE_LIST))
OUTDIR := $(dir $(MAKEFILE_PATH))
ASN1_FILES := @_REPLACE_ALL(,/):ASN1_Files_@
CP_FILES := @_REPLACE_ALL(,/):CP_Files_@ # Context parameters
DATAVIEW_PATH := ${OUTDIR}/dataview
DATAVIEW_UNIQ := ${DATAVIEW_PATH}/dataview-uniq.asn
@@IF@@ @_ACN_Files'Length_@ > 0
......@@ -64,9 +66,11 @@ ${DATAVIEW_PATH}/built: dataview
build-default: aadl2glueC build/system_config.h ${DATAVIEW_PATH}/built build/deploymentview_final/Makefile
$(MAKE) -j -C build -f Makefile.taste
# Force build with RTEMS/Leon, even if deployment view does not specify it
build-rtems-ada: aadl2glueC build/system_config.h ${DATAVIEW_PATH}/built build/deploymentview_final/Makefile
$(MAKE) -j -C build -f Makefile.taste rtems_ada
# Force build with AIR (TSP), even if deployment view does not specify it
air: aadl2glueC build/system_config.h ${DATAVIEW_PATH}/built build/deploymentview_final/Makefile
$(MAKE) -j -C build -f Makefile.taste air
......@@ -77,11 +81,12 @@ build/deploymentview_final/Makefile: build/main.aadl ${DATAVIEW_AADLV2} ../Concu
@@-- ConcurrencyView_Properties is normally always present (even if empty) as
@@-- it is generated by the GUIs... Just in case it is not there, create it.
# Optionally hold thread priorities, offeset, stack size. Create if not present
../ConcurrencyView_Properties.aadl:
touch $@
# Create dataview-uniq.asn by concatenating all asn1 input files
${DATAVIEW_UNIQ}: @_REPLACE_ALL(,/):ASN1_Files_@
${DATAVIEW_UNIQ}: ${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 $^ > $@
......@@ -94,9 +99,11 @@ ${DATAVIEW_ACN}: @_REPLACE_ALL(,/):ACN_Files_@
sed -e '$$s/$$/\n/' -s $^ > $@
@@END_IF@@
# system_config.h is used to filter out non-needed ASN.1 encoder/decoders
build/system_config.h: $(wildcard */*/wrappers/*_system_config.h)
cat $^ > $@
# Call DMT/aadl2glueC to generate glue code from the mini-cv.aadl files
@@INLINE(aadl2glueC: )( )()@@
@@TABLE@@
@@IF@@ not @_Is_Type_@
......@@ -105,10 +112,12 @@ build/system_config.h: $(wildcard */*/wrappers/*_system_config.h)
@@END_TABLE@@
@@END_INLINE@@
# Build dataview.aadl in AADLv1 format, used by DMT to generate glue code
${DATAVIEW_AADLV1}: ${DATAVIEW_UNIQ}
@@-- Generate DataView.aadl in AADLV1 as this is needed by aadl2glueC
asn2aadlPlus $< $@
# Build dataview.aadl in AADLv2 format, used by Ocarina to generate glue code
${DATAVIEW_AADLV2}: ${DATAVIEW_UNIQ}
@@-- Generate DataView.aadl in AADLV2 without -f flag
asn2aadlPlus --aadlv2 $< $@
......@@ -124,11 +133,12 @@ ${DATAVIEW_AADLV2}: ${DATAVIEW_UNIQ}
@@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}
# Compile the ASN.1 models in C
dataview/C/built: ${DATAVIEW_UNIQ} ${DATAVIEW_ACN} ${CP_FILES}
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_@
asn1.exe -typePrefix asn1Scc -equal -fp AUTO -o $(dir $@) -c -uPER -ACN $^
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
......@@ -142,6 +152,7 @@ dataview/C/built: ${DATAVIEW_UNIQ} ${DATAVIEW_ACN}
@@-- do nothing, C is always done, only once
@@ELSIF@@ @_Unique_Languages_@ = "GUI"
@@-- for DMT, GUI means Python
# Compile the ASN.1 models in Python for the autogenerated GUIs
@@INLINE(dataview/Python/built: dataview/C/built )( )()@@
@@-- aadl2glueC has to be called before the python mapper is built
@@-- because it depends on gui_api.c/etc.
......@@ -169,29 +180,16 @@ dataview/C/built: ${DATAVIEW_UNIQ} ${DATAVIEW_ACN}
@@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@@
dataview/@_Unique_Languages_@/built: ${DATAVIEW_UNIQ} # no context parameters except for C and Ada
mkdir -p $(dir $@) && asn2dataModel -o $(dir $@) -to@_Unique_Languages_@ $^
touch $@
@@END_IF@@
@@END_TABLE@@
@@IF@@ @_Need_Ada_@=TRUE
dataview/Ada/built: ${DATAVIEW_UNIQ}
dataview/Ada/built: ${DATAVIEW_UNIQ} ${CP_FILES}
mkdir -p $(dir $@)
asn2dataModel -o $(dir $@) -toAda ${DATAVIEW_UNIQ} \
@@INLINE( )( \\\n )(\n)@@
@@TABLE@@
@_REPLACE(,/ ):CP_Files_@
@@END_TABLE@@
@@END_INLINE@@
asn2dataModel -o $(dir $@) -toAda $^
touch $@
cd dataview/Ada
rm -f gnat.cfg GPS_project.gpr IgnoredExaminerWarnings.wrn runSpark.sh
......@@ -199,7 +197,7 @@ dataview/Ada/built: ${DATAVIEW_UNIQ}
@@-- Then symlink the files for each function
@@TABLE@@
@@IF@@ @_Language_@ = "SDL"
ln -fs ../../../${DATAVIEW_UNIQ} @_LOWER:Function_Names_@/@_Language_@/src
ln -fs ../../../$^ @_LOWER:Function_Names_@/@_Language_@/src
@@END_IF@@
@@END_TABLE@@
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment