forked from Mirrors/wine-wine
widl: Add a general -o option instead of having a different output name option for each file type.
parent
5d3b4fb6cb
commit
233814c21e
|
@ -65,22 +65,22 @@ filter: dummy
|
||||||
$(LDPATH) $(WRC) $(RCFLAGS) -o $@ $<
|
$(LDPATH) $(WRC) $(RCFLAGS) -o $@ $<
|
||||||
|
|
||||||
.idl.h:
|
.idl.h:
|
||||||
$(WIDL) $(IDLFLAGS) -h -H $@ $<
|
$(WIDL) $(IDLFLAGS) -h -o $@ $<
|
||||||
|
|
||||||
.idl_c.c:
|
.idl_c.c:
|
||||||
$(WIDL) $(IDLFLAGS) -c -C $@ $<
|
$(WIDL) $(IDLFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
.idl_i.c:
|
.idl_i.c:
|
||||||
$(WIDL) $(IDLFLAGS) -u -U $@ $<
|
$(WIDL) $(IDLFLAGS) -u -o $@ $<
|
||||||
|
|
||||||
.idl_p.c:
|
.idl_p.c:
|
||||||
$(WIDL) $(IDLFLAGS) -p -P $@ $<
|
$(WIDL) $(IDLFLAGS) -p -o $@ $<
|
||||||
|
|
||||||
.idl_s.c:
|
.idl_s.c:
|
||||||
$(WIDL) $(IDLFLAGS) -s -S $@ $<
|
$(WIDL) $(IDLFLAGS) -s -o $@ $<
|
||||||
|
|
||||||
.idl.tlb:
|
.idl.tlb:
|
||||||
$(WIDL) $(TARGETFLAGS) $(IDLFLAGS) -t -T $@ $<
|
$(WIDL) $(TARGETFLAGS) $(IDLFLAGS) -t -o $@ $<
|
||||||
|
|
||||||
.c.ln:
|
.c.ln:
|
||||||
$(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
|
$(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
|
||||||
|
@ -103,7 +103,7 @@ filter: dummy
|
||||||
# Rules for IDL files
|
# Rules for IDL files
|
||||||
|
|
||||||
dlldata.c: $(WIDL) Makefile.in
|
dlldata.c: $(WIDL) Makefile.in
|
||||||
$(WIDL) $(IDLFLAGS) --dlldata-only --dlldata=$@ $(IDL_P_SRCS)
|
$(WIDL) $(IDLFLAGS) --dlldata-only -o $@ $(IDL_P_SRCS)
|
||||||
|
|
||||||
# Rule for linting
|
# Rule for linting
|
||||||
|
|
||||||
|
|
|
@ -54,10 +54,8 @@ static const char usage[] =
|
||||||
" or: widl [options...] --dlldata-only name1 [name2...]\n"
|
" or: widl [options...] --dlldata-only name1 [name2...]\n"
|
||||||
" -b arch Set the target architecture\n"
|
" -b arch Set the target architecture\n"
|
||||||
" -c Generate client stub\n"
|
" -c Generate client stub\n"
|
||||||
" -C file Name of client stub file (default is infile_c.c)\n"
|
|
||||||
" -d n Set debug level to 'n'\n"
|
" -d n Set debug level to 'n'\n"
|
||||||
" -D id[=val] Define preprocessor identifier id=val\n"
|
" -D id[=val] Define preprocessor identifier id=val\n"
|
||||||
" --dlldata=file Name of the dlldata file (default is dlldata.c)\n"
|
|
||||||
" -E Preprocess only\n"
|
" -E Preprocess only\n"
|
||||||
" -h Generate headers\n"
|
" -h Generate headers\n"
|
||||||
" -H file Name of header file (default is infile.h)\n"
|
" -H file Name of header file (default is infile.h)\n"
|
||||||
|
@ -66,17 +64,14 @@ static const char usage[] =
|
||||||
" -m32, -m64 Set the kind of typelib to build (Win32 or Win64)\n"
|
" -m32, -m64 Set the kind of typelib to build (Win32 or Win64)\n"
|
||||||
" -N Do not preprocess input\n"
|
" -N Do not preprocess input\n"
|
||||||
" --oldnames Use old naming conventions\n"
|
" --oldnames Use old naming conventions\n"
|
||||||
|
" -o, --output=NAME Set the output file name\n"
|
||||||
" -p Generate proxy\n"
|
" -p Generate proxy\n"
|
||||||
" -P file Name of proxy file (default is infile_p.c)\n"
|
|
||||||
" --prefix-all=p Prefix names of client stubs / server functions with 'p'\n"
|
" --prefix-all=p Prefix names of client stubs / server functions with 'p'\n"
|
||||||
" --prefix-client=p Prefix names of client stubs with 'p'\n"
|
" --prefix-client=p Prefix names of client stubs with 'p'\n"
|
||||||
" --prefix-server=p Prefix names of server functions with 'p'\n"
|
" --prefix-server=p Prefix names of server functions with 'p'\n"
|
||||||
" -s Generate server stub\n"
|
" -s Generate server stub\n"
|
||||||
" -S file Name of server stub file (default is infile_s.c)\n"
|
|
||||||
" -t Generate typelib\n"
|
" -t Generate typelib\n"
|
||||||
" -T file Name of typelib file (default is infile.tlb)\n"
|
|
||||||
" -u Generate interface identifiers file\n"
|
" -u Generate interface identifiers file\n"
|
||||||
" -U file Name of interface identifiers file (default is infile_i.c)\n"
|
|
||||||
" -V Print version and exit\n"
|
" -V Print version and exit\n"
|
||||||
" -W Enable pedantic warnings\n"
|
" -W Enable pedantic warnings\n"
|
||||||
" --win32 Only generate 32-bit code\n"
|
" --win32 Only generate 32-bit code\n"
|
||||||
|
@ -157,12 +152,13 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char short_options[] =
|
static const char short_options[] =
|
||||||
"b:cC:d:D:EhH:I:m:NpP:sS:tT:uU:VW";
|
"b:cC:d:D:EhH:I:m:No:pP:sS:tT:uU:VW";
|
||||||
static const struct option long_options[] = {
|
static const struct option long_options[] = {
|
||||||
{ "dlldata", 1, NULL, DLLDATA_OPTION },
|
{ "dlldata", 1, NULL, DLLDATA_OPTION },
|
||||||
{ "dlldata-only", 0, NULL, DLLDATA_ONLY_OPTION },
|
{ "dlldata-only", 0, NULL, DLLDATA_ONLY_OPTION },
|
||||||
{ "local-stubs", 1, NULL, LOCAL_STUBS_OPTION },
|
{ "local-stubs", 1, NULL, LOCAL_STUBS_OPTION },
|
||||||
{ "oldnames", 0, NULL, OLDNAMES_OPTION },
|
{ "oldnames", 0, NULL, OLDNAMES_OPTION },
|
||||||
|
{ "output", 0, NULL, 'o' },
|
||||||
{ "prefix-all", 1, NULL, PREFIX_ALL_OPTION },
|
{ "prefix-all", 1, NULL, PREFIX_ALL_OPTION },
|
||||||
{ "prefix-client", 1, NULL, PREFIX_CLIENT_OPTION },
|
{ "prefix-client", 1, NULL, PREFIX_CLIENT_OPTION },
|
||||||
{ "prefix-server", 1, NULL, PREFIX_SERVER_OPTION },
|
{ "prefix-server", 1, NULL, PREFIX_SERVER_OPTION },
|
||||||
|
@ -486,6 +482,7 @@ int main(int argc,char *argv[])
|
||||||
int optc;
|
int optc;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int opti = 0;
|
int opti = 0;
|
||||||
|
char *output_name = NULL;
|
||||||
|
|
||||||
signal( SIGTERM, exit_on_signal );
|
signal( SIGTERM, exit_on_signal );
|
||||||
signal( SIGINT, exit_on_signal );
|
signal( SIGINT, exit_on_signal );
|
||||||
|
@ -577,6 +574,9 @@ int main(int argc,char *argv[])
|
||||||
case 'N':
|
case 'N':
|
||||||
no_preprocess = 1;
|
no_preprocess = 1;
|
||||||
break;
|
break;
|
||||||
|
case 'o':
|
||||||
|
output_name = xstrdup(optarg);
|
||||||
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
do_everything = 0;
|
do_everything = 0;
|
||||||
do_proxies = 1;
|
do_proxies = 1;
|
||||||
|
@ -621,6 +621,20 @@ int main(int argc,char *argv[])
|
||||||
set_everything(TRUE);
|
set_everything(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!output_name) output_name = dup_basename(input_name, ".idl");
|
||||||
|
|
||||||
|
if (!do_everything &&
|
||||||
|
do_header + do_typelib + do_proxies + do_client + do_server + do_idfile + do_dlldata == 1)
|
||||||
|
{
|
||||||
|
if (do_header) header_name = output_name;
|
||||||
|
else if (do_typelib) typelib_name = output_name;
|
||||||
|
else if (do_proxies) proxy_name = output_name;
|
||||||
|
else if (do_client) client_name = output_name;
|
||||||
|
else if (do_server) server_name = output_name;
|
||||||
|
else if (do_idfile) idfile_name = output_name;
|
||||||
|
else if (do_dlldata) dlldata_name = output_name;
|
||||||
|
}
|
||||||
|
|
||||||
if (!dlldata_name && do_dlldata)
|
if (!dlldata_name && do_dlldata)
|
||||||
dlldata_name = xstrdup("dlldata.c");
|
dlldata_name = xstrdup("dlldata.c");
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,10 @@ will print a help message.
|
||||||
.B General options:
|
.B General options:
|
||||||
.IP "\fB-V\fR"
|
.IP "\fB-V\fR"
|
||||||
Print version number and exit.
|
Print version number and exit.
|
||||||
|
.IP "\fB-o, --output=\fIname"
|
||||||
|
Set the name of the output file. When generating multiple output
|
||||||
|
files, this sets only the base name of the file; the respective output
|
||||||
|
files are then named \fIname\fR.h, \fIname\fR_p.c, etc.
|
||||||
.IP "\fB-b \fIcpu-manufacturer[-kernel]-os\fR"
|
.IP "\fB-b \fIcpu-manufacturer[-kernel]-os\fR"
|
||||||
Set the target architecture when cross-compiling. The target
|
Set the target architecture when cross-compiling. The target
|
||||||
specification is in the standard autoconf format as returned by
|
specification is in the standard autoconf format as returned by
|
||||||
|
@ -38,38 +42,25 @@ config.sub.
|
||||||
.PP
|
.PP
|
||||||
.B Header options:
|
.B Header options:
|
||||||
.IP "\fB-h\fR"
|
.IP "\fB-h\fR"
|
||||||
Generate header files.
|
Generate header files. The default output filename is \fIinfile\fB.h\fR.
|
||||||
.IP "\fB-H \fIfile\fR"
|
|
||||||
Name of header file to generate. The default header
|
|
||||||
filename is \fIinfile\fR.h.
|
|
||||||
.IP "\fB--oldnames\fR"
|
.IP "\fB--oldnames\fR"
|
||||||
Use old naming conventions.
|
Use old naming conventions.
|
||||||
.PP
|
.PP
|
||||||
.B Type library options:
|
.B Type library options:
|
||||||
.IP \fB-t\fR
|
.IP \fB-t\fR
|
||||||
Generate a type library.
|
Generate a type library. The default output filename is \fIinfile\fB.tlb\fR.
|
||||||
.IP "\fB-T \fIfile\fR"
|
|
||||||
Define the name of the type library to be generated.
|
|
||||||
The default filename is \fIinfile\fR.tlb.
|
|
||||||
.IP "\fB-m32, -m64\fR"
|
.IP "\fB-m32, -m64\fR"
|
||||||
Generate a Win32, respectively Win64, type library.
|
Generate a Win32, respectively Win64, type library.
|
||||||
.PP
|
.PP
|
||||||
.B UUID file options:
|
.B UUID file options:
|
||||||
.IP "\fB-u\fR"
|
.IP "\fB-u\fR"
|
||||||
Generate a UUID file.
|
Generate a UUID file. The default output filename is \fIinfile\fB_i.c\fR.
|
||||||
.IP "\fB-U \fIfile\fR"
|
|
||||||
Define the name of the UUID file to be generated.
|
|
||||||
The default filename is \fIinfile\fR_i.c.
|
|
||||||
.PP
|
.PP
|
||||||
.B Proxy/stub generation options:
|
.B Proxy/stub generation options:
|
||||||
.IP "\fB-c\fR"
|
.IP "\fB-c\fR"
|
||||||
Generate client stub.
|
Generate a client stub file. The default output filename is \fIinfile\fB_c.c\fR.
|
||||||
.IP "\fB-C \fIfile\fR"
|
|
||||||
Name of client stub file (default is \fIinfile\fR_c.c)
|
|
||||||
.IP "\fB-p\fR"
|
.IP "\fB-p\fR"
|
||||||
Generate proxy.
|
Generate a proxy. The default output filename is \fIinfile\fB_p.c\fR.
|
||||||
.IP "\fB-P \fIfile\fR"
|
|
||||||
Name of proxy file (default is \fIinfile\fR_p.c)
|
|
||||||
.IP "\fB--prefix-all=\fIprefix\fR"
|
.IP "\fB--prefix-all=\fIprefix\fR"
|
||||||
Prefix to put on the name of both client and server stubs.
|
Prefix to put on the name of both client and server stubs.
|
||||||
.IP "\fB--prefix-client=\fIprefix\fR"
|
.IP "\fB--prefix-client=\fIprefix\fR"
|
||||||
|
@ -77,17 +68,17 @@ Prefix to put on the name of client stubs.
|
||||||
.IP "\fB--prefix-server=\fIprefix\fR"
|
.IP "\fB--prefix-server=\fIprefix\fR"
|
||||||
Prefix to put on the name of server stubs.
|
Prefix to put on the name of server stubs.
|
||||||
.IP "\fB-s\fR"
|
.IP "\fB-s\fR"
|
||||||
Generate server stub.
|
Generate a server stub file. The default output filename is
|
||||||
.IP "\fB-S \fIfile\fR"
|
\fIinfile\fB_s.c\fR.
|
||||||
Name of server stub file (default is \fIinfile\fR_s.c)
|
|
||||||
.IP "\fB--win32, --win64\fR"
|
.IP "\fB--win32, --win64\fR"
|
||||||
Only generate 32-bit, respectively 64-bit code (the default is to
|
Only generate 32-bit, respectively 64-bit code (the default is to
|
||||||
generate both 32-bit and 64-bit versions into the same destination
|
generate both 32-bit and 64-bit versions into the same destination
|
||||||
file).
|
file).
|
||||||
.PP
|
.PP
|
||||||
.B Dlldata file options:
|
.B Dlldata file options:
|
||||||
.IP "\fB--dlldata=\fIfile\fR"
|
.IP "\fB--dlldata-only\fI name1 [name2...]"
|
||||||
Name of the dlldata file (default is dlldata.c)
|
Regenerate the dlldata file from scratch using the specified proxy
|
||||||
|
names. The default output filename is \fBdlldata.c\fR.
|
||||||
.PP
|
.PP
|
||||||
.B Preprocessor options:
|
.B Preprocessor options:
|
||||||
.IP "\fB-I \fIpath\fR"
|
.IP "\fB-I \fIpath\fR"
|
||||||
|
|
Loading…
Reference in New Issue