winemaker.man.in 7.97 KB
Newer Older
1
.\" -*- nroff -*-
2
.TH WINEMAKER 1 "October 2005" "@PACKAGE_STRING@" "Wine Developers Manual"
3 4 5 6 7
.SH NAME
winemaker \- generate a build infrastructure for compiling Windows programs on Unix
.SH SYNOPSIS
.B "winemaker "
[
8
.IR               "--nobanner " "] [ " "--backup " "| " "--nobackup " "] [ "--nosource-fix "
9 10 11 12 13
]
.br
  [
.IR               "--lower-none " "| " "--lower-all " "| " "--lower-uppercase "
]
14 15
.br
  [
16
.IR               "--lower-include " "| " "--nolower-include " ] [ " "--mfc " "| " "--nomfc "
17
]
18 19
.br
  [
20
.IR               "--guiexe " "| " "--windows " "| " "--cuiexe " "| " "--console " "| " "--dll " "| " "--nodlls "
21 22 23
]
.br
  [
24
.IR               "-Dmacro[=defn] " "] [ " "-Idir " "] [ " "-Ldir " "] [ " "-idll" "] [ " "-llibrary "
25 26 27 28 29
]
.br
  [
.IR               "--interactive " "] [ " "--single-target name "
]
30 31
.br
  [
32
.IR               "--generated-files " "] [ " "--nogenerated-files " "] 
33
]
34 35 36 37

.SH DESCRIPTION
.PP
.B winemaker
38
is a perl script designed to help you bootstrap the
Francois Gouget's avatar
Francois Gouget committed
39
process of converting your Windows sources to Winelib programs.
40 41 42
.PP
In order to do this winemaker can perform the following operations:
.PP
43
- rename your source files and directories to lowercase in the event they
44 45 46 47
got all uppercased during the transfer.
.PP
- perform Dos to Unix (CRLF to LF) conversions.
.PP
48
- scan the include statements and resource file references to replace the
49 50
backslashes with forward slashes.
.PP
51 52
- during the above step winemaker will also perform a case insensitive search
of the referenced file in the include path and rewrite the include statement
53 54
with the right case if necessary.
.PP
55 56
- winemaker will also check other more exotic issues like '#pragma pack'
usage, use of "afxres.h" in non MFC projects, and more. Whenever it
57 58
encounters something out of the ordinary, winemaker will warn you about it.
.PP
59 60
- winemaker can also scan a complete directory tree at once, guess what are
the executables and libraries you are trying to build, match them with
61 62
source files, and generate the corresponding Makefile.in files.
.PP
63
- finally winemaker will generate a global Makefile.in file calling out to all
Francois Gouget's avatar
Francois Gouget committed
64
the others, and a configure script customized for use with Winelib.
65 66 67 68 69 70 71 72 73
.PP
- winemaker knows about MFC-based project and will generate customized files.
.PP
.SH OPTIONS
.TP
.I --nobanner
Disables the printing of the banner.
.TP
.I --backup
74
Directs winemaker to perform a backup of all the source files in which it
75 76 77 78 79
makes changes. This is the default.
.TP
.I --nobackup
Tells winemaker not to backup modified source files.
.TP
80 81 82 83
.I --nosource-fix
Directs winemaker not to try fixing the source files (e.g. Dos to Unix
conversion). This prevents complaints if the files are readonly.
.TP
84 85 86 87
.I --lower-all
Tells winemaker to rename all files and directories to lowercase.
.TP
.I --lower-uppercase
88 89
Tells winemaker to only rename files and directories that have an all
uppercase name.
90 91 92
So "HELLO.C" would be renamed but not "World.c".
.TP
.I --lower-none
93 94
Tells winemaker not to rename files and directories to lower case. Note
that this does not prevent the renaming of a file if its extension cannot
95 96
be handled as is, e.g. ".Cxx". This is the default.
.TP
97
.I "--lower-include "
98 99
Tells winemaker that if it does not find the file corresponding to an
include statement (or other form of file reference for resource files),
100 101
then it should convert that filename to lowercase. This is the default.
.TP
102
.I "--nolower-include "
103
Tells winemaker not to modify the include statement if it cannot find the
104 105
referenced file.
.TP
106
.IR "--guiexe " "| " "--windows"
107
Specifies that whenever winemaker finds an executable target, or a target of
108 109 110 111
unknown type, it should assume that it is a graphical application.
This is the default.
.TP
.IR "--cuiexe " "| " "--console"
112
Specifies that whenever winemaker finds an executable target, or a target of
113 114 115
unknown type, it should assume that it is a console application.
.TP
.I --dll
116 117
This option tells winemaker that whenever it finds a target of unknown type,
i.e. for which it does not know whether it is an executable or a library,
118 119
it should assume it is a library.
.TP
120 121 122 123 124 125 126 127
.I --nodlls
This option tells winemaker not to use the standard set of winelib libraries
for imports. That is, any DLL your code uses must be explicitly passed to
winemaker with -i options.
The standard set of libraries is: advapi32.dll, comdlg32.dll, gdi32.dll,
kernel32.dll, odbc32.dll, ole32.dll, oleaut32.dll, shell32.dll, user32.dll,
winspool.drv.
.TP
128
.I --mfc
129 130
Specifies that the targets are MFC based. In such a case winemaker the include 
and library paths accordingly, and links the target with the MFC library.
131 132
.TP
.I --nomfc
133 134 135
Specifies that targets are not MFC-based. This option disables use of MFC libraries
even if winemaker encounters files "stdafx.cpp" or "stdafx.h" that would cause it
to enable MFC automatically if neither --nomfc nor --mfc was specified.
136 137
.TP
.I -Dmacro[=defn]
138
Adds the specified macro definition to the global list of macro definitions.
139 140 141 142 143 144 145
.TP
.I -Idir
Appends the specified directory to the global include path.
.TP
.I -Ldir
Appends the specified directory to the global library path.
.TP
146
.I -idll
147
Adds the Winelib library to the global list of Winelib libraries to import.
148
.TP
149 150 151 152
.I -llibrary
Adds the specified library to the global list of libraries to link with.
.TP
.I --interactive
153 154
Puts winemaker in interactive mode. In this mode winemaker will ask you to
confirm each directory's list of targets, and then to provide directory and
155 156 157 158
target specific options.
.TP
.I --single-target name
Specifies that there is only one target, and that it is called "name".
159 160
.TP
.I --generated-files
161
Tells winemaker to generate the build the Makefile. This is the default.
162
.TP
163
.I --nogenerated-files
164
Tells winemaker not to generate the Makefile.
165 166 167 168 169 170 171

.SH EXAMPLES
.PP
Here is a typical winemaker use:
.PP
$ winemaker --lower-uppercase -DSTRICT
.PP
172 173 174 175 176 177
The above tells winemaker to scan the current directory and its
subdirectories for source files. Whenever if finds a file or directory which
name is all uppercase, it should rename it to lowercase. It should then fix
all these source files for compilation with Winelib and generate Makefiles.
The '-DSTRICT' specifies that the STRICT macro must be set when compiling
these sources. Finally winemaker will create a global Makefile.in and
178 179 180 181
configure.in, and run autoconf to generate the configure script.
.PP
The next step would be:
.PP
182
$ ./configure --with-wine=/usr/local/opt/wine
183
.PP
184 185
This generates the makefiles from the Makefile.in files. The generated
makefiles will fetch the Winelib headers and libraries from the Wine
186 187 188 189 190 191
installation located in /usr/local/opt/wine.
.PP
And finally:
.PP
$ make
.PP
192 193
If at this point you get compilation errors (which is quite likely for a
reasonably sized project) then you should consult the Winelib User Guide to
Francois Gouget's avatar
Francois Gouget committed
194
find tips on how to resolve them.
195 196 197 198 199
.PP
For an MFC-based project one would have run the following commands instead:
.PP
$ winemaker --lower-uppercase --mfc
.br
200
$ ./configure --with-wine=/usr/local/opt/wine \\
201
.br
202
              --with-mfc=/usr/local/opt/mfc
203 204 205 206 207 208
.br
$ make
.PP

.SH TODO / BUGS
.PP
209 210 211
Winemaker should support the Visual Studio project files (.dsp for newer
versions and .mak for some older versions). This would allow it to be much
more accurate, especially for the macro, include and library path
212 213
settings.
.PP
214 215 216 217 218
Assuming that the windows executable/library is available, we could
use a pedump-like tool to determine what kind of executable it is (graphical
or console), which libraries it is linked with, and which functions it
exports (for libraries). We could then restore all these settings for the
corresponding Winelib target. The problem is that we should have such a tool
219 220
available under the Wine license first.
.PP
221 222
Furthermore it is not very good at finding the library containing the
executable: it must either be in the current directory or in the
223 224 225 226 227 228 229
.IR LD_LIBRARY_PATH .
.PP
Winemaker does not support message files and the message compiler yet.
.PP

.SH SEE ALSO
.PP
Francois Gouget's avatar
Francois Gouget committed
230
The Winelib User Guide:
231 232 233 234 235 236 237 238
.PP
http://wine.codeweavers.com/docs/winelib-user/
.PP
.BR wine (1)
.PP

.SH AUTHOR
Francois Gouget <fgouget@codeweavers.com> for CodeWeavers