This repository has been archived by the owner on Jun 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: remove "repeated" rules for builtin .h
This patch removed the common script sol-builtins-gen.py to generate builtins definition symbols and introduce new schema to generate the *builtins*.h with templates. Also removed all specific rules to generate each header file. Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
- Loading branch information
Leandro Dorileo
committed
Sep 2, 2015
1 parent
4d0f245
commit fd274c9
Showing
8 changed files
with
99 additions
and
148 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* this file was auto-generated by Soletta's template.py script */ | ||
|
||
#pragma once | ||
|
||
{{ | ||
import os | ||
def gen_builtins(decl, item, array, count, builtins): | ||
builtins = os.environ.get(builtins) | ||
builtins = builtins.strip() | ||
if builtins: | ||
builtins = builtins.replace("-","_").split(" ") | ||
decl = decl.replace("@NAME@", "%(NAME)s").replace("@name@", "%(name)s") | ||
item = item.replace("@NAME@", "%(NAME)s").replace("@name@", "%(name)s") | ||
for b in builtins: | ||
vrs = { | ||
"name": b.lower(), | ||
"NAME": b.upper() | ||
} | ||
st.println("extern %s;" % (decl % vrs)) | ||
if builtins: | ||
st.println("%s = {" % array) | ||
for b in builtins: | ||
vrs = { | ||
"name": b.lower(), | ||
"NAME": b.upper() | ||
} | ||
st.println(" %s," % (item % vrs)) | ||
st.println("};") | ||
st.println("#define %s %d" % (count, len(builtins))) | ||
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{{ | ||
st.include("../../../data/templates/builtins-common.tpl") | ||
|
||
array = "static const struct sol_pin_mux *SOL_PIN_MUX_BUILTINS_ALL[]" | ||
count = "SOL_PIN_MUX_BUILTIN_COUNT" | ||
decl = "const struct sol_pin_mux SOL_PIN_MUX_@NAME@" | ||
item = "&SOL_PIN_MUX_@NAME@" | ||
gen_builtins(decl, item, array, count, "builtin-pin-mux") | ||
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{{ | ||
st.include("../../../data/templates/builtins-common.tpl") | ||
|
||
array = "static const struct sol_platform_linux_micro_module *SOL_PLATFORM_LINUX_MICRO_MODULE_ALL[]" | ||
count = "SOL_PLATFORM_LINUX_MICRO_MODULE_COUNT" | ||
decl = "struct sol_platform_linux_micro_module SOL_PLATFORM_LINUX_MICRO_MODULE_@NAME@" | ||
item = "&SOL_PLATFORM_LINUX_MICRO_MODULE_@NAME@" | ||
gen_builtins(decl, item, array, count, "builtin-linux-micro") | ||
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{{ | ||
st.include("../../../data/templates/builtins-common.tpl") | ||
decl = "const struct sol_flow_node_type *sol_flow_foreach_builtin_node_type_@name@(bool (*)(void *, const struct sol_flow_node_type *), const void *)" | ||
item = "sol_flow_foreach_builtin_node_type_@name@" | ||
array = "static const void *SOL_FLOW_BUILTIN_NODE_TYPE_ALL[]" | ||
count = "SOL_FLOW_BUILTIN_NODE_TYPE_COUNT" | ||
gen_builtins(decl, item, array, count, "builtin-flows") | ||
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{{ | ||
st.include("../../../data/templates/builtins-common.tpl") | ||
|
||
array = "static const struct sol_flow_metatype *SOL_FLOW_METATYPE_BUILTINS_ALL[]" | ||
count = "SOL_FLOW_METATYPE_BUILTINS_COUNT" | ||
decl = "const struct sol_flow_metatype SOL_FLOW_METATYPE_@NAME@" | ||
item = "&SOL_FLOW_METATYPE_@NAME@" | ||
gen_builtins(decl, item, array, count, "builtin-flow-metatype") | ||
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters