diff --git a/programs/notepad/Makefile.in b/programs/notepad/Makefile.in index 26e977d8e74..06c5ff04c1e 100644 --- a/programs/notepad/Makefile.in +++ b/programs/notepad/Makefile.in @@ -1,7 +1,8 @@ MODULE = notepad.exe -APPMODE = -mwindows -mno-cygwin IMPORTS = comdlg32 shell32 shlwapi user32 gdi32 advapi32 +EXTRADLLFLAGS = -mwindows -mno-cygwin + C_SRCS = \ dialog.c \ main.c diff --git a/programs/reg/Makefile.in b/programs/reg/Makefile.in index 7c6a899362e..248b470eb31 100644 --- a/programs/reg/Makefile.in +++ b/programs/reg/Makefile.in @@ -1,8 +1,9 @@ MODULE = reg.exe -APPMODE = -mconsole -municode -mno-cygwin IMPORTS = advapi32 DELAYIMPORTS = user32 +EXTRADLLFLAGS = -mconsole -municode -mno-cygwin + C_SRCS = \ export.c \ import.c \ diff --git a/programs/regedit/Makefile.in b/programs/regedit/Makefile.in index 18602efc252..5b9df84b1d0 100644 --- a/programs/regedit/Makefile.in +++ b/programs/regedit/Makefile.in @@ -1,8 +1,9 @@ MODULE = regedit.exe -APPMODE = -mwindows -municode -mno-cygwin IMPORTS = advapi32 DELAYIMPORTS = shlwapi shell32 comdlg32 comctl32 user32 gdi32 +EXTRADLLFLAGS = -mwindows -municode -mno-cygwin + C_SRCS = \ about.c \ childwnd.c \ diff --git a/programs/taskmgr/Makefile.in b/programs/taskmgr/Makefile.in index 6006ac3e0ca..c385e9b5ab6 100644 --- a/programs/taskmgr/Makefile.in +++ b/programs/taskmgr/Makefile.in @@ -1,7 +1,8 @@ MODULE = taskmgr.exe -APPMODE = -mwindows -mno-cygwin IMPORTS = shell32 shlwapi comctl32 user32 gdi32 advapi32 +EXTRADLLFLAGS = -mwindows -mno-cygwin + C_SRCS = \ about.c \ affinity.c \ diff --git a/programs/wordpad/Makefile.in b/programs/wordpad/Makefile.in index 5778692c8e4..ea12d9190a2 100644 --- a/programs/wordpad/Makefile.in +++ b/programs/wordpad/Makefile.in @@ -1,7 +1,8 @@ MODULE = wordpad.exe -APPMODE = -mwindows -mno-cygwin IMPORTS = comdlg32 uuid ole32 shell32 user32 gdi32 advapi32 comctl32 +EXTRADLLFLAGS = -mwindows -mno-cygwin + C_SRCS = \ olecallback.c \ print.c \ diff --git a/programs/xcopy/Makefile.in b/programs/xcopy/Makefile.in index 05931c525d6..5059e71adae 100644 --- a/programs/xcopy/Makefile.in +++ b/programs/xcopy/Makefile.in @@ -1,7 +1,8 @@ MODULE = xcopy.exe -APPMODE = -mconsole -municode -mno-cygwin IMPORTS = shell32 user32 +EXTRADLLFLAGS = -mconsole -municode -mno-cygwin + C_SRCS = \ xcopy.c diff --git a/tools/make_makefiles b/tools/make_makefiles index 111bc8ffcde..7c376aca924 100755 --- a/tools/make_makefiles +++ b/tools/make_makefiles @@ -229,7 +229,7 @@ sub parse_makefile($) { die "Configure substitution is not allowed in $file" unless $file eq "Makefile"; } - if (/^\s*(MODULE|IMPORTLIB|TESTDLL|PARENTSRC|APPMODE)\s*=\s*(.*)/) + if (/^\s*(MODULE|IMPORTLIB|TESTDLL|PARENTSRC|APPMODE|EXTRADLLFLAGS)\s*=\s*(.*)/) { my $var = $1; $make{$var} = $2; @@ -438,18 +438,21 @@ sub update_makefiles(@) elsif (defined($make{"MODULE"})) # dll or program { (my $name = $file) =~ s/^(dlls|programs)\/(.*)\/Makefile/$2/; + my $dllflags = $make{"EXTRADLLFLAGS"} || ""; + if (defined $make{"APPMODE"}) { $dllflags .= " " . $make{"APPMODE"}; } die "MODULE should not be defined in $file" unless $file =~ /^(dlls|programs)\//; die "STATICLIB should not be defined in $file" if defined $make{"STATICLIB"}; die "Invalid MODULE in $file" if $name =~ /\./ && $make{"MODULE"} ne $name; if ($file =~ /^programs\//) { - die "APPMODE should be defined in $file" unless defined $make{"APPMODE"} ; - die "APPMODE should contain -mconsole or -mwindows in $file" unless $make{"APPMODE"} =~ /-m(console|windows)/; + die "EXTRADLLFLAGS should be defined in $file" unless $dllflags; + die "EXTRADLLFLAGS should contain -mconsole or -mwindows in $file" unless $dllflags =~ /-m(console|windows)/; die "Invalid MODULE in $file" unless $name =~ /\./ || $make{"MODULE"} eq "$name.exe"; } else { die "APPMODE should not be defined in $file" if defined $make{"APPMODE"} ; + die "EXTRADLLFLAGS should not contain -mconsole or -mwindows in $file" if $dllflags =~ /-m(console|windows)/; die "Invalid MODULE in $file" unless $name =~ /\./ || $make{"MODULE"} eq "$name.dll"; } if (defined $make{"IMPORTLIB"}) @@ -462,6 +465,7 @@ sub update_makefiles(@) elsif ($file =~ /^tools.*\/Makefile$/) { die "APPMODE should not be defined in $file" if defined $make{"APPMODE"}; + die "EXTRADLLFLAGS should not be defined in $file" if defined $make{"EXTRADLLFLAGS"}; die "STATICLIB should not be defined in $file" if defined $make{"STATICLIB"}; $args = ",,[test \"x\$enable_tools\" = xno]"; }