*.tmp
Makefile.ros
cabinet.spec.def
+cabinet.stubs.c
idi_tt_warn_sm.ico
idt_check.bmp
comctl32.spec.def
+comctl32.stubs.c
*.bmp
*.ico
comdlg32.spec.def
+comdlg32.stubs.c
\ No newline at end of file
*.tmp
Makefile.ros
iphlpapi.spec.def
+iphlpapi.stubs.c
*.tmp
Makefile.ros
mpr.spec.def
+mpr.stubs.c
temp.exp
msacm32.spec.def
Makefile.ros
+msacm32.stubs.c
*.tmp
Makefile.ros
msvfw32.spec.def
+msvfw32.stubs.c
*.tmp
Makefile.ros
netapi32.spec.def
+netapi32.stubs.c
drag_move.cur
nodrop.cur
ole32.spec.def
+ole32.stubs.c
*.tmp
Makefile.ros
oleaut32.spec.def
+oleaut32.stubs.c
*.tmp
Makefile.ros
oledlg.spec.def
+oledlg.stubs.c
*.map
*.tmp
Makefile.ros
-riched32.spec.def
\ No newline at end of file
+riched32.spec.def
+riched32.stubs.c
*.tmp
Makefile.ros
rpcrt4.spec.def
+rpcrt4.stubs.c
*.tmp
Makefile.ros
setupapi.spec.def
+setupapi.stubs.c
*.ico
shell32.spec.def
authors.c
+shell32.stubs.c
*.tmp
Makefile.ros
shlwapi.spec.def
+shlwapi.stubs.c
-# $Id: Makefile.ros-template,v 1.2 2004/05/29 21:24:47 hbirr Exp $
+# $Id: Makefile.ros-template,v 1.3 2004/11/02 19:47:18 gvg Exp $
TARGET_NAME = libwine_unicode
TARGET_DEFNAME = wine_unicode
+TARGET_STUBS = no
+
default: all
DEP_OBJECTS = $(TARGET_OBJECTS)
*.d
*.sym
*.map
-*.spec.def
\ No newline at end of file
+*.spec.def
+winmm.stubs.c
-# $Id: helper.mk,v 1.93 2004/10/28 19:01:59 chorns Exp $
+# $Id: helper.mk,v 1.94 2004/11/02 19:47:18 gvg Exp $
#
# Helper makefile for ReactOS modules
# Variables this makefile accepts:
MK_SPECDEF := $(MK_DEFBASENAME).def
else
MK_DEFBASENAME := $(TARGET_DEFNAME)
+endif
+ifneq ($(TARGET_STUBS),no)
+ MK_STUBS_SRC := $(TARGET_NAME).stubs.c
+ MK_STUBS_OBJ := $(TARGET_NAME).stubs.o
endif
MK_RC_BINARIES = $(TARGET_RC_BINARIES)
endif
endif
# We don't want to link header files
-MK_OBJECTS := $(filter-out %.h,$(TARGET_OBJECTS))
+MK_OBJECTS := $(filter-out %.h,$(TARGET_OBJECTS)) $(MK_STUBS_OBJ)
# There is problems with C++ applications and ld -r. Ld can cause errors like:
# reloc refers to symbol `.text$_ZN9CCABCodecC2Ev' which is not being output
$(MK_BASENAME).a: $(MK_OBJECTS)
$(AR) -rc $(MK_BASENAME).a $(MK_OBJECTS)
-$(MK_NOSTRIPNAME): $(MK_EXTRADEP) $(MK_FULLRES) $(MK_BASENAME).a $(MK_LIBS)
+$(MK_NOSTRIPNAME): $(MK_EXTRADEP) $(MK_FULLRES) $(MK_BASENAME).a $(MK_LIBS) $(MK_STUBS_SRC) $(MK_STUBS_OBJ)
ifeq ($(MK_EXETYPE),dll)
$(LD_CC) -Wl,--base-file,base.tmp \
-Wl,--entry,$(TARGET_ENTRY) \
clean: $(MK_REGTESTS_CLEAN) $(SUBDIRS:%=%_clean)
- $(RM) *.o $(MK_PCHNAME) $(MK_BASENAME).sym $(MK_BASENAME).a $(MK_RESOURCE) \
$(MK_FULLNAME) $(MK_NOSTRIPNAME) $(MK_CLEANFILES) $(MK_CLEANDEPS) $(MK_BASENAME).map \
- junk.tmp base.tmp temp.exp $(MK_RC_BINARIES) $(MK_SPECDEF) $(MK_GENERATED_MAKEFILE) \
- $(TARGET_CLEAN)
+ junk.tmp base.tmp temp.exp $(MK_RC_BINARIES) $(MK_SPECDEF) $(MK_STUBS_SRC) \
+ $(MK_GENERATED_MAKEFILE) $(TARGET_CLEAN)
ifneq ($(TARGET_HEADERS),)
$(TARGET_OBJECTS): $(TARGET_HEADERS)
$(WINEBUILD) $(DEFS) -o $@ --def $<
%.drv.spec.def: %.spec
$(WINEBUILD) $(DEFS) -o $@ --def $<
+%.stubs.c: %.spec
+ $(WINEBUILD) $(DEFS) -o $@ --pedll $<
%.i: %.c
$(CC) $(TARGET_CFLAGS) -E $< > $@
%.h.gch: %.h
extern void BuildSpec32File( FILE *outfile, DLLSPEC *spec );
extern void BuildDef32File( FILE *outfile, DLLSPEC *spec );
extern void BuildDebugFile( FILE *outfile, const char *srcdir, char **argv );
+extern void BuildPedllFile( FILE *outfile, DLLSPEC *spec );
extern int parse_spec_file( FILE *file, DLLSPEC *spec );
extern int parse_def_file( FILE *file, DLLSPEC *spec );
MODE_DEF,
MODE_DEBUG,
MODE_RELAY16,
- MODE_RELAY32
+ MODE_RELAY32,
+ MODE_PEDLL
};
static enum exec_mode_values exec_mode = MODE_NONE;
" --exe=NAME Build a .c file for the named executable\n"
" --debug [FILES] Build a .c file with the debug channels declarations\n"
" --relay16 Build the 16-bit relay assembly routines\n"
-" --relay32 Build the 32-bit relay assembly routines\n\n"
+" --relay32 Build the 32-bit relay assembly routines\n"
+" --pedll Build a .c file for PE dll\n\n"
"The mode options are mutually exclusive; you must specify one and only one.\n\n";
enum long_options_values
LONG_OPT_RELAY16,
LONG_OPT_RELAY32,
LONG_OPT_SUBSYSTEM,
- LONG_OPT_VERSION
+ LONG_OPT_VERSION,
+ LONG_OPT_PEDLL
};
static const char short_options[] = "C:D:F:H:I:K:L:M:N:d:e:f:hi:kl:m:o:r:w";
{ "relay32", 0, 0, LONG_OPT_RELAY32 },
{ "subsystem",1, 0, LONG_OPT_SUBSYSTEM },
{ "version", 0, 0, LONG_OPT_VERSION },
+ { "pedll", 1, 0, LONG_OPT_PEDLL },
/* aliases for short options */
{ "source-dir", 1, 0, 'C' },
{ "delay-lib", 1, 0, 'd' },
case LONG_OPT_VERSION:
printf( "winebuild version " PACKAGE_VERSION "\n" );
exit(0);
+ case LONG_OPT_PEDLL:
+ set_exec_mode( MODE_PEDLL );
+ spec_file_name = xstrdup( optarg );
+ set_dll_file_name( optarg, spec );
+ break;
case '?':
usage(1);
break;
case MODE_RELAY32:
fatal_error( "Win32 relays are not supported in ReactOS version of winebuild\n" );
break;
+ case MODE_PEDLL:
+ if (argv[0]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[0] );
+ if (!parse_input_file( spec )) break;
+ BuildPedllFile( output_file, spec );
+ break;
default:
usage(1);
break;
int is_data = 0;
if (!odp) continue;
- if (odp->flags & FLAG_REGISTER) continue;
- if (odp->type == TYPE_STUB) continue;
-
if (odp->name) name = odp->name;
+ else if (odp->type == TYPE_STUB) name = make_internal_name( odp, spec, "stub" );
else if (odp->export_name) name = odp->export_name;
- else continue;
+ else name = make_internal_name( odp, spec, "noname_export" );
fprintf(outfile, " %s", name);
}
break;
}
+ case TYPE_STUB:
+ {
+ if (NULL != odp->name)
+ {
+ fprintf(outfile, "=%s", make_internal_name( odp, spec, "stub" ));
+ }
+ break;
+ }
default:
assert(0);
}
fprintf( outfile, " @%d", odp->ordinal );
+#if 0 /* MinGW binutils cannot handle this correctly */
if (!odp->name) fprintf( outfile, " NONAME" );
+#else
+ if (!odp->name && (odp->type == TYPE_STUB || odp->export_name)) fprintf( outfile, " NONAME" );
+#endif
if (is_data) fprintf( outfile, " DATA" );
#if 0
/* MinGW binutils cannot handle this correctly */
free( prefix );
}
+
+
+/*******************************************************************
+ * BuildPedllFile
+ *
+ * Build a PE DLL C file from a spec file.
+ */
+void BuildPedllFile( FILE *outfile, DLLSPEC *spec )
+{
+ int nr_exports;
+
+ nr_exports = spec->base <= spec->limit ? spec->limit - spec->base + 1 : 0;
+ output_standard_file_header( outfile );
+
+ if (nr_exports)
+ {
+ /* Output the stub functions */
+
+ output_stub_funcs( outfile, spec );
+ }
+}