Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ded32d51
Commit
ded32d51
authored
Aug 01, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
makedep: Always search for includes in the standard directories, even without -I option.
parent
dea28ee4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
25 deletions
+70
-25
Make.rules.in
Make.rules.in
+1
-1
makedep.c
tools/makedep.c
+69
-24
No files found.
Make.rules.in
View file @
ded32d51
...
...
@@ -203,7 +203,7 @@ $(SUBDIRS:%=%/__depend__): dummy
cd `dirname $@` && $(MAKE) depend
depend: $(IDL_SRCS:.idl=.h) $(SUBDIRS:%=%/__depend__)
$(MAKEDEP) -C$(SRCDIR) -S$(TOPSRCDIR) -T$(TOPOBJDIR) $(
INCLUDES
) $(C_SRCS) $(C_SRCS16) $(RC_SRCS) $(RC_SRCS16) $(MC_SRCS) $(IDL_SRCS) $(EXTRA_SRCS)
$(MAKEDEP) -C$(SRCDIR) -S$(TOPSRCDIR) -T$(TOPOBJDIR) $(
EXTRAINCL
) $(C_SRCS) $(C_SRCS16) $(RC_SRCS) $(RC_SRCS16) $(MC_SRCS) $(IDL_SRCS) $(EXTRA_SRCS)
.PHONY: depend $(SUBDIRS:%=%/__depend__)
...
...
tools/makedep.c
View file @
ded32d51
...
...
@@ -128,6 +128,29 @@ static char *xstrdup( const char *str )
/*******************************************************************
* strmake
*/
char
*
strmake
(
const
char
*
fmt
,
...
)
{
int
n
;
size_t
size
=
100
;
va_list
ap
;
for
(;;)
{
char
*
p
=
xmalloc
(
size
);
va_start
(
ap
,
fmt
);
n
=
vsnprintf
(
p
,
size
,
fmt
,
ap
);
va_end
(
ap
);
if
(
n
==
-
1
)
size
*=
2
;
else
if
((
size_t
)
n
>=
size
)
size
=
n
+
1
;
else
return
p
;
free
(
p
);
}
}
/*******************************************************************
* get_extension
*/
static
char
*
get_extension
(
char
*
filename
)
...
...
@@ -305,10 +328,7 @@ static FILE *open_src_file( INCL_FILE *pFile )
/* now try in source dir */
if
(
src_dir
)
{
pFile
->
filename
=
xmalloc
(
strlen
(
src_dir
)
+
strlen
(
pFile
->
name
)
+
2
);
strcpy
(
pFile
->
filename
,
src_dir
);
strcat
(
pFile
->
filename
,
"/"
);
strcat
(
pFile
->
filename
,
pFile
->
name
);
pFile
->
filename
=
strmake
(
"%s/%s"
,
src_dir
,
pFile
->
name
);
file
=
fopen
(
pFile
->
filename
,
"r"
);
}
if
(
!
file
)
...
...
@@ -326,43 +346,62 @@ static FILE *open_src_file( INCL_FILE *pFile )
static
FILE
*
open_include_file
(
INCL_FILE
*
pFile
)
{
FILE
*
file
=
NULL
;
char
*
filename
,
*
p
;
INCL_PATH
*
path
;
errno
=
ENOENT
;
LIST_FOR_EACH_ENTRY
(
path
,
&
paths
,
INCL_PATH
,
entry
)
/* first try name as is */
if
((
file
=
fopen
(
pFile
->
name
,
"r"
)))
{
char
*
filename
=
xmalloc
(
strlen
(
path
->
name
)
+
strlen
(
pFile
->
name
)
+
2
);
strcpy
(
filename
,
path
->
name
);
strcat
(
filename
,
"/"
);
strcat
(
filename
,
pFile
->
name
);
if
((
file
=
fopen
(
filename
,
"r"
)))
pFile
->
filename
=
xstrdup
(
pFile
->
name
);
return
file
;
}
/* now try in source dir */
if
(
src_dir
)
{
pFile
->
filename
=
filename
;
break
;
filename
=
strmake
(
"%s/%s"
,
src_dir
,
pFile
->
name
);
if
((
file
=
fopen
(
filename
,
"r"
)))
goto
found
;
free
(
filename
);
}
/* now try in global includes */
if
(
top_obj_dir
)
{
filename
=
strmake
(
"%s/include/%s"
,
top_obj_dir
,
pFile
->
name
);
if
((
file
=
fopen
(
filename
,
"r"
)))
goto
found
;
free
(
filename
);
}
if
(
top_src_dir
)
{
filename
=
strmake
(
"%s/include/%s"
,
top_src_dir
,
pFile
->
name
);
if
((
file
=
fopen
(
filename
,
"r"
)))
goto
found
;
free
(
filename
);
}
if
(
!
file
&&
pFile
->
system
)
return
NULL
;
/* ignore system files we cannot find */
/*
try in src file directory
*/
if
(
!
file
)
/*
now search in include paths
*/
LIST_FOR_EACH_ENTRY
(
path
,
&
paths
,
INCL_PATH
,
entry
)
{
char
*
p
=
strrchr
(
pFile
->
included_by
->
filename
,
'/'
);
if
(
p
)
filename
=
strmake
(
"%s/%s"
,
path
->
name
,
pFile
->
name
);
if
((
file
=
fopen
(
filename
,
"r"
)))
goto
found
;
free
(
filename
);
}
if
(
pFile
->
system
)
return
NULL
;
/* ignore system files we cannot find */
/* try in src file directory */
if
((
p
=
strrchr
(
pFile
->
included_by
->
filename
,
'/'
)))
{
int
l
=
p
-
pFile
->
included_by
->
filename
+
1
;
char
*
filename
=
xmalloc
(
l
+
strlen
(
pFile
->
name
)
+
1
);
filename
=
xmalloc
(
l
+
strlen
(
pFile
->
name
)
+
1
);
memcpy
(
filename
,
pFile
->
included_by
->
filename
,
l
);
strcpy
(
filename
+
l
,
pFile
->
name
);
if
((
file
=
fopen
(
filename
,
"r"
)))
pFile
->
filename
=
filename
;
else
free
(
filename
);
}
if
((
file
=
fopen
(
filename
,
"r"
)))
goto
found
;
free
(
filename
);
}
if
(
!
file
)
{
if
(
pFile
->
included_by
->
system
)
return
NULL
;
/* ignore if included by a system file */
perror
(
pFile
->
name
);
while
(
pFile
->
included_by
)
{
...
...
@@ -371,7 +410,9 @@ static FILE *open_include_file( INCL_FILE *pFile )
pFile
=
pFile
->
included_by
;
}
exit
(
1
);
}
found:
pFile
->
filename
=
filename
;
return
file
;
}
...
...
@@ -630,6 +671,10 @@ int main( int argc, char *argv[] )
else
i
++
;
}
/* ignore redundant source paths */
if
(
src_dir
&&
!
strcmp
(
src_dir
,
"."
))
src_dir
=
NULL
;
if
(
top_src_dir
&&
top_obj_dir
&&
!
strcmp
(
top_src_dir
,
top_obj_dir
))
top_src_dir
=
NULL
;
/* get rid of absolute paths that don't point into the source dir */
LIST_FOR_EACH_ENTRY_SAFE
(
path
,
next
,
&
paths
,
INCL_PATH
,
entry
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment