From 17ac5ba7f9909bfbd3c80c87a077f72ef4c1d19b Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 30 Oct 2015 14:15:45 +0900 Subject: [PATCH] makefiles: Specify whether to install program binaries in the individual makefiles. Signed-off-by: Alexandre Julliard --- programs/msiexec/Makefile.in | 2 ++ programs/notepad/Makefile.in | 2 ++ programs/regedit/Makefile.in | 2 ++ programs/regsvr32/Makefile.in | 2 ++ programs/wineboot/Makefile.in | 2 ++ programs/winecfg/Makefile.in | 2 ++ programs/wineconsole/Makefile.in | 2 ++ programs/winedbg/Makefile.in | 2 ++ programs/winefile/Makefile.in | 2 ++ programs/winemine/Makefile.in | 2 ++ programs/winepath/Makefile.in | 2 ++ programs/winetest/Makefile.in | 2 ++ tools/make_makefiles | 50 ++++++++++++-------------------- tools/makedep.c | 19 ++++++++++++ 14 files changed, 61 insertions(+), 32 deletions(-) diff --git a/programs/msiexec/Makefile.in b/programs/msiexec/Makefile.in index 6d0cf9a57e5..7686b105656 100644 --- a/programs/msiexec/Makefile.in +++ b/programs/msiexec/Makefile.in @@ -11,3 +11,5 @@ RC_SRCS = rsrc.rc MANPAGES = msiexec.man.in SVG_SRCS = msiexec.svg + +INSTALL_LIB = msiexec.exe msiexec diff --git a/programs/notepad/Makefile.in b/programs/notepad/Makefile.in index 26e977d8e74..e5d39a8f746 100644 --- a/programs/notepad/Makefile.in +++ b/programs/notepad/Makefile.in @@ -11,3 +11,5 @@ RC_SRCS = notepad.rc MANPAGES = notepad.man.in SVG_SRCS = notepad.svg + +INSTALL_LIB = notepad.exe notepad diff --git a/programs/regedit/Makefile.in b/programs/regedit/Makefile.in index c5dfd81f535..acbfbd4f8ee 100644 --- a/programs/regedit/Makefile.in +++ b/programs/regedit/Makefile.in @@ -20,3 +20,5 @@ RC_SRCS = regedit.rc MANPAGES = regedit.man.in SVG_SRCS = regedit.svg + +INSTALL_LIB = regedit.exe regedit diff --git a/programs/regsvr32/Makefile.in b/programs/regsvr32/Makefile.in index 15646a6b7ec..e91f20605ea 100644 --- a/programs/regsvr32/Makefile.in +++ b/programs/regsvr32/Makefile.in @@ -8,3 +8,5 @@ C_SRCS = \ RC_SRCS = regsvr32.rc MANPAGES = regsvr32.man.in + +INSTALL_LIB = regsvr32.exe regsvr32 diff --git a/programs/wineboot/Makefile.in b/programs/wineboot/Makefile.in index f6da0f9df65..419ec1621a6 100644 --- a/programs/wineboot/Makefile.in +++ b/programs/wineboot/Makefile.in @@ -10,3 +10,5 @@ C_SRCS = \ RC_SRCS = wineboot.rc MANPAGES = wineboot.man.in + +INSTALL_LIB = wineboot.exe wineboot diff --git a/programs/winecfg/Makefile.in b/programs/winecfg/Makefile.in index 4e66e04e31a..7b52a6943e4 100644 --- a/programs/winecfg/Makefile.in +++ b/programs/winecfg/Makefile.in @@ -22,3 +22,5 @@ MANPAGES = winecfg.man.in SVG_SRCS = \ logo.svg \ winecfg.svg + +INSTALL_LIB = winecfg.exe winecfg diff --git a/programs/wineconsole/Makefile.in b/programs/wineconsole/Makefile.in index 6cde7e34447..b1ba9effb14 100644 --- a/programs/wineconsole/Makefile.in +++ b/programs/wineconsole/Makefile.in @@ -13,3 +13,5 @@ C_SRCS = \ RC_SRCS = wineconsole.rc MANPAGES = wineconsole.man.in + +INSTALL_LIB = wineconsole.exe wineconsole diff --git a/programs/winedbg/Makefile.in b/programs/winedbg/Makefile.in index a56c3595835..739c4ebc310 100644 --- a/programs/winedbg/Makefile.in +++ b/programs/winedbg/Makefile.in @@ -34,3 +34,5 @@ LEX_SRCS = debug.l BISON_SRCS = dbg.y MANPAGES = winedbg.man.in + +INSTALL_LIB = winedbg.exe winedbg diff --git a/programs/winefile/Makefile.in b/programs/winefile/Makefile.in index ac58f2675af..f400846d0b7 100644 --- a/programs/winefile/Makefile.in +++ b/programs/winefile/Makefile.in @@ -12,3 +12,5 @@ RC_SRCS = winefile.rc MANPAGES = winefile.man.in SVG_SRCS = winefile.svg + +INSTALL_LIB = winefile.exe winefile diff --git a/programs/winemine/Makefile.in b/programs/winemine/Makefile.in index f72e1b18931..ea9b9d36ab6 100644 --- a/programs/winemine/Makefile.in +++ b/programs/winemine/Makefile.in @@ -12,3 +12,5 @@ RC_SRCS = winemine.rc MANPAGES = winemine.man.in SVG_SRCS = winemine.svg + +INSTALL_LIB = winemine.exe winemine diff --git a/programs/winepath/Makefile.in b/programs/winepath/Makefile.in index 16b5627aa51..ca28e303d1f 100644 --- a/programs/winepath/Makefile.in +++ b/programs/winepath/Makefile.in @@ -4,3 +4,5 @@ APPMODE = -mconsole -municode C_SRCS = winepath.c MANPAGES = winepath.man.in + +INSTALL_LIB = winepath.exe winepath diff --git a/programs/winetest/Makefile.in b/programs/winetest/Makefile.in index 7bdfe2a32bb..4070016a3de 100644 --- a/programs/winetest/Makefile.in +++ b/programs/winetest/Makefile.in @@ -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) diff --git a/tools/make_makefiles b/tools/make_makefiles index 4b539cdbefb..96d8c011eaa 100755 --- a/tools/make_makefiles +++ b/tools/make_makefiles @@ -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"}; diff --git a/tools/makedep.c b/tools/makedep.c index 7af3bc90aca..2a1b8d44e5b 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -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;