Moved all references to file descriptors out of the generic object
[wine] / tools / winemaker.man
1 .\" -*- nroff -*-
2 .TH WINEMAKER 1 "September 27, 2001" "Version 0.5.8" "Windows On Unix"
3 .SH NAME
4 winemaker \- generate a build infrastructure for compiling Windows programs on Unix
5 .SH SYNOPSIS
6 .B "winemaker "
7 [
8 .IR               "--nobanner " "] [ " "--backup " "| " "--nobackup " "] [ "--nosource-fix "
9 ]
10 .br
11   [
12 .IR               "--lower-none " "| " "--lower-all " "| " "--lower-uppercase "
13 ]
14 .br
15   [
16 .IR               "--lower-include " "| " "--nolower-include "
17 ]
18 .br
19   [
20 .IR               "--guiexe " "| " "--windows " "| " "--cuiexe " "| " "--console " "| " "--dll " "| " "--nodlls "
21 ]
22 .br
23   [
24 .IR               "--wrap " "| " "--nowrap " "] [ " "--mfc " "| " "--nomfc "
25 ]
26 .br
27   [
28 .IR               "-Dmacro[=defn] " "] [ " "-Idir " "] [ " "-Ldir " "] [ " "-idll" "] [ " "-llibrary "
29 ]
30 .br
31   [
32 .IR               "--interactive " "] [ " "--single-target name "
33 ]
34 .br
35   [
36 .IR               "--generated-files " "] [ " "--nogenerated-files " "] [ " "--nogenerated-specs "
37 ]
38
39 .SH DESCRIPTION
40 .PP
41 .B winemaker
42 is a perl script designed to help you bootstrap the
43 process of converting your Windows sources to Winelib programs.
44 .PP
45 In order to do this winemaker can perform the following operations:
46 .PP
47 - rename your source files and directories to lowercase in the event they
48 got all uppercased during the transfer.
49 .PP
50 - perform Dos to Unix (CRLF to LF) conversions.
51 .PP
52 - scan the include statements and resource file references to replace the
53 backslashes with forward slashes.
54 .PP
55 - during the above step winemaker will also perform a case insensitive search
56 of the referenced file in the include path and rewrite the include statement
57 with the right case if necessary.
58 .PP
59 - winemaker will also check other more exotic issues like '#pragma pack'
60 usage, use of "afxres.h" in non MFC projects, and more. Whenever it
61 encounters something out of the ordinary, winemaker will warn you about it.
62 .PP
63 - winemaker can also scan a complete directory tree at once, guess what are
64 the executables and libraries you are trying to build, match them with
65 source files, and generate the corresponding Makefile.in files.
66 .PP
67 - finally winemaker will generate a global Makefile.in file calling out to all
68 the others, and a configure script customized for use with Winelib.
69 .PP
70 - winemaker knows about MFC-based project and will generate customized files.
71 .PP
72 .SH OPTIONS
73 .TP
74 .I --nobanner
75 Disables the printing of the banner.
76 .TP
77 .I --backup
78 Directs winemaker to perform a backup of all the source files in which it
79 makes changes. This is the default.
80 .TP
81 .I --nobackup
82 Tells winemaker not to backup modified source files.
83 .TP
84 .I --nosource-fix
85 Directs winemaker not to try fixing the source files (e.g. Dos to Unix
86 conversion). This prevents complaints if the files are readonly.
87 .TP
88 .I --lower-all
89 Tells winemaker to rename all files and directories to lowercase.
90 .TP
91 .I --lower-uppercase
92 Tells winemaker to only rename files and directories that have an all
93 uppercase name.
94 So "HELLO.C" would be renamed but not "World.c".
95 .TP
96 .I --lower-none
97 Tells winemaker not to rename files and directories to lower case. Note
98 that this does not prevent the renaming of a file if its extension cannot
99 be handled as is, e.g. ".Cxx". This is the default.
100 .TP
101 .I "--lower-include "
102 Tells winemaker that if it does not find the file corresponding to an
103 include statement (or other form of file reference for resource files),
104 then it should convert that filename to lowercase. This is the default.
105 .TP
106 .I "--nolower-include "
107 Tells winemaker not to modify the include statement if it cannot find the
108 referenced file.
109 .TP
110 .IR "--guiexe " "| " "--windows"
111 Specifies that whenever winemaker finds an executable target, or a target of
112 unknown type, it should assume that it is a graphical application.
113 This is the default.
114 .TP
115 .IR "--cuiexe " "| " "--console"
116 Specifies that whenever winemaker finds an executable target, or a target of
117 unknown type, it should assume that it is a console application.
118 .TP
119 .I --dll
120 This option tells winemaker that whenever it finds a target of unknown type,
121 i.e. for which it does not know whether it is an executable or a library,
122 it should assume it is a library.
123 .TP
124 .I --nodlls
125 This option tells winemaker not to use the standard set of winelib libraries
126 for imports. That is, any DLL your code uses must be explicitly passed to
127 winemaker with -i options.
128 The standard set of libraries is: advapi32.dll, comdlg32.dll, gdi32.dll,
129 kernel32.dll, odbc32.dll, ole32.dll, oleaut32.dll, shell32.dll, user32.dll,
130 winspool.drv.
131 .TP
132 .I --wrap
133 Specifies that executable targets should be built as libraries and a small
134 executable wrapper generated for them. This technique is sometimes required
135 to solve initialization problems occuring on the application startup.
136 .TP
137 .I --nowrap
138 Specifies that no wrapper should be generated for executable targets. This is
139 the default.
140 .TP
141 .I --mfc
142 Specifies that the targets are MFC based. In such a case winemaker generates a
143 configure script with MFC specific options, modifies the include and
144 library paths accordingly, links the target with the MFC library and
145 generates wrappers for these targets that are executables.
146 .TP
147 .I --nomfc
148 Specifies that targets are not MFC-based. This option disables use of MFC libraries
149 even if winemaker encounters files "stdafx.cpp" or "stdafx.h" that would cause it
150 to enable MFC automatically if neither --nomfc nor --mfc was specified.
151 .TP
152 .I -Dmacro[=defn]
153 Adds the specified macro definition to the global list of macro definitions.
154 .TP
155 .I -Idir
156 Appends the specified directory to the global include path.
157 .TP
158 .I -Ldir
159 Appends the specified directory to the global library path.
160 .TP
161 .I -idll
162 Adds the Winelib library to the global list of Winelib libraries to import.
163 .TP
164 .I -llibrary
165 Adds the specified library to the global list of libraries to link with.
166 .TP
167 .I --interactive
168 Puts winemaker in interactive mode. In this mode winemaker will ask you to
169 confirm each directory's list of targets, and then to provide directory and
170 target specific options.
171 .TP
172 .I --single-target name
173 Specifies that there is only one target, and that it is called "name".
174 .TP
175 .I --generated-files
176 Tells winemaker to generate the build infrastructure files, i.e. the spec
177 files, the wrapper files, the Makefile.in files, the Make.rules.in file, the
178 configure.in file and the configure script. This is the default.
179 .TP
180 .I --nogenerated-files
181 Tells winemaker not to generate any of the above files.
182 .TP
183 .I --nogenerated-specs
184 Tells winemaker not to generate the spec files when generating files.  This is
185 particularly useful when using winemaker to generate a build environment and
186 you already have a spec file.
187
188 .SH EXAMPLES
189 .PP
190 Here is a typical winemaker use:
191 .PP
192 $ winemaker --lower-uppercase -DSTRICT
193 .PP
194 The above tells winemaker to scan the current directory and its
195 subdirectories for source files. Whenever if finds a file or directory which
196 name is all uppercase, it should rename it to lowercase. It should then fix
197 all these source files for compilation with Winelib and generate Makefiles.
198 The '-DSTRICT' specifies that the STRICT macro must be set when compiling
199 these sources. Finally winemaker will create a global Makefile.in and
200 configure.in, and run autoconf to generate the configure script.
201 .PP
202 The next step would be:
203 .PP
204 $ ./configure --with-wine=/usr/local/opt/wine
205 .PP
206 This generates the makefiles from the Makefile.in files. The generated
207 makefiles will fetch the Winelib headers and libraries from the Wine
208 installation located in /usr/local/opt/wine.
209 .PP
210 And finally:
211 .PP
212 $ make
213 .PP
214 If at this point you get compilation errors (which is quite likely for a
215 reasonably sized project) then you should consult the Winelib User Guide to
216 find tips on how to resolve them.
217 .PP
218 For an MFC-based project one would have run the following commands instead:
219 .PP
220 $ winemaker --lower-uppercase --mfc
221 .br
222 $ ./configure --with-wine=/usr/local/opt/wine \\
223 .br
224               --with-mfc=/usr/local/opt/mfc
225 .br
226 $ make
227 .PP
228
229 .SH TODO / BUGS
230 .PP
231 Winemaker should support the Visual Studio project files (.dsp for newer
232 versions and .mak for some older versions). This would allow it to be much
233 more accurate, especially for the macro, include and library path
234 settings.
235 .PP
236 Assuming that the windows executable/library is available, we could
237 use a pedump-like tool to determine what kind of executable it is (graphical
238 or console), which libraries it is linked with, and which functions it
239 exports (for libraries). We could then restore all these settings for the
240 corresponding Winelib target. The problem is that we should have such a tool
241 available under the Wine license first.
242 .PP
243 The wrapper code should be generic, i.e. you should be able to have just one
244 wrapper and specify which library to load using an option.
245 .PP
246 Furthermore it is not very good at finding the library containing the
247 executable: it must either be in the current directory or in the
248 .IR LD_LIBRARY_PATH .
249 .PP
250 Winemaker does not support message files and the message compiler yet.
251 .PP
252
253 .SH SEE ALSO
254 .PP
255 The Winelib User Guide:
256 .PP
257 http://wine.codeweavers.com/docs/winelib-user/
258 .PP
259 .BR wine (1)
260 .PP
261
262 .SH AUTHOR
263 Francois Gouget <fgouget@codeweavers.com> for CodeWeavers