makefile.tmplt 2.76 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
all: compile-all-linux

12
dataviews:
Maxime Perrotin's avatar
Maxime Perrotin committed
13
14
15
	mkdir -p dataview
	@@-- 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@@
Maxime Perrotin's avatar
Maxime Perrotin committed
24
        @@IF@@ @_Unique_Languages_@ /= "GUI"
25
	@@IF@@ @_Unique_Languages_@ = "Ada" or @_Unique_Languages_@ = "SDL"
Maxime Perrotin's avatar
Maxime Perrotin committed
26
27
28
29
30
31
	@@INLINE()()(; fi\n)@@
	if [ ! -d dataview/Ada ]; then mkdir dataview/Ada && mono $(shell which asn1.exe) -Ada -typePrefix asn1Scc -o dataview/Ada dataview/dataview-uniq.asn 
	   @@TABLE@@
	      @_REPLACE(,/ ):CP_Files_@
	   @@END_TABLE@@
	@@END_INLINE@@
32
	cd dataview/Ada && rm -f gnat.cfg GPS_project.gpr IgnoredExaminerWarnings.wrn runSpark.sh
Maxime Perrotin's avatar
Maxime Perrotin committed
33
	@@ELSIF@@ @_Unique_Languages_@ = "C" or @_Unique_Languages_@ = "CPP" or @_Unique_Languages_@ = "Blackbox_C"
Maxime Perrotin's avatar
Maxime Perrotin committed
34
35
36
37
38
39
	@@INLINE()()(; fi\n)@@
	if [ ! -d dataview/C ]; then mkdir dataview/C && mono $(shell which asn1.exe) -c -typePrefix asn1Scc -o dataview/C dataview/dataview-uniq.asn 
	   @@TABLE@@
	      @_REPLACE(,/ ):CP_Files_@
	   @@END_TABLE@@
	@@END_INLINE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
40
	@@ELSE@@
41
	mkdir -p dataview/@_Unique_Languages_@
Maxime Perrotin's avatar
Maxime Perrotin committed
42
	asn2dataModel -o dataview/@_Unique_Languages_@ -to@_Unique_Languages_@ dataview/dataview-uniq.asn
43
44
45
46
47
	@@END_IF@@
	@@END_IF@@
        @@END_TABLE@@
	@@-- Then symlink the files for each function
	@@TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
48
49
	@@IF@@ @_Language_@ = "Ada"
	ln -fs ${PWD}/dataview/Ada/*.ads @_LOWER:Function_Names_@/Ada/src
Maxime Perrotin's avatar
Maxime Perrotin committed
50
	@@ELSIF@@ @_Language_@ = "C" or @_Language_@ = "CPP" or @_Language_@ = "GUI" or @_Language_@ = "Blackbox_C"
Maxime Perrotin's avatar
Maxime Perrotin committed
51
	ln -fs ${PWD}/dataview/C/*.h @_LOWER:Function_Names_@/@_Language_@/src
Maxime Perrotin's avatar
Maxime Perrotin committed
52
53
	@@ELSIF@@ @_Language_@ = "SDL"
	ln -fs ${PWD}/dataview/dataview-uniq.asn @_LOWER:Function_Names_@/@_Language_@/src
54
	@@ELSE@@
55
56
	ln -fs ${PWD}/dataview/@_Language_@/* @_LOWER:Function_Names_@/@_Language_@/src
	@@END_IF@@
57
	@@END_TABLE@@
58

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

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