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
45104d9c
Commit
45104d9c
authored
Jan 01, 2014
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
makefiles: Determine module type based on the defined variables, and add some sanity checks.
parent
b1928795
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
26 deletions
+35
-26
make_makefiles
tools/make_makefiles
+35
-26
No files found.
tools/make_makefiles
View file @
45104d9c
...
...
@@ -269,7 +269,7 @@ sub parse_makefile($)
$make
{
"=rules"
}
=
$makerules
{
$var
}
||
$var
;
next
;
}
if
(
/^\s*(MODULE|IMPORTLIB|TESTDLL|PARENTSRC)\s*=\s*(.*)/
)
if
(
/^\s*(MODULE|IMPORTLIB|TESTDLL|PARENTSRC
|APPMODE
)\s*=\s*(.*)/
)
{
my
$var
=
$1
;
$make
{
$var
}
=
$2
;
...
...
@@ -302,9 +302,7 @@ sub parse_makefile($)
$
{
$make
{
"=flags"
}}{
"installbin"
}
=
1
if
$bin_install
{
$1
};
}
if
(
defined
$make
{
"=flags"
}
&&
defined
$make
{
"=rules"
}
&&
(
$make
{
"=rules"
}
eq
"MAKE_DLL_RULES"
||
$make
{
"=rules"
}
eq
"MAKE_PROG_RULES"
))
if
(
defined
$make
{
"=flags"
}
&&
defined
$make
{
"MODULE"
})
{
die
"Custom install-lib rule not allowed in $file"
if
defined
$
{
$make
{
"=flags"
}}{
"install-lib"
};
die
"Custom install-dev rule not allowed in $file"
if
defined
$
{
$make
{
"=flags"
}}{
"install-dev"
};
...
...
@@ -486,56 +484,67 @@ sub update_makefiles(@)
foreach
my
$file
(
sort
@_
)
{
my
%
make
=
%
{
$makefiles
{
$file
}};
next
unless
defined
$make
{
"=rules"
};
my
$rules
=
$make
{
"=rules"
};
my
$args
=
""
;
my
$is_win16
=
$make
{
"MODULE"
}
&&
(
$make
{
"MODULE"
}
=~
/16$/
||
$modules16
{
$make
{
"MODULE"
}});
my
$flag_args
=
defined
$make
{
"=flags"
}
?
",["
.
join
(
","
,
sort
keys
%
{
$make
{
"=flags"
}})
.
"]"
:
""
;
if
(
$rules
eq
"MAKE_DLL_RULES"
)
if
(
defined
(
$make
{
"TESTDLL"
}))
# test
{
die
"TESTDLL should not be defined in $file"
unless
$file
=~
/\/tests\/Makefile$/
;
die
"MODULE should not be defined in $file"
if
defined
$make
{
"MODULE"
};
die
"STATICLIB should not be defined in $file"
if
defined
$make
{
"STATICLIB"
};
(
my
$dir
=
$file
)
=~
s/^(.*)\/Makefile/$1/
;
push
@lines
,
"WINE_CONFIG_TEST($dir$flag_args)\n"
;
}
elsif
(
defined
(
$make
{
"MODULE"
})
&&
$make
{
"MODULE"
}
=~
/\.a$/
)
# import lib
{
die
"MODULE should not be defined as static lib in $file"
unless
$file
=~
/^dlls\//
;
die
"APPMODE should not be defined in $file"
if
defined
$make
{
"APPMODE"
};
die
"STATICLIB should not be defined in $file"
if
defined
$make
{
"STATICLIB"
};
(
my
$name
=
$file
)
=~
s/^dlls\/(.*)\/Makefile/$1/
;
push
@lines
,
"WINE_CONFIG_LIB($name$flag_args)\n"
;
}
elsif
(
defined
(
$make
{
"MODULE"
})
&&
defined
(
$make
{
"APPMODE"
}))
# program
{
die
"APPMODE should not be defined in $file"
unless
$file
=~
/^programs\//
;
die
"STATICLIB should not be defined in $file"
if
defined
$make
{
"STATICLIB"
};
(
my
$name
=
$file
)
=~
s/^programs\/(.*)\/Makefile/$1/
;
if
(
$name
=~
/\./
)
{
die
"Invalid MODULE in $file"
unless
$make
{
"MODULE"
}
eq
$name
;
}
else
{
die
"Invalid MODULE in $file"
unless
$make
{
"MODULE"
}
eq
"$name.
dll
"
;
die
"Invalid MODULE in $file"
unless
$make
{
"MODULE"
}
eq
"$name.
exe
"
;
}
my
$implib
=
$make
{
"IMPORTLIB"
}
||
""
;
$args
.=
","
if
$is_win16
||
defined
$make
{
"=flags"
};
$args
.=
"enable_win16"
if
$is_win16
;
$args
.=
$flag_args
;
$args
.=
",[$implib]"
if
$implib
&&
$implib
ne
$name
;
push
@lines
,
"WINE_CONFIG_DLL($name$args)\n"
;
push
@lines
,
"WINE_CONFIG_PROGRAM($name$args$flag_args)\n"
;
}
elsif
(
$rules
eq
"MAKE_PROG_RULES"
)
elsif
(
defined
(
$make
{
"MODULE"
}))
# dll
{
(
my
$name
=
$file
)
=~
s/^programs\/(.*)\/Makefile/$1/
;
die
"APPMODE should be defined in $file"
if
$file
=~
/^programs\//
;
die
"MODULE should not be defined in $file"
unless
$file
=~
/^dlls\//
;
die
"STATICLIB should not be defined in $file"
if
defined
$make
{
"STATICLIB"
};
(
my
$name
=
$file
)
=~
s/^dlls\/(.*)\/Makefile/$1/
;
if
(
$name
=~
/\./
)
{
die
"Invalid MODULE in $file"
unless
$make
{
"MODULE"
}
eq
$name
;
}
else
{
die
"Invalid MODULE in $file"
unless
$make
{
"MODULE"
}
eq
"$name.
exe
"
;
die
"Invalid MODULE in $file"
unless
$make
{
"MODULE"
}
eq
"$name.
dll
"
;
}
my
$implib
=
$make
{
"IMPORTLIB"
}
||
""
;
$args
.=
","
if
$is_win16
||
defined
$make
{
"=flags"
};
$args
.=
"enable_win16"
if
$is_win16
;
push
@lines
,
"WINE_CONFIG_PROGRAM($name$args$flag_args)\n"
;
}
elsif
(
$rules
eq
"MAKE_TEST_RULES"
)
{
(
my
$dir
=
$file
)
=~
s/^(.*)\/Makefile/$1/
;
push
@lines
,
"WINE_CONFIG_TEST($dir$flag_args)\n"
;
}
elsif
(
$rules
eq
"MAKE_IMPLIB_RULES"
)
{
(
my
$name
=
$file
)
=~
s/^dlls\/(.*)\/Makefile/$1/
;
push
@lines
,
"WINE_CONFIG_LIB($name$flag_args)\n"
;
$args
.=
$flag_args
;
$args
.=
",[$implib]"
if
$implib
&&
$implib
ne
$name
;
push
@lines
,
"WINE_CONFIG_DLL($name$args)\n"
;
}
elsif
(
$file
=~
/^tools.*\/Makefile$/
)
{
die
"APPMODE should not be defined in $file"
if
defined
$make
{
"APPMODE"
};
die
"STATICLIB should not be defined in $file"
if
defined
$make
{
"STATICLIB"
};
(
my
$name
=
$file
)
=~
s/^(.*)\/Makefile/$1/
;
push
@lines
,
"WINE_CONFIG_TOOL($name$flag_args)\n"
;
}
...
...
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