Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9da18136
Commit
9da18136
authored
Jan 21, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
makefiles: Add helper functions to open generated include files.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9d1e3b3a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
50 deletions
+49
-50
makedep.c
tools/makedep.c
+49
-50
No files found.
tools/makedep.c
View file @
9da18136
...
...
@@ -1228,6 +1228,27 @@ static struct file *open_local_file( const struct makefile *make, const char *pa
/*******************************************************************
* open_local_generated_file
*
* Open a generated file in the directory of the makefile.
*/
static
struct
file
*
open_local_generated_file
(
const
struct
makefile
*
make
,
struct
incl_file
*
file
,
const
char
*
ext
,
const
char
*
src_ext
)
{
char
*
filename
;
struct
file
*
ret
=
NULL
;
if
(
strendswith
(
file
->
name
,
ext
)
&&
(
ret
=
open_local_file
(
make
,
replace_extension
(
file
->
name
,
ext
,
src_ext
),
&
filename
)))
{
file
->
sourcename
=
filename
;
file
->
filename
=
obj_dir_path
(
make
,
file
->
name
);
}
return
ret
;
}
/*******************************************************************
* open_global_file
*
* Open a file in the top-level source directory.
...
...
@@ -1255,6 +1276,27 @@ static struct file *open_global_header( const struct makefile *make, const char
/*******************************************************************
* open_global_generated_file
*
* Open a generated file in the top-level source directory.
*/
static
struct
file
*
open_global_generated_file
(
const
struct
makefile
*
make
,
struct
incl_file
*
file
,
const
char
*
ext
,
const
char
*
src_ext
)
{
char
*
filename
;
struct
file
*
ret
=
NULL
;
if
(
strendswith
(
file
->
name
,
ext
)
&&
(
ret
=
open_global_header
(
make
,
replace_extension
(
file
->
name
,
ext
,
src_ext
),
&
filename
)))
{
file
->
sourcename
=
filename
;
file
->
filename
=
strmake
(
"include/%s"
,
file
->
name
);
}
return
ret
;
}
/*******************************************************************
* open_src_file
*/
static
struct
file
*
open_src_file
(
const
struct
makefile
*
make
,
struct
incl_file
*
pFile
)
...
...
@@ -1306,30 +1348,13 @@ static int has_external_import( const struct makefile *make )
static
struct
file
*
open_include_file
(
const
struct
makefile
*
make
,
struct
incl_file
*
pFile
)
{
struct
file
*
file
=
NULL
;
char
*
filename
;
unsigned
int
i
,
len
;
errno
=
ENOENT
;
/* check for generated bison header */
if
(
strendswith
(
pFile
->
name
,
".tab.h"
)
&&
(
file
=
open_local_file
(
make
,
replace_extension
(
pFile
->
name
,
".tab.h"
,
".y"
),
&
filename
)))
{
pFile
->
sourcename
=
filename
;
pFile
->
filename
=
obj_dir_path
(
make
,
pFile
->
name
);
return
file
;
}
/* check for corresponding idl file in source dir */
if
(
strendswith
(
pFile
->
name
,
".h"
)
&&
(
file
=
open_local_file
(
make
,
replace_extension
(
pFile
->
name
,
".h"
,
".idl"
),
&
filename
)))
{
pFile
->
sourcename
=
filename
;
pFile
->
filename
=
obj_dir_path
(
make
,
pFile
->
name
);
return
file
;
}
/* check for generated files */
if
((
file
=
open_local_generated_file
(
make
,
pFile
,
".tab.h"
,
".y"
)))
return
file
;
if
((
file
=
open_local_generated_file
(
make
,
pFile
,
".h"
,
".idl"
)))
return
file
;
/* check for extra targets */
if
(
strarray_exists
(
&
make
->
extra_targets
,
pFile
->
name
))
...
...
@@ -1343,45 +1368,19 @@ static struct file *open_include_file( const struct makefile *make, struct incl_
if
((
file
=
open_local_file
(
make
,
pFile
->
name
,
&
pFile
->
filename
)))
return
file
;
/* check for global importlib (module dependency) */
if
(
pFile
->
type
==
INCL_IMPORTLIB
&&
find_importlib_module
(
pFile
->
name
))
{
pFile
->
filename
=
pFile
->
name
;
return
NULL
;
}
/* check for corresponding idl file in global includes */
if
(
strendswith
(
pFile
->
name
,
".h"
)
&&
(
file
=
open_global_header
(
make
,
replace_extension
(
pFile
->
name
,
".h"
,
".idl"
),
&
filename
)))
{
pFile
->
sourcename
=
filename
;
pFile
->
filename
=
strmake
(
"include/%s"
,
pFile
->
name
);
return
file
;
}
/* check for corresponding .in file in global includes (for config.h.in) */
if
(
strendswith
(
pFile
->
name
,
".h"
)
&&
(
file
=
open_global_header
(
make
,
replace_extension
(
pFile
->
name
,
".h"
,
".h.in"
),
&
filename
)))
{
pFile
->
sourcename
=
filename
;
pFile
->
filename
=
strmake
(
"include/%s"
,
pFile
->
name
);
return
file
;
}
/* check for corresponding .x file in global includes */
/* check for generated files in global includes */
if
((
file
=
open_global_generated_file
(
make
,
pFile
,
".h"
,
".idl"
)))
return
file
;
if
((
file
=
open_global_generated_file
(
make
,
pFile
,
".h"
,
".h.in"
)))
return
file
;
if
(
strendswith
(
pFile
->
name
,
"tmpl.h"
)
&&
(
file
=
open_global_header
(
make
,
replace_extension
(
pFile
->
name
,
".h"
,
".x"
),
&
filename
)))
{
pFile
->
sourcename
=
filename
;
pFile
->
filename
=
strmake
(
"include/%s"
,
pFile
->
name
);
return
file
;
}
(
file
=
open_global_generated_file
(
make
,
pFile
,
".h"
,
".x"
)))
return
file
;
/* check in global includes source dir */
if
((
file
=
open_global_header
(
make
,
pFile
->
name
,
&
pFile
->
filename
)))
return
file
;
/* check in global msvcrt includes */
...
...
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