Kaydet (Commit) 59fc2f43 authored tarafından Vladimir Glazounov's avatar Vladimir Glazounov

INTEGRATION: CWS vgbugs04 (1.7.62); FILE MERGED

2006/09/15 15:19:53 vg 1.7.62.5: #i69015# -n switsh for windows-native slashes
2006/09/04 13:49:59 vg 1.7.62.4: #i69015# add slash at the end of the string
2006/09/01 11:29:37 vg 1.7.62.3: #i69015# use dmake slash variable
2006/08/31 10:34:13 vg 1.7.62.2: #i69015# generic paths for windows
2006/07/04 10:37:14 vg 1.7.62.1: #137785# optimize makedepend
üst cf4a2364
...@@ -159,6 +159,8 @@ catch (sig) ...@@ -159,6 +159,8 @@ catch (sig)
struct sigaction sig_act; struct sigaction sig_act;
#endif /* USGISH */ #endif /* USGISH */
boolean native_win_slashes = FALSE;
int main(argc, argv) int main(argc, argv)
int argc; int argc;
char **argv; char **argv;
...@@ -172,6 +174,7 @@ int main(argc, argv) ...@@ -172,6 +174,7 @@ int main(argc, argv)
struct symtab *psymp = predefs; struct symtab *psymp = predefs;
char *endmarker = NULL; char *endmarker = NULL;
char *defincdir = NULL; char *defincdir = NULL;
struct IncludesCollection* incCollection;
ProgramName = argv[0]; ProgramName = argv[0];
...@@ -283,6 +286,10 @@ int main(argc, argv) ...@@ -283,6 +286,10 @@ int main(argc, argv)
} else } else
width = atoi(argv[0]+2); width = atoi(argv[0]+2);
break; break;
case 'n':
// Use "-n" switch to generate dependencies with windows-native slash style
native_win_slashes = TRUE;
break;
case 'o': case 'o':
if (endmarker) break; if (endmarker) break;
if (argv[0][2] == '\0') { if (argv[0][2] == '\0') {
...@@ -345,6 +352,10 @@ int main(argc, argv) ...@@ -345,6 +352,10 @@ int main(argc, argv)
warning("ignoring option %s\n", argv[0]); warning("ignoring option %s\n", argv[0]);
} }
} }
convert_slashes(objprefix);
objprefix = append_slash(objprefix);
if (!defincdir) { if (!defincdir) {
#ifdef PREINCDIR #ifdef PREINCDIR
if (incp >= includedirs + MAXDIRS) if (incp >= includedirs + MAXDIRS)
...@@ -436,11 +447,13 @@ int main(argc, argv) ...@@ -436,11 +447,13 @@ int main(argc, argv)
/* /*
* now peruse through the list of files. * now peruse through the list of files.
*/ */
incCollection = create_IncludesCollection();
for(fp=filelist; *fp; fp++) { for(fp=filelist; *fp; fp++) {
filecontent = getfile(*fp); filecontent = getfile(*fp);
ip = newinclude(*fp, (char *)NULL); ip = newinclude(*fp, (char *)NULL);
find_includes(filecontent, ip, ip, 0, FALSE); find_includes(filecontent, ip, ip, 0, FALSE, incCollection);
freefile(filecontent); freefile(filecontent);
recursive_pr_include(ip, ip->i_file, base_name(*fp)); recursive_pr_include(ip, ip->i_file, base_name(*fp));
inc_clean(); inc_clean();
...@@ -761,3 +774,41 @@ void warning1(msg,x1,x2,x3,x4,x5,x6,x7,x8,x9) ...@@ -761,3 +774,41 @@ void warning1(msg,x1,x2,x3,x4,x5,x6,x7,x8,x9)
#endif #endif
#endif /* DEBUG_MKDEPEND */ #endif /* DEBUG_MKDEPEND */
} }
void convert_slashes(path)
char* path;
{
#if defined (WNT)
/*
* Convert backslashes to slashes
*/
char *ptr;
if (native_win_slashes) {
for (ptr = (char*)path; *ptr; ++ptr)
if (*ptr == '/')
*ptr = '\\';
} else {
for (ptr = (char*)path; *ptr; ++ptr)
if (*ptr == '\\')
*ptr = '/';
};
#endif
}
char* append_slash(path)
char* path;
{
char *ptr, *new_string;
if ((path[strlen(path) - 1] == '/') || (path[strlen(path) - 1] == '\\')) {
new_string = path;
} else {
new_string = (char*)malloc(sizeof(char) * (strlen(path) + 2));
strcpy(new_string, path);
if (native_win_slashes)
strcat(new_string, "\\");
else
strcat(new_string, "/");
};
return new_string;
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment