makefile.tmplt 4.57 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))

13
14
export PROJECT_CACHE=${HOME}/.taste_AST_cache 

Maxime Perrotin's avatar
Maxime Perrotin committed
15
16
17
18
19
all: build-native

dataview : dataview/dataview-uniq.asn

build-native: dataview
20
	make -C build -f Makefile.taste
Maxime Perrotin's avatar
Maxime Perrotin committed
21
22

build-rtems-ada: dataview
23
	make -C build -f Makefile.taste rtems_ada
Maxime Perrotin's avatar
Maxime Perrotin committed
24

25
air: dataview
26
	make -C build -f Makefile.taste air
27

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

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

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

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
126
127
128

clean:
	rm -rf binaries/*
129
	make -C build -f Makefile.taste clean
Maxime Perrotin's avatar
Maxime Perrotin committed
130
131

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