makefile.tmplt 4.26 KB
Newer Older
1
2
3
4
@@-- The following tags are available in this template:
@@--
@@-- @_Function_Names_@      : Combined table: list of fuction names...
@@-- @_Language_@            : ... and corresponding implementation language
5
6
@@-- @_Is_Type_@             : ... and flag if it is a function type
@@-- @_CP_Files_@            : List of all context parameters ASN.1 files
7
@@-- @_Unique_Languages_@    : List of all languages used in the system
8
9
@@-- @_ASN1_Files_@          : List of all ASN.1 files
@@-- @_ASN1_Modules_@        : List of all ASN.1 modules
Maxime Perrotin's avatar
Maxime Perrotin committed
10
11
12
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
OUTDIR := $(dir $(MAKEFILE_PATH))

Maxime Perrotin's avatar
Maxime Perrotin committed
13
all: dataview/dataview-uniq.asn
Maxime Perrotin's avatar
Maxime Perrotin committed
14

Maxime Perrotin's avatar
Maxime Perrotin committed
15
16
17
18
19
@@INLINE(dataview/dataview-uniq.asn:)( )(\n)@@
        @@TABLE@@
           @_ASN1_Files_@
        @@END_TABLE@@
@@END_INLINE@@
20
	mkdir -p dataview/.cache
Maxime Perrotin's avatar
Maxime Perrotin committed
21
22
	@@-- Create dataview-uniq.asn
	@@INLINE(	)( )(\n)@@
Maxime Perrotin's avatar
Maxime Perrotin committed
23
        for f in
Maxime Perrotin's avatar
Maxime Perrotin committed
24
25
26
        @@TABLE@@
           @_ASN1_Files_@ 
        @@END_TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
27
; do cat $$f; echo; done > dataview/dataview-uniq.asn
Maxime Perrotin's avatar
Maxime Perrotin committed
28
	@@END_INLINE@@
29
30
31
32
	@@-- Create system_config.h by concatenating all functions partial system config files
	@@INLINE(	)( )(\n)@@
        for f in
        @@TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
33
	@@IF@@ not @_Is_Type_@
34
	    @_LOWER:Function_Names_@/@_Language_@/wrappers/@_LOWER:Function_Names_@_system_config.h
Maxime Perrotin's avatar
Maxime Perrotin committed
35
	@@END_IF@@
36
37
38
39
        @@END_TABLE@@
; do cat $$f; echo; done > system_config.h
	@@END_INLINE@@
	
40
41
42
43
	@@-- 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@@
Maxime Perrotin's avatar
Maxime Perrotin committed
44
45
46
	@@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@@
47
	@@END_TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
48
49
50
51
52
53
54
55
	@@-- 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@@
Maxime Perrotin's avatar
Maxime Perrotin committed
56
	   @@IF@@ @_Unique_Languages_@ = "Ada" or @_Unique_Languages_@ = "SDL"
Maxime Perrotin's avatar
Maxime Perrotin committed
57
58
              @@SET@@ Enable=FALSE
              @@SET@@ Need_Ada=TRUE
Maxime Perrotin's avatar
Maxime Perrotin committed
59
	   @@ELSIF@@ @_Unique_Languages_@ = "C" or @_Unique_Languages_@ = "CPP" or @_Unique_Languages_@ = "Blackbox_C" or @_Unique_Languages_@ = "GUI"
Maxime Perrotin's avatar
Maxime Perrotin committed
60
              @@SET@@ Enable=FALSE
Maxime Perrotin's avatar
Maxime Perrotin committed
61
	   @@ELSE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
62
              @@SET@@ Enable=TRUE
Maxime Perrotin's avatar
Maxime Perrotin committed
63
64
              @@SET@@ Lang=@_Unique_Languages_@
	   @@END_IF@@
Maxime Perrotin's avatar
Maxime Perrotin committed
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
           @@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@@
86
87
88
	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
89
90
	@@-- Then symlink the files for each function
	@@TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
91
	@@IF@@ @_Language_@ = "SDL"
Maxime Perrotin's avatar
Maxime Perrotin committed
92
	ln -fs ${OUTDIR}/dataview/dataview-uniq.asn @_LOWER:Function_Names_@/@_Language_@/src
93
	@@END_IF@@
94
	@@END_TABLE@@
95

Maxime Perrotin's avatar
Maxime Perrotin committed
96
function-types-linux:
Maxime Perrotin's avatar
Maxime Perrotin committed
97
	@@TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
98
	@@IF@@ @_Is_Type_@
Maxime Perrotin's avatar
Maxime Perrotin committed
99
	cd @_LOWER:Function_Names_@/@_Language_@ && make compile-linux
Maxime Perrotin's avatar
Maxime Perrotin committed
100
	@@END_IF@@
Maxime Perrotin's avatar
Maxime Perrotin committed
101
	@@END_TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
102
103
104
105
106
107
108
109
110

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