makefiles: Specify whether to install program binaries in the individual makefiles.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2015-10-30 14:15:45 +09:00
parent a748b7bc47
commit 17ac5ba7f9
14 changed files with 61 additions and 32 deletions

View File

@ -11,3 +11,5 @@ RC_SRCS = rsrc.rc
MANPAGES = msiexec.man.in
SVG_SRCS = msiexec.svg
INSTALL_LIB = msiexec.exe msiexec

View File

@ -11,3 +11,5 @@ RC_SRCS = notepad.rc
MANPAGES = notepad.man.in
SVG_SRCS = notepad.svg
INSTALL_LIB = notepad.exe notepad

View File

@ -20,3 +20,5 @@ RC_SRCS = regedit.rc
MANPAGES = regedit.man.in
SVG_SRCS = regedit.svg
INSTALL_LIB = regedit.exe regedit

View File

@ -8,3 +8,5 @@ C_SRCS = \
RC_SRCS = regsvr32.rc
MANPAGES = regsvr32.man.in
INSTALL_LIB = regsvr32.exe regsvr32

View File

@ -10,3 +10,5 @@ C_SRCS = \
RC_SRCS = wineboot.rc
MANPAGES = wineboot.man.in
INSTALL_LIB = wineboot.exe wineboot

View File

@ -22,3 +22,5 @@ MANPAGES = winecfg.man.in
SVG_SRCS = \
logo.svg \
winecfg.svg
INSTALL_LIB = winecfg.exe winecfg

View File

@ -13,3 +13,5 @@ C_SRCS = \
RC_SRCS = wineconsole.rc
MANPAGES = wineconsole.man.in
INSTALL_LIB = wineconsole.exe wineconsole

View File

@ -34,3 +34,5 @@ LEX_SRCS = debug.l
BISON_SRCS = dbg.y
MANPAGES = winedbg.man.in
INSTALL_LIB = winedbg.exe winedbg

View File

@ -12,3 +12,5 @@ RC_SRCS = winefile.rc
MANPAGES = winefile.man.in
SVG_SRCS = winefile.svg
INSTALL_LIB = winefile.exe winefile

View File

@ -12,3 +12,5 @@ RC_SRCS = winemine.rc
MANPAGES = winemine.man.in
SVG_SRCS = winemine.svg
INSTALL_LIB = winemine.exe winemine

View File

@ -4,3 +4,5 @@ APPMODE = -mconsole -municode
C_SRCS = winepath.c
MANPAGES = winepath.man.in
INSTALL_LIB = winepath.exe winepath

View File

@ -18,6 +18,8 @@ EXTRA_OBJS = build.res @ALL_TEST_RESOURCES@
EXTRA_TARGETS = build.rc build.nfo
INSTALL_LIB = none
build.rc: dummy
build="BUILD_INFO STRINGRES build.nfo STRINGTABLE { 1 \"`GIT_DIR=$(top_srcdir)/.git git rev-parse HEAD 2>/dev/null`\" }" && (echo $$build | cmp -s - $@) || echo $$build >$@ || ($(RM) $@ && exit 1)

View File

@ -21,28 +21,6 @@
use strict;
# Programs that we want to install in the bin directory too
my %bin_install =
(
"msiexec" => 1,
"notepad" => 1,
"regedit" => 1,
"regsvr32" => 1,
"wineboot" => 1,
"winecfg" => 1,
"wineconsole" => 1,
"winedbg" => 1,
"winefile" => 1,
"winemine" => 1,
"winepath" => 1,
);
# Programs that we don't want to install at all
my %dont_install =
(
"winetest" => 1,
);
# Dlls and programs that are 16-bit specific
my %modules16 =
(
@ -265,18 +243,11 @@ sub parse_makefile($)
${$make{"=flags"}}{"implib"} = 1 if $var eq "IMPORTLIB";
next;
}
if (/^\s*(BISON_SRCS|LEX_SRCS|IDL_SRCS|IMPLIB_SRCS|C_SRCS|OBJC_SRCS|MC_SRCS|RC_SRCS|SVG_SRCS|FONT_SRCS|IN_SRCS|PROGRAMS|EXTRA_TARGETS|MANPAGES)\s*=\s*(.*)/)
if (/^\s*(BISON_SRCS|LEX_SRCS|IDL_SRCS|IMPLIB_SRCS|C_SRCS|OBJC_SRCS|MC_SRCS|RC_SRCS|SVG_SRCS|FONT_SRCS|IN_SRCS|PROGRAMS|EXTRA_TARGETS|MANPAGES|INSTALL_LIB|INSTALL_DEV)\s*=\s*(.*)/)
{
my $var = $1;
my @list = split(/\s+/, $2);
$make{$var} = \@list;
${$make{"=flags"}}{"clean"} = 1 if $var eq "PROGRAMS";
${$make{"=flags"}}{"clean"} = 1 if $var eq "EXTRA_TARGETS";
next;
}
if (/^\s*INSTALL_(LIB|DEV)\s*=\s*/)
{
${$make{"=flags"}}{$1 eq "LIB" ? "install-lib" : "install-dev"} = 1;
next;
}
if (/(install-lib|install-dev|clean)\s*:/)
@ -296,10 +267,25 @@ sub parse_makefile($)
if ($file =~ /^programs\/([^\/]+)\/Makefile/)
{
${$make{"=flags"}}{"install"} = 1 unless $dont_install{$1};
${$make{"=flags"}}{"installbin"} = 1 if $bin_install{$1};
my $prog = $1;
if (defined $make{"INSTALL_LIB"})
{
${$make{"=flags"}}{"install"} = 1 if grep { "$prog.exe" eq $_; } @{$make{"INSTALL_LIB"}};
${$make{"=flags"}}{"installbin"} = 1 if grep { $prog eq $_; } @{$make{"INSTALL_LIB"}};
}
else
{
${$make{"=flags"}}{"install"} = 1;
}
}
unless (defined $make{"MODULE"})
{
${$make{"=flags"}}{"install-lib"} = 1 if defined $make{"INSTALL_LIB"};
${$make{"=flags"}}{"install-dev"} = 1 if defined $make{"INSTALL_DEV"};
}
${$make{"=flags"}}{"clean"} = 1 if defined $make{"PROGRAMS"} || defined $make{"EXTRA_TARGETS"};
if (defined $make{"=flags"} && defined $make{"MODULE"})
{
die "Custom install-lib rule not allowed in $file" if defined ${$make{"=flags"}}{"install-lib"};

View File

@ -2214,11 +2214,17 @@ static struct strarray output_sources( struct makefile *make, struct strarray *t
{
strarray_add( &all_targets, strmake( "%s%s", make->module, dll_ext ));
strarray_add( &all_targets, strmake( "%s.fake", make->module ));
add_install_rule( make, make->module, strmake( "%s%s", make->module, dll_ext ),
strmake( "p$(dlldir)/%s%s", make->module, dll_ext ));
add_install_rule( make, make->module, strmake( "%s.fake", make->module ),
strmake( "d$(fakedlldir)/%s", make->module ));
output( "%s%s %s.fake:", module_path, dll_ext, module_path );
}
else
{
strarray_add( &all_targets, make->module );
add_install_rule( make, make->module, make->module,
strmake( "p$(%s)/%s", spec_file ? "dlldir" : "bindir", make->module ));
output( "%s:", module_path );
}
if (spec_file) output_filename( spec_file );
@ -2253,6 +2259,8 @@ static struct strarray output_sources( struct makefile *make, struct strarray *t
output_filenames( target_flags );
if (make->is_win16) output_filename( "-m16" );
output( "\n" );
add_install_rule( make, make->importlib, strmake( "lib%s.def", make->importlib ),
strmake( "d$(dlldir)/lib%s.def", make->importlib ));
if (implib_objs.count)
{
strarray_add( &clean_files, strmake( "lib%s.def.a", make->importlib ));
@ -2264,6 +2272,8 @@ static struct strarray output_sources( struct makefile *make, struct strarray *t
output_filenames_obj_dir( make, implib_objs );
output( "\n" );
output( "\t$(RANLIB) $@\n" );
add_install_rule( make, make->importlib, strmake( "lib%s.def.a", make->importlib ),
strmake( "d$(dlldir)/lib%s.def.a", make->importlib ));
}
}
else
@ -2276,6 +2286,8 @@ static struct strarray output_sources( struct makefile *make, struct strarray *t
output_filenames( target_flags );
output_filenames_obj_dir( make, implib_objs );
output( "\n" );
add_install_rule( make, make->importlib, strmake( "lib%s.a", make->importlib ),
strmake( "d$(dlldir)/lib%s.a", make->importlib ));
}
if (crosstarget && !make->is_win16)
{
@ -2334,6 +2346,12 @@ static struct strarray output_sources( struct makefile *make, struct strarray *t
}
else output( "manpages htmlpages sgmlpages xmlpages::\n" );
}
else if (*dll_ext)
{
char *binary = replace_extension( make->module, ".exe", "" );
add_install_rule( make, binary, tools_dir_path( make, "wineapploader" ),
strmake( "s$(bindir)/%s", binary ));
}
}
if (make->staticlib)
@ -2819,6 +2837,7 @@ static void update_makefile( const char *path )
make->install_lib_rules = empty_strarray;
make->install_dev_rules = empty_strarray;
if (make->module && !make->install_lib.count) strarray_add( &make->install_lib, make->module );
make->include_args = empty_strarray;
make->define_args = empty_strarray;