MCPcopy Create free account
hub / github.com/apache/nuttx / do_dependency

Function do_dependency

tools/mkdeps.c:718–987  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

716}
717
718static void do_dependency(const char *file)
719{
720 const char * const * moption;
721 struct stat buf;
722 char *alloc;
723 char *altpath;
724 char *path;
725 char *lasts;
726 char separator;
727 int cmdlen;
728 int pathlen;
729 int filelen;
730 int totallen;
731 int ret;
732
733 /* Initialize the separator */
734
735#ifdef HOST_CYGWIN
736 separator = (g_winnative || g_winpath) ? '\\' : '/';
737#else
738 separator = g_winnative ? '\\' : '/';
739#endif
740
741 moption = g_moptions[get_compiler(g_cc)];
742
743 /* Copy the compiler into the command buffer */
744
745 cmdlen = strlen(g_cc);
746 if (cmdlen >= MAX_BUFFER)
747 {
748 fprintf(stderr, "ERROR: Compiler string is too long [%d/%d]: %s\n",
749 cmdlen, MAX_BUFFER, g_cc);
750 exit(EXIT_FAILURE);
751 }
752
753 strcpy(g_command, g_cc);
754
755 /* Copy " -MT " */
756
757 if (g_objpath)
758 {
759 char tmp[NAME_MAX + 6];
760 char *dupname;
761 char *objname;
762 char *dotptr;
763 const char *expanded;
764
765 dupname = strdup(file);
766 if (!dupname)
767 {
768 fprintf(stderr, "ERROR: Failed to dup: %s\n", file);
769 exit(EXIT_FAILURE);
770 }
771
772 /* Check g_altpath. If only the CURRENT path is included,
773 * the obj target use its own full path.
774 */
775

Callers 1

mainFunction · 0.85

Calls 15

fprintfFunction · 0.85
exitFunction · 0.85
strdupFunction · 0.85
basenameFunction · 0.85
strtok_rFunction · 0.85
strerrorFunction · 0.85
printfFunction · 0.85
get_compilerFunction · 0.70
do_expandFunction · 0.70
convert_pathFunction · 0.70
statClass · 0.70
strlenFunction · 0.50

Tested by

no test coverage detected