makefile.tmplt 2.52 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
16
17
18
19
20
21
22
	mkdir -p dataview
	@@-- Create dataview-uniq.asn
	@@INLINE(	)( )(\n)@@
        cat
        @@TABLE@@
           @_ASN1_Files_@ 
        @@END_TABLE@@
        > dataview/dataview-uniq.asn
	@@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"
26
	if [ ! -d dataview/Ada ]; then mkdir dataview/Ada && mono $(shell which asn1.exe) -Ada -typePrefix asn1Scc -o dataview/Ada dataview/dataview-uniq.asn @_REPLACE(,/ ):CP_Files_@ ; fi
27
	cd dataview/Ada && rm -f gnat.cfg GPS_project.gpr IgnoredExaminerWarnings.wrn runSpark.sh
Maxime Perrotin's avatar
Maxime Perrotin committed
28
	@@ELSIF@@ @_Unique_Languages_@ = "C" or @_Unique_Languages_@ = "CPP"
29
	if [ ! -d dataview/C ]; then mkdir dataview/C && mono $(shell which asn1.exe) -c -typePrefix asn1Scc -o dataview/C dataview/dataview-uniq.asn @_REPLACE(,/ ):CP_Files_@ ; fi
Maxime Perrotin's avatar
Maxime Perrotin committed
30
	@@ELSE@@
31
	mkdir -p dataview/@_Unique_Languages_@
Maxime Perrotin's avatar
Maxime Perrotin committed
32
	asn2dataModel -o dataview/@_Unique_Languages_@ -to@_Unique_Languages_@ dataview/dataview-uniq.asn
33
34
35
36
37
	@@END_IF@@
	@@END_IF@@
        @@END_TABLE@@
	@@-- Then symlink the files for each function
	@@TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
38
39
	@@IF@@ @_Language_@ = "Ada"
	ln -fs ${PWD}/dataview/Ada/*.ads @_LOWER:Function_Names_@/Ada/src
40
	@@ELSIF@@ @_Language_@ = "C" or @_Language_@ = "CPP" or @_Language_@ = "GUI"
Maxime Perrotin's avatar
Maxime Perrotin committed
41
	ln -fs ${PWD}/dataview/C/*.h @_LOWER:Function_Names_@/@_Language_@/src
Maxime Perrotin's avatar
Maxime Perrotin committed
42
43
	@@ELSIF@@ @_Language_@ = "SDL"
	ln -fs ${PWD}/dataview/dataview-uniq.asn @_LOWER:Function_Names_@/@_Language_@/src
44
	@@ELSE@@
45
46
	ln -fs ${PWD}/dataview/@_Language_@/* @_LOWER:Function_Names_@/@_Language_@/src
	@@END_IF@@
47
	@@END_TABLE@@
48

Maxime Perrotin's avatar
Maxime Perrotin committed
49
function-types-linux:
Maxime Perrotin's avatar
Maxime Perrotin committed
50
	@@TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
51
	@@IF@@ @_Is_Type_@
Maxime Perrotin's avatar
Maxime Perrotin committed
52
	cd @_LOWER:Function_Names_@/@_Language_@ && make compile-linux
Maxime Perrotin's avatar
Maxime Perrotin committed
53
	@@END_IF@@
Maxime Perrotin's avatar
Maxime Perrotin committed
54
	@@END_TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
55
56
57
58
59
60
61
62
63

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