makefile.tmplt 4.83 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
14
15
16
17
18
19
20
21
all: build-native

dataview : dataview/dataview-uniq.asn

build-native: dataview
	cd build && ocarina -x main.aadl && make -f Makefile.taste

build-rtems-ada: dataview
	cd build && ocarina -x main.aadl && make -f Makefile.taste rtems_ada
Maxime Perrotin's avatar
Maxime Perrotin committed
22

23
24
25
air: dataview
	cd build && ocarina -x main.aadl && make -f Makefile.taste air

Maxime Perrotin's avatar
Maxime Perrotin committed
26
27
28
29
30
@@INLINE(dataview/dataview-uniq.asn:)( )(\n)@@
        @@TABLE@@
           @_ASN1_Files_@
        @@END_TABLE@@
@@END_INLINE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
31
	mkdir -p ${HOME}/.taste_AST_cache && mkdir -p dataview
Maxime Perrotin's avatar
Maxime Perrotin committed
32
33
	@@-- Create dataview-uniq.asn
	@@INLINE(	)( )(\n)@@
Maxime Perrotin's avatar
Maxime Perrotin committed
34
        for f in
Maxime Perrotin's avatar
Maxime Perrotin committed
35
36
37
        @@TABLE@@
           @_ASN1_Files_@ 
        @@END_TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
38
; do cat $$f; echo; done > dataview/dataview-uniq.asn
Maxime Perrotin's avatar
Maxime Perrotin committed
39
	@@END_INLINE@@
40
41
42
43
	@@-- 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
44
	@@IF@@ not @_Is_Type_@
45
	    @_LOWER:Function_Names_@/@_Language_@/wrappers/@_LOWER:Function_Names_@_system_config.h
Maxime Perrotin's avatar
Maxime Perrotin committed
46
	@@END_IF@@
47
        @@END_TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
48
; do cat $$f; echo; done > build/system_config.h
49
50
	@@END_INLINE@@
	
51
	@@-- Generate DataView.aadl in AADLV1 as this is needed by aadl2glueC
Maxime Perrotin's avatar
Maxime Perrotin committed
52
	PROJECT_CACHE=${HOME}/.taste_AST_cache asn2aadlPlus dataview/dataview-uniq.asn dataview/dataview_aadlv1.aadl
53
54
	@@-- For each function generate the glue code from DMT based on the dataview
	@@TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
55
	@@IF@@ not @_Is_Type_@
Maxime Perrotin's avatar
Maxime Perrotin committed
56
	PROJECT_CACHE=${HOME}/.taste_AST_cache aadl2glueC -o @_LOWER:Function_Names_@/@_Language_@/wrappers dataview/dataview_aadlv1.aadl @_LOWER:Function_Names_@/@_Language_@/wrappers/@_LOWER:Function_Names_@_mini_cv.aadl
Maxime Perrotin's avatar
Maxime Perrotin committed
57
	@@END_IF@@
58
	@@END_TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
59
	@@-- Then generate Dataviews once per target language - first for C, it is needed in any case
Maxime Perrotin's avatar
Maxime Perrotin committed
60
	mkdir -p dataview/C && PROJECT_CACHE=${HOME}/.taste_AST_cache asn2dataModel -o dataview/C -toC dataview/dataview-uniq.asn \
Maxime Perrotin's avatar
Maxime Perrotin committed
61
62
63
64
	@@INLINE(	)( \\\n	)(\n)@@
	    @@TABLE@@
               @_REPLACE(,/ ):CP_Files_@
	    @@END_TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
65
66
67
	@@END_INLINE@@
	
        @@TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
68
	   @@IF@@ @_Unique_Languages_@ = "Ada" or @_Unique_Languages_@ = "SDL"
Maxime Perrotin's avatar
Maxime Perrotin committed
69
70
              @@SET@@ Enable=FALSE
              @@SET@@ Need_Ada=TRUE
Maxime Perrotin's avatar
Maxime Perrotin committed
71
	   @@ELSIF@@ @_Unique_Languages_@ = "C" or @_Unique_Languages_@ = "CPP" or @_Unique_Languages_@ = "Blackbox_C" or @_Unique_Languages_@ = "GUI"
Maxime Perrotin's avatar
Maxime Perrotin committed
72
              @@SET@@ Enable=FALSE
Maxime Perrotin's avatar
Maxime Perrotin committed
73
	   @@ELSE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
74
              @@SET@@ Enable=TRUE
Maxime Perrotin's avatar
Maxime Perrotin committed
75
76
              @@SET@@ Lang=@_Unique_Languages_@
	   @@END_IF@@
Maxime Perrotin's avatar
Maxime Perrotin committed
77
78
79
           @@IF@@ Enable=TRUE
               @@INLINE(	)(\n	)(\n)@@
                  mkdir -p dataview/@_Lang_@
Maxime Perrotin's avatar
Maxime Perrotin committed
80
                  PROJECT_CACHE=${HOME}/.taste_AST_cache asn2dataModel -o dataview/@_Lang_@ -to@_Lang_@ dataview/dataview-uniq.asn \
Maxime Perrotin's avatar
Maxime Perrotin committed
81
82
83
84
85
86
87
88
89
                  @@INLINE(	)( \\\n	)(\n	)@@
                     @@TABLE@@
                        @_REPLACE(,/ ):CP_Files_@
                     @@END_TABLE@@
                  @@END_INLINE@@
               @@END_INLINE@@
	   @@END_IF@@
	@@END_TABLE@@
	@@IF@@ @_Need_Ada_@=TRUE
Maxime Perrotin's avatar
Maxime Perrotin committed
90
	mkdir -p dataview/Ada && PROJECT_CACHE=${HOME}/.taste_AST_cache asn2dataModel -o dataview/Ada -toAda dataview/dataview-uniq.asn \
Maxime Perrotin's avatar
Maxime Perrotin committed
91
92
93
94
	@@INLINE(	)( \\\n	)(\n)@@
	    @@TABLE@@
               @_REPLACE(,/ ):CP_Files_@
	    @@END_TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
95
96
97
	@@END_INLINE@@

	cd dataview/Ada && rm -f gnat.cfg GPS_project.gpr IgnoredExaminerWarnings.wrn runSpark.sh
Maxime Perrotin's avatar
Maxime Perrotin committed
98
        @@END_IF@@
99
100
	cp $(shell taste-config --prefix)/share/AutoGUI/debug_messages.? dataview/C
	cp $(shell taste-config --prefix)/share/AutoGUI/timeInMS.? dataview/C
Maxime Perrotin's avatar
Maxime Perrotin committed
101
	cd dataview/C && PROJECT_CACHE=${HOME}/.taste_AST_cache msgPrinter ../dataview-uniq.asn && PROJECT_CACHE=${HOME}/.taste_AST_cache msgPrinterASN1 ../dataview-uniq.asn
102
103
	@@-- Then symlink the files for each function
	@@TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
104
	@@IF@@ @_Language_@ = "SDL"
Maxime Perrotin's avatar
Maxime Perrotin committed
105
	ln -fs ${OUTDIR}/dataview/dataview-uniq.asn @_LOWER:Function_Names_@/@_Language_@/src
106
	@@END_IF@@
107
	@@END_TABLE@@
108

Maxime Perrotin's avatar
Maxime Perrotin committed
109
function-types-linux:
Maxime Perrotin's avatar
Maxime Perrotin committed
110
	@@TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
111
	@@IF@@ @_Is_Type_@
Maxime Perrotin's avatar
Maxime Perrotin committed
112
	cd @_LOWER:Function_Names_@/@_Language_@ && make compile-linux
Maxime Perrotin's avatar
Maxime Perrotin committed
113
	@@END_IF@@
Maxime Perrotin's avatar
Maxime Perrotin committed
114
	@@END_TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
115
116
117
118
119
120
121
122
123

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
Maxime Perrotin's avatar
Maxime Perrotin committed
124
125
126
127
128

clean:
	rm -rf binaries/*

.PHONY: clean compile-all-linux function-instances-linux function-types-linux build-native dataview build-rtems-ada