makefile.tmplt 2.67 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
10
all: dataviews
Maxime Perrotin's avatar
Maxime Perrotin committed
11

12
dataviews:
13
	mkdir -p dataview/.cache
Maxime Perrotin's avatar
Maxime Perrotin committed
14
15
	@@-- Create dataview-uniq.asn
	@@INLINE(	)( )(\n)@@
Maxime Perrotin's avatar
Maxime Perrotin committed
16
        for f in
Maxime Perrotin's avatar
Maxime Perrotin committed
17
18
19
        @@TABLE@@
           @_ASN1_Files_@ 
        @@END_TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
20
; do cat $$f; echo; done > dataview/dataview-uniq.asn
Maxime Perrotin's avatar
Maxime Perrotin committed
21
22
	@@END_INLINE@@
	@@-- Then generate Dataviews once per target language
23
	@@TABLE@@
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
           @@IF@@ @_Unique_Languages_@ /= "GUI"
	      @@IF@@ @_Unique_Languages_@ = "Ada" or @_Unique_Languages_@ = "SDL"
	         @@SET@@ Lang=Ada
	         @@SET@@ Post=cd dataview/Ada && rm -f gnat.cfg GPS_project.gpr IgnoredExaminerWarnings.wrn runSpark.sh
	      @@ELSIF@@ @_Unique_Languages_@ = "C" or @_Unique_Languages_@ = "CPP" or @_Unique_Languages_@ = "Blackbox_C"
	         @@SET@@ Lang=C
		 @@SET@@ Post=# Blackboxes, C and C++ all use the same C data model
	      @@ELSE@@
                 @@SET@@ Lang=@_Unique_Languages_@
	      @@END_IF@@
	      @@INLINE(	)(\n	)(\n)@@
                 mkdir -p dataview/@_Lang_@
                 PROJECT_CACHE=dataview/.cache asn2dataModel -o dataview/@_Lang_@ -to@_Lang_@ dataview/dataview-uniq.asn \
		 @@TABLE@@
                    @_REPLACE(,/ ):CP_Files_@
    	         @@END_TABLE@@
                 @_Post_@
	      @@END_INLINE@@
	   @@END_IF@@
43
44
45
        @@END_TABLE@@
	@@-- Then symlink the files for each function
	@@TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
46
47
	@@IF@@ @_Language_@ = "Ada"
	ln -fs ${PWD}/dataview/Ada/*.ads @_LOWER:Function_Names_@/Ada/src
Maxime Perrotin's avatar
Maxime Perrotin committed
48
	@@ELSIF@@ @_Language_@ = "C" or @_Language_@ = "CPP" or @_Language_@ = "GUI" or @_Language_@ = "Blackbox_C"
Maxime Perrotin's avatar
Maxime Perrotin committed
49
	ln -fs ${PWD}/dataview/C/*.h @_LOWER:Function_Names_@/@_Language_@/src
Maxime Perrotin's avatar
Maxime Perrotin committed
50
51
	@@ELSIF@@ @_Language_@ = "SDL"
	ln -fs ${PWD}/dataview/dataview-uniq.asn @_LOWER:Function_Names_@/@_Language_@/src
52
	@@ELSE@@
53
54
	ln -fs ${PWD}/dataview/@_Language_@/* @_LOWER:Function_Names_@/@_Language_@/src
	@@END_IF@@
55
	@@END_TABLE@@
56

Maxime Perrotin's avatar
Maxime Perrotin committed
57
function-types-linux:
Maxime Perrotin's avatar
Maxime Perrotin committed
58
	@@TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
59
	@@IF@@ @_Is_Type_@
Maxime Perrotin's avatar
Maxime Perrotin committed
60
	cd @_LOWER:Function_Names_@/@_Language_@ && make compile-linux
Maxime Perrotin's avatar
Maxime Perrotin committed
61
	@@END_IF@@
Maxime Perrotin's avatar
Maxime Perrotin committed
62
	@@END_TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
63
64
65
66
67
68
69
70
71

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