diff options
author | Dinesh Dwivedi <dinesh.d@samsung.com> | 2015-03-31 17:40:30 +0200 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2015-03-31 18:03:56 +0200 |
commit | 70df9f48bae3a55ab9bd0e9ca555f6cfb8b2da4c (patch) | |
tree | 4a7690dbd610cf9316b668f6ac7cf676a9e50dce /src/bin/edje | |
parent | 22fafce84d015368ac4838d7fd129f76218df9da (diff) |
edje: add option to dump gnu style include dependencies in edje_cc.
Summary:
We were facing one problem in tizen sdk's build system as it does not trigger build for edc file
if only sub-edc files are changed. During analysis, we found that there is no option in edje_cc
for dumping include dependencies which other compiler (clang/ gcc etc) does have. We can do other
hack to solve this problem but it will be great if edje_cc can emit gnu style include dependency
target.
This patch will add support to generate gnu format include dependency file while compiling edc file.
similar to what gcc generates with option '-MMD -MF=<dep_file> -MT<dep_file>'
https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Preprocessor-Options.html
Test Plan: no failure in existing test
Reviewers: raster, cedric
Reviewed By: cedric
Projects: #efl
Differential Revision: https://phab.enlightenment.org/D2263
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/bin/edje')
-rw-r--r-- | src/bin/edje/edje_cc.c | 8 | ||||
-rw-r--r-- | src/bin/edje/edje_cc.h | 1 | ||||
-rw-r--r-- | src/bin/edje/edje_cc_parse.c | 8 | ||||
-rw-r--r-- | src/bin/edje/epp/cpplib.c | 17 |
4 files changed, 29 insertions, 5 deletions
diff --git a/src/bin/edje/edje_cc.c b/src/bin/edje/edje_cc.c index df58b6e1c6..87e69a55a3 100644 --- a/src/bin/edje/edje_cc.c +++ b/src/bin/edje/edje_cc.c | |||
@@ -22,6 +22,7 @@ char *file_in = NULL; | |||
22 | char *tmp_dir = NULL; | 22 | char *tmp_dir = NULL; |
23 | char *file_out = NULL; | 23 | char *file_out = NULL; |
24 | char *watchfile = NULL; | 24 | char *watchfile = NULL; |
25 | char *depfile = NULL; | ||
25 | char *authors = NULL; | 26 | char *authors = NULL; |
26 | char *license = NULL; | 27 | char *license = NULL; |
27 | Eina_List *licenses = NULL; | 28 | Eina_List *licenses = NULL; |
@@ -91,6 +92,7 @@ main_help(void) | |||
91 | "\n" | 92 | "\n" |
92 | "-w files.txt Dump all sources files path into files.txt\n" | 93 | "-w files.txt Dump all sources files path into files.txt\n" |
93 | "-anotate Anotate the dumped files.\n" | 94 | "-anotate Anotate the dumped files.\n" |
95 | "-deps files.txt Dump gnu style include dependencies path into files.txt\n" | ||
94 | "-id image/directory Add a directory to look in for relative path images\n" | 96 | "-id image/directory Add a directory to look in for relative path images\n" |
95 | "-fd font/directory Add a directory to look in for relative path fonts\n" | 97 | "-fd font/directory Add a directory to look in for relative path fonts\n" |
96 | "-sd sound/directory Add a directory to look in for relative path sounds samples\n" | 98 | "-sd sound/directory Add a directory to look in for relative path sounds samples\n" |
@@ -281,6 +283,12 @@ main(int argc, char **argv) | |||
281 | { | 283 | { |
282 | anotate = 1; | 284 | anotate = 1; |
283 | } | 285 | } |
286 | else if ((!strcmp(argv[i], "-deps")) && (i < (argc - 1))) | ||
287 | { | ||
288 | i++; | ||
289 | depfile = argv[i]; | ||
290 | unlink(depfile); | ||
291 | } | ||
284 | else if (!file_in) | 292 | else if (!file_in) |
285 | file_in = argv[i]; | 293 | file_in = argv[i]; |
286 | else if (!file_out) | 294 | else if (!file_out) |
diff --git a/src/bin/edje/edje_cc.h b/src/bin/edje/edje_cc.h index d5ee9aa6c3..a54341f8f6 100644 --- a/src/bin/edje/edje_cc.h +++ b/src/bin/edje/edje_cc.h | |||
@@ -258,6 +258,7 @@ extern Eina_List *data_dirs; | |||
258 | extern char *file_in; | 258 | extern char *file_in; |
259 | extern char *file_out; | 259 | extern char *file_out; |
260 | extern char *watchfile; | 260 | extern char *watchfile; |
261 | extern char *depfile; | ||
261 | extern char *license; | 262 | extern char *license; |
262 | extern char *authors; | 263 | extern char *authors; |
263 | extern Eina_List *licenses; | 264 | extern Eina_List *licenses; |
diff --git a/src/bin/edje/edje_cc_parse.c b/src/bin/edje/edje_cc_parse.c index ef35ef2e36..bfe80d2317 100644 --- a/src/bin/edje/edje_cc_parse.c +++ b/src/bin/edje/edje_cc_parse.c | |||
@@ -972,7 +972,13 @@ compile(void) | |||
972 | eina_prefix_lib_get(pfx)); | 972 | eina_prefix_lib_get(pfx)); |
973 | if (ecore_file_exists(buf2)) | 973 | if (ecore_file_exists(buf2)) |
974 | { | 974 | { |
975 | if (anotate) | 975 | if (depfile) |
976 | snprintf(buf, sizeof(buf), "%s -MMD %s -MT %s %s -I%s %s -o %s" | ||
977 | " -DEFL_VERSION_MAJOR=%d -DEFL_VERSION_MINOR=%d", | ||
978 | buf2, depfile, file_out, file_in, | ||
979 | inc, def, clean_file, | ||
980 | EINA_VERSION_MAJOR, EINA_VERSION_MINOR); | ||
981 | else if (anotate) | ||
976 | snprintf(buf, sizeof(buf), "%s -anotate -a %s %s -I%s %s -o %s" | 982 | snprintf(buf, sizeof(buf), "%s -anotate -a %s %s -I%s %s -o %s" |
977 | " -DEFL_VERSION_MAJOR=%d -DEFL_VERSION_MINOR=%d", | 983 | " -DEFL_VERSION_MAJOR=%d -DEFL_VERSION_MINOR=%d", |
978 | buf2, watchfile ? watchfile : "/dev/null", file_in, | 984 | buf2, watchfile ? watchfile : "/dev/null", file_in, |
diff --git a/src/bin/edje/epp/cpplib.c b/src/bin/edje/epp/cpplib.c index af6dbfb582..22a4c7aacf 100644 --- a/src/bin/edje/epp/cpplib.c +++ b/src/bin/edje/epp/cpplib.c | |||
@@ -6502,10 +6502,10 @@ cpp_handle_options(cpp_reader * pfile, int argc, char **argv) | |||
6502 | /* The style of the choices here is a bit mixed. | 6502 | /* The style of the choices here is a bit mixed. |
6503 | * The chosen scheme is a hybrid of keeping all options in one string | 6503 | * The chosen scheme is a hybrid of keeping all options in one string |
6504 | * and specifying each option in a separate argument: | 6504 | * and specifying each option in a separate argument: |
6505 | * -M|-MM|-MD file|-MMD file [-MG]. An alternative is: | 6505 | * -M|-MM|-MT file|-MD file|-MMD file [-MG]. An alternative is: |
6506 | * -M|-MM|-MD file|-MMD file|-MG|-MMG; or more concisely: | 6506 | * -M|-MM|-MT file|-MD file|-MMD file|-MG|-MMG; or more concisely: |
6507 | * -M[M][G][D file]. This is awkward to handle in specs, and is not | 6507 | * -M[M][G][D file][T file]. This is awkward to handle in specs, and is |
6508 | * as extensible. */ | 6508 | * not as extensible. */ |
6509 | /* ??? -MG must be specified in addition to one of -M or -MM. | 6509 | /* ??? -MG must be specified in addition to one of -M or -MM. |
6510 | * This can be relaxed in the future without breaking anything. | 6510 | * This can be relaxed in the future without breaking anything. |
6511 | * The converse isn't true. */ | 6511 | * The converse isn't true. */ |
@@ -6532,6 +6532,15 @@ cpp_handle_options(cpp_reader * pfile, int argc, char **argv) | |||
6532 | argv[i]); | 6532 | argv[i]); |
6533 | opts->deps_file = argv[++i]; | 6533 | opts->deps_file = argv[++i]; |
6534 | } | 6534 | } |
6535 | /* For MT option, use file named by next arg as Target-name to write | ||
6536 | * with the dependency information. */ | ||
6537 | else if (!strcmp(argv[i], "-MT")) | ||
6538 | { | ||
6539 | if (i + 1 == argc) | ||
6540 | cpp_fatal("Filename missing after %s option", | ||
6541 | argv[i]); | ||
6542 | opts->deps_target = argv[++i]; | ||
6543 | } | ||
6535 | else | 6544 | else |
6536 | { | 6545 | { |
6537 | /* For -M and -MM, write deps on standard output | 6546 | /* For -M and -MM, write deps on standard output |