mirror of
https://github.com/apache/nuttx.git
synced 2025-12-10 04:04:18 +08:00
tools/mkdeps.c:add options for gen full path object target
Check g_altpath. If only the CURRENT path is included, the obj target use its own full path, otherwise just use the filename. add default value current path for obj-path. Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
@@ -390,6 +390,10 @@ static void parse_args(int argc, char **argv)
|
||||
|
||||
g_altpath = strdup(".");
|
||||
|
||||
/* Ensure dep target obj path has a default value */
|
||||
|
||||
g_objpath = strdup(".");
|
||||
|
||||
/* Accumulate CFLAGS up to "--" */
|
||||
|
||||
for (argidx = 1; argidx < argc; argidx++)
|
||||
@@ -765,7 +769,19 @@ static void do_dependency(const char *file)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
objname = basename(dupname);
|
||||
/* Check g_altpath. If only the CURRENT path is included,
|
||||
* the obj target use its own full path.
|
||||
*/
|
||||
|
||||
if (strcmp(g_altpath, ".") == 0)
|
||||
{
|
||||
objname = dupname;
|
||||
}
|
||||
else
|
||||
{
|
||||
objname = basename(dupname);
|
||||
}
|
||||
|
||||
dotptr = strrchr(objname, '.');
|
||||
if (dotptr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user