partition.tmplt 4.4 KB
Newer Older
1
2
3
4
5
@@-- The up to date list of tags available for this template is available here:
@@-- https://taste.tuxfamily.org/wiki/index.php?title=Kazoo_Templates_Documentation#templates.2Fconcurrency_view.2Fsub.2Fpartition.tmplt
@@-- If you are using vim, go over the URL and pres gx in to follow the link
@@-- If you have no internet access you can also use (with vim) Ctrl-W-f or gf in vim to open the text doc:
@@-- $HOME/tool-inst/share/kazoo/doc/templates_concurrency_view_sub_partition.ascii
Maxime Perrotin's avatar
Maxime Perrotin committed
6
#  Build of partition @_Name_@ (common to all targets)
7
# (rule generated by templates/concurrency_view/aadl_4_makefile/partition.tmplt)
8
@_LOWER:Name_@:	@_REPLACE_ALL(,/ ):LOWER:Block_Names_@
9
  @@-- Opengeode generates intermediate ASN.1 files, they must be compiled
10
  @@-- (at partition level, not shared by all nodes)
11
12
13
14
15
16
  @@-- The code below is needed because if there is more than one instance of
  @@-- a component type, opengeode will generate the _datamodel.asn file in
  @@-- the folder of the instance, i.e. there may be more than one reference
  @@-- to the same file generated at different places The python code checks
  @@-- that when this happens only one _datamodel.asn file is kept to avoid
  @@-- an error that would otherwise be raised by asn2dataModel
17
  @@INLINE(	args=$$\(python3 -c "import os, sys; print\(' '.join\({os.path.basename\(f\):f for f in sys.argv[1:]}.values\(\)\)\)" )( )(\); \\\n	mkdir -p ..\/dataview\/Ada; mono $(shell which asn1.exe) -Ada -equal --target allboards -typePrefix asn1Scc -o ..\/dataview\/Ada $$args )@@
18
19
    @@TABLE@@
       @@IF@@ @_Block_Languages_@ = SDL
20
          @@--  Use wildcard because in the case of the SDL to C backend the _datamodel files are not generated (yet)
21
          @@IF@@ @_Block_Instance_Of_@ = ""
22
             ${wildcard ../@_LOWER:Block_Names_@/SDL/code/@_LOWER:Block_Names_@_datamodel.asn}
Maxime Perrotin's avatar
Maxime Perrotin committed
23
          @@ELSE@@
24
             ${wildcard ../@_LOWER:Block_Names_@/SDL/code/@_LOWER:Block_Instance_Of_@_datamodel.asn}
25
          @@END_IF@@
26
27
             @@-- If the function has context parameters, add the file
             ${wildcard ../@_LOWER:Block_Names_@/SDL/Context-@_LOWER:REPLACE_ALL(_/-):Block_Names_@.asn}
28
29
       @@END_IF@@
    @@END_TABLE@@
30
    ../dataview/dataview-uniq.asn
31
  @@END_INLINE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
32

Maxime Perrotin's avatar
Maxime Perrotin committed
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
@@-- For simulation target, add simulation.asn (common part should be shared) 
@_LOWER:Name_@_simu:	@_REPLACE_ALL(,/ ):LOWER:Block_Names_@
  @@INLINE(	args=")( )("; \\\n	mkdir -p ..\/dataview\/Ada; mono $(shell which asn1.exe) -Ada -equal --target allboards -typePrefix asn1Scc -o ..\/dataview\/Ada $$args )@@
    @@TABLE@@
       @@IF@@ @_Block_Languages_@ = SDL
          @@--  Use wildcard because in the case of the SDL to C backend the _datamodel files are not generated (yet)
          @@IF@@ @_Block_Instance_Of_@ = ""
             ${wildcard ../@_LOWER:Block_Names_@/SDL/code/@_LOWER:Block_Names_@_datamodel.asn}
          @@ELSE@@
             ${wildcard ../@_LOWER:Block_Names_@/SDL/code/@_LOWER:Block_Instance_Of_@_datamodel.asn}
          @@END_IF@@
             @@-- If the function has context parameters, add the file
             ${wildcard ../@_LOWER:Block_Names_@/SDL/Context-@_LOWER:REPLACE_ALL(_/-):Block_Names_@.asn}
       @@END_IF@@
    @@END_TABLE@@
    ../dataview/dataview-uniq.asn
    simulation.asn
  @@END_INLINE@@



54
55
# Build of partition @_Name_@ for RTEMS (generate adainit)
# (rule generated by templates/concurrency_view/aadl_4_makefile/partition.tmplt)
Maxime Perrotin's avatar
Maxime Perrotin committed
56
@_LOWER:Name_@_rtems_ada : @_LOWER:Name_@
57
58
59
@@-- On RTEMS if using POHIC we need to have adainit created for Ada functions
	mkdir -p @_LOWER:Name_@_adainit && \
@@INLINE(    echo ')()()@@
60
   @@TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
61
      @@IF@@ @_Block_Languages_@ = SDL or @_Block_Languages_@ = Ada
62
63
64
65
         with @_CAPITALIZE:Block_Names_@;
      @@END_IF@@
   @@END_TABLE@@
   package adainit is end adainit;' >@_LOWER:Name_@_adainit/tasteada.ads && \
66
67
@@END_INLINE@@
        cd @_LOWER:Name_@_adainit && \
Maxime Perrotin's avatar
Maxime Perrotin committed
68
@@INLINE(    )(:)( \\)@@
69
   ADA_INCLUDE_PATH=../../dataview/Ada/src:../../dataview/Ada/asn1rtl:../../dataview/Ada/boards/x86
70
   @@TABLE'TERSE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
71
      @@IF@@ @_Block_Languages_@ = SDL
72
         ../../@_LOWER:Block_Names_@/SDL/code
Maxime Perrotin's avatar
Maxime Perrotin committed
73
      @@ELSIF@@ @_Block_Languages_@ = Ada
74
75
76
         ../../@_LOWER:Block_Names_@/Ada/src
      @@END_IF@@
   @@END_TABLE@@
77
78
@@END_INLINE@@
sparc-rtems5-gnatmake -c tasteada.ads && sparc-rtems5-gnatbind -t -n tasteada.ali -o ada-start.adb && mkdir -p ../@_LOWER:Node_Name_@/ada_code_startup && mv ada-start.* ../@_LOWER:Node_Name_@/ada_code_startup
79
80

@_Blocks_@