block.tmplt 2.63 KB
Newer Older
1
2
3
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@             : Protected block name
4
@@-- @_Partition_Name_@   : Containing partition name
5
@@-- @_Language_@         : Implementation language
6
@@-- ...all function attribute: Zip_File, etc... are also available
7
8
@@-- @_Calling_Threads_@  : List of calling threads
@@-- @_Node name_@        : Node name
Maxime Perrotin's avatar
Maxime Perrotin committed
9
10
@@-- @_Protected_PIs_@    : Protected Provided interfaces (from pi.tmplt)
@@-- @_Unprotected_PIs_@  : Unprotected Provided interfaces (from pi.tmplt)
11
@@-- @_Required_@         : Required interfaces (from ri.tmplt)
12
@@-- @_Is_Shared_Type_@   : True if instance and parent in shared folder
Maxime Perrotin's avatar
Maxime Perrotin committed
13
@@IF@@ @_Language_@ = SDL
14
15
@_LOWER:Name_@:	../@_LOWER:Name_@/SDL/code/@_LOWER:Name_@.adb

16
@@IF@@ @_Instance_Of_@ = ""
17
../@_LOWER:Name_@/SDL/code/@_LOWER:Name_@.adb:	../@_LOWER:Name_@/SDL/src/@_LOWER:Name_@.pr ../@_LOWER:Name_@/SDL/src/system_structure.pr
18
@@ELSIF@@ not @_Is_Shared_Type_@
19
../@_LOWER:Name_@/SDL/code/@_LOWER:Name_@.adb:	../@_LOWER:Instance_Of_@/SDL/src/@_LOWER:Instance_Of_@.pr ../@_LOWER:Instance_Of_@/SDL/src/system_structure.pr
20
21
@@ELSE@@
../@_LOWER:Name_@/SDL/code/@_LOWER:Name_@.adb:	@_Shared_Lib_Dir_@/@_LOWER:Instance_Of_@/@_LOWER:Instance_Of_@/SDL/src/@_LOWER:Instance_Of_@.pr @_Shared_Lib_Dir_@/@_LOWER:Instance_Of_@/@_LOWER:Instance_Of_@/SDL/src/system_structure.pr
22
@@END_IF@@
Maxime Perrotin's avatar
Maxime Perrotin committed
23
	# Call opengeode to generate the functional code
24
	$(MAKE) -j -C ../@_LOWER:Name_@/SDL generate-code
25
26
@@ELSIF@@ @_Zip_File_@ /= ""
@_LOWER:Name_@:
27
28
29
	@# -u does not overwrite existing files (e.g. the .h generated by kazoo)
	@# -j extracts everything in the folder specified with -d, removing subdirectories
	unzip -j -u @_Zip_File_@ -d ../@_LOWER:Name_@/@_Language_@/src 
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
@@ELSIF@@ @_LOWER:Name_@ = taste_probe_console
# Generate Peek-Poke code
@_LOWER:Name_@: ../binaries/peekpoke

../binaries/peekpoke:
	echo "cd @_LOWER:Name_@_GUI && ./peekpoke.py ../@_Partition_Name_@" > $@
	chmod +x ../binaries/peekpoke
	echo "ASSERT_IGNORE_GUI_ERRORS=1 ./@_Partition_Name_@ & sleep 1 ; ./peekpoke ; pkill @_Partition_Name_@" > ../binaries/run_@_Partition_Name_@_partition
	chmod +x ../binaries/run_@_Partition_Name_@_partition
@@ELSIF@@ @_Language_@ = GUI
# Provide scripts to run the gui and its partition automatically
@_LOWER:Name_@: ../binaries/@_Name_@

../binaries/@_Name_@:
	echo "cd @_LOWER:Name_@_GUI && taste-gui" > $@
	chmod +x $@
	echo "./@_Partition_Name_@ & sleep 1 ; ./@_Name_@ ; pkill @_Partition_Name_@" > ../binaries/run_@_Partition_Name_@_partition
	chmod +x ../binaries/run_@_Partition_Name_@_partition
Maxime Perrotin's avatar
Maxime Perrotin committed
48
@@ELSE@@
49
50
@_LOWER:Name_@:
	@# Placeholder if anything has to be done for this function coded in @_Language_@
Maxime Perrotin's avatar
Maxime Perrotin committed
51
@@END_IF@@