Commit a37ef65e authored by Alexandre Julliard's avatar Alexandre Julliard

makedep: Generate rules for import libraries.

parent f6479c05
...@@ -19,8 +19,7 @@ RCFLAGS = --nostdinc $(PORCFLAGS) $(TARGETFLAGS) $(DEFS) $(EXTRARCFLAGS) ...@@ -19,8 +19,7 @@ RCFLAGS = --nostdinc $(PORCFLAGS) $(TARGETFLAGS) $(DEFS) $(EXTRARCFLAGS)
IDL_GEN_C_SRCS = $(IDL_C_SRCS:.idl=_c.c) $(IDL_I_SRCS:.idl=_i.c) \ IDL_GEN_C_SRCS = $(IDL_C_SRCS:.idl=_c.c) $(IDL_I_SRCS:.idl=_i.c) \
$(IDL_P_SRCS:.idl=_p.c) $(IDL_S_SRCS:.idl=_s.c) $(IDL_P_SRCS:.idl=_p.c) $(IDL_S_SRCS:.idl=_s.c)
CLEAN_TARGETS = $(IMPORTLIB:%=lib%.@IMPLIBEXT@) \ CLEAN_TARGETS = $(TESTMODULE) $(TESTMODULE_STRIPPED) $(CROSSTESTMODULE)
$(TESTMODULE) $(TESTMODULE_STRIPPED) $(CROSSTESTMODULE)
OBJS = $(C_SRCS:.c=.o) $(BISON_SRCS:.y=.tab.o) $(LEX_SRCS:.l=.yy.o) $(IDL_GEN_C_SRCS:.c=.o) $(OBJC_SRCS:.m=.o) \ OBJS = $(C_SRCS:.c=.o) $(BISON_SRCS:.y=.tab.o) $(LEX_SRCS:.l=.yy.o) $(IDL_GEN_C_SRCS:.c=.o) $(OBJC_SRCS:.m=.o) \
$(IDL_R_SRCS:.idl=_r.res) $(IDL_TLB_RES) $(RC_SRCS:.rc=.res) $(MC_SRCS:.mc=.res) $(EXTRA_OBJS) $(IDL_R_SRCS:.idl=_r.res) $(IDL_TLB_RES) $(RC_SRCS:.rc=.res) $(MC_SRCS:.mc=.res) $(EXTRA_OBJS)
...@@ -42,19 +41,6 @@ $(STATICLIB:.a=.cross.a): $(CROSSOBJS) ...@@ -42,19 +41,6 @@ $(STATICLIB:.a=.cross.a): $(CROSSOBJS)
$(CROSSAR) $(ARFLAGS) $@ $(CROSSOBJS) $(CROSSAR) $(ARFLAGS) $@ $(CROSSOBJS)
$(CROSSRANLIB) $@ $(CROSSRANLIB) $@
# Rules for import libraries
$(IMPORTLIB:%=lib%.def.a): $(IMPLIB_SRCS:.c=.o)
$(RM) $@
$(AR) $(ARFLAGS) $@ $(IMPLIB_SRCS:.c=.o)
$(RANLIB) $@
$(IMPORTLIB:%=lib%.a): $(MAINSPEC) $(IMPLIB_SRCS:.c=.o)
$(WINEBUILD) $(TARGETFLAGS) -w --implib -o $@ --export $(MAINSPEC) $(IMPLIB_SRCS:.c=.o)
$(IMPORTLIB:%=lib%.cross.a): $(MAINSPEC) $(IMPLIB_SRCS:.c=.cross.o)
$(WINEBUILD) $(CROSSTARGET:%=-b %) -w --implib -o $@ --export $(MAINSPEC) $(IMPLIB_SRCS:.c=.cross.o)
# Rules for dependencies # Rules for dependencies
depend: dummy depend: dummy
......
...@@ -30,7 +30,6 @@ FLEX = @FLEX@ ...@@ -30,7 +30,6 @@ FLEX = @FLEX@
EXEEXT = @EXEEXT@ EXEEXT = @EXEEXT@
DLLPREFIX = @DLLPREFIX@ DLLPREFIX = @DLLPREFIX@
TOOLSEXT = @TOOLSEXT@ TOOLSEXT = @TOOLSEXT@
IMPLIBEXT = @IMPLIBEXT@
DLLTOOL = @DLLTOOL@ DLLTOOL = @DLLTOOL@
AR = @AR@ AR = @AR@
ARFLAGS = @ARFLAGS@ ARFLAGS = @ARFLAGS@
......
...@@ -711,7 +711,6 @@ READELF ...@@ -711,7 +711,6 @@ READELF
LDD LDD
LDRPATH_LOCAL LDRPATH_LOCAL
LDRPATH_INSTALL LDRPATH_INSTALL
IMPLIBEXT
DLLFLAGS DLLFLAGS
DLLPREFIX DLLPREFIX
dlldir dlldir
...@@ -6908,14 +6907,13 @@ DLLPREFIX="" ...@@ -6908,14 +6907,13 @@ DLLPREFIX=""
DLLFLAGS="-D_REENTRANT" DLLFLAGS="-D_REENTRANT"
IMPLIBEXT="def"
LDRPATH_INSTALL="" LDRPATH_INSTALL=""
LDRPATH_LOCAL="" LDRPATH_LOCAL=""
LIBEXT="so" LIBEXT="so"
DLLEXT=".so" DLLEXT=".so"
IMPLIBEXT="def"
STATIC_IMPLIBEXT="def.a" STATIC_IMPLIBEXT="def.a"
# Extract the first word of "ldd", so it can be a program name with args. # Extract the first word of "ldd", so it can be a program name with args.
set dummy ldd; ac_word=$2 set dummy ldd; ac_word=$2
...@@ -17426,7 +17424,6 @@ wine_fn_ignore_file "config.status" ...@@ -17426,7 +17424,6 @@ wine_fn_ignore_file "config.status"
wine_fn_ignore_file "configure.lineno" wine_fn_ignore_file "configure.lineno"
wine_fn_ignore_file "include/config.h" wine_fn_ignore_file "include/config.h"
wine_fn_ignore_file "include/stamp-h" wine_fn_ignore_file "include/stamp-h"
wine_fn_ignore_file "dlls/*/*.def"
test "x$enable_fonts" = xno || wine_fn_ignore_file "fonts/*.fon" test "x$enable_fonts" = xno || wine_fn_ignore_file "fonts/*.fon"
test "x$enable_winetest" = xno || wine_fn_ignore_file "programs/winetest/build.nfo" test "x$enable_winetest" = xno || wine_fn_ignore_file "programs/winetest/build.nfo"
test "x$enable_winetest" = xno || wine_fn_ignore_file "programs/winetest/build.rc" test "x$enable_winetest" = xno || wine_fn_ignore_file "programs/winetest/build.rc"
......
...@@ -675,11 +675,11 @@ dnl **** Check for working dll **** ...@@ -675,11 +675,11 @@ dnl **** Check for working dll ****
AC_SUBST(dlldir,"\${libdir}/wine") AC_SUBST(dlldir,"\${libdir}/wine")
AC_SUBST(DLLPREFIX,"") AC_SUBST(DLLPREFIX,"")
AC_SUBST(DLLFLAGS,"-D_REENTRANT") AC_SUBST(DLLFLAGS,"-D_REENTRANT")
AC_SUBST(IMPLIBEXT,"def")
AC_SUBST(LDRPATH_INSTALL,"") AC_SUBST(LDRPATH_INSTALL,"")
AC_SUBST(LDRPATH_LOCAL,"") AC_SUBST(LDRPATH_LOCAL,"")
LIBEXT="so" LIBEXT="so"
DLLEXT=".so" DLLEXT=".so"
IMPLIBEXT="def"
STATIC_IMPLIBEXT="def.a" STATIC_IMPLIBEXT="def.a"
WINE_PATH_SONAME_TOOLS WINE_PATH_SONAME_TOOLS
...@@ -3470,7 +3470,6 @@ WINE_IGNORE_FILE("config.status") ...@@ -3470,7 +3470,6 @@ WINE_IGNORE_FILE("config.status")
WINE_IGNORE_FILE("configure.lineno") WINE_IGNORE_FILE("configure.lineno")
WINE_IGNORE_FILE("include/config.h") WINE_IGNORE_FILE("include/config.h")
WINE_IGNORE_FILE("include/stamp-h") WINE_IGNORE_FILE("include/stamp-h")
WINE_IGNORE_FILE("dlls/*/*.def")
WINE_IGNORE_FILE("fonts/*.fon",enable_fonts) WINE_IGNORE_FILE("fonts/*.fon",enable_fonts)
WINE_IGNORE_FILE("programs/winetest/build.nfo",enable_winetest) WINE_IGNORE_FILE("programs/winetest/build.nfo",enable_winetest)
WINE_IGNORE_FILE("programs/winetest/build.rc",enable_winetest) WINE_IGNORE_FILE("programs/winetest/build.rc",enable_winetest)
......
...@@ -1376,6 +1376,7 @@ static struct strarray output_sources(void) ...@@ -1376,6 +1376,7 @@ static struct strarray output_sources(void)
struct strarray mc_files = empty_strarray; struct strarray mc_files = empty_strarray;
struct strarray test_files = empty_strarray; struct strarray test_files = empty_strarray;
struct strarray dlldata_files = empty_strarray; struct strarray dlldata_files = empty_strarray;
struct strarray implib_objs = empty_strarray;
struct strarray includes = empty_strarray; struct strarray includes = empty_strarray;
struct strarray subdirs = empty_strarray; struct strarray subdirs = empty_strarray;
struct strarray all_targets = empty_strarray; struct strarray all_targets = empty_strarray;
...@@ -1385,6 +1386,7 @@ static struct strarray output_sources(void) ...@@ -1385,6 +1386,7 @@ static struct strarray output_sources(void)
char *module = get_expanded_make_variable( "MODULE" ); char *module = get_expanded_make_variable( "MODULE" );
char *exeext = get_expanded_make_variable( "EXEEXT" ); char *exeext = get_expanded_make_variable( "EXEEXT" );
char *appmode = get_expanded_make_variable( "APPMODE" ); char *appmode = get_expanded_make_variable( "APPMODE" );
char *crosstarget = get_expanded_make_variable( "CROSSTARGET" );
if (exeext && !strcmp( exeext, ".exe" )) dllext = ""; if (exeext && !strcmp( exeext, ".exe" )) dllext = "";
...@@ -1569,6 +1571,7 @@ static struct strarray output_sources(void) ...@@ -1569,6 +1571,7 @@ static struct strarray output_sources(void)
else else
{ {
if (source->flags & FLAG_GENERATED) strarray_add( &clean_files, source->filename ); if (source->flags & FLAG_GENERATED) strarray_add( &clean_files, source->filename );
if (source->flags & FLAG_C_IMPLIB) strarray_add( &implib_objs, strmake( "%s.o", obj ));
for (i = 0; i < object_extensions.count; i++) for (i = 0; i < object_extensions.count; i++)
{ {
output( "%s.%s: %s\n", obj, object_extensions.str[i], sourcedep ); output( "%s.%s: %s\n", obj, object_extensions.str[i], sourcedep );
...@@ -1589,7 +1592,7 @@ static struct strarray output_sources(void) ...@@ -1589,7 +1592,7 @@ static struct strarray output_sources(void)
output( "\n" ); output( "\n" );
} }
} }
if (source->flags & FLAG_C_IMPLIB) if (crosstarget && (source->flags & FLAG_C_IMPLIB))
{ {
strarray_add( &crossobj_files, strmake( "%s.cross.o", obj )); strarray_add( &crossobj_files, strmake( "%s.cross.o", obj ));
output( "%s.cross.o: %s\n", obj, sourcedep ); output( "%s.cross.o: %s\n", obj, sourcedep );
...@@ -1653,6 +1656,8 @@ static struct strarray output_sources(void) ...@@ -1653,6 +1656,8 @@ static struct strarray output_sources(void)
if (module) if (module)
{ {
int is_win16 = strendswith( module, "16" );
char *importlib = get_expanded_make_variable( "IMPORTLIB" );
struct strarray all_libs = empty_strarray; struct strarray all_libs = empty_strarray;
char *spec_file = appmode ? NULL : replace_extension( module, ".dll", ".spec" ); char *spec_file = appmode ? NULL : replace_extension( module, ".dll", ".spec" );
...@@ -1695,6 +1700,53 @@ static struct strarray output_sources(void) ...@@ -1695,6 +1700,53 @@ static struct strarray output_sources(void)
output_filenames( all_libs ); output_filenames( all_libs );
output_filename( "$(LDFLAGS)" ); output_filename( "$(LDFLAGS)" );
output( "\n" ); output( "\n" );
if (spec_file && importlib)
{
if (*dllext)
{
strarray_add( &clean_files, strmake( "lib%s.def", importlib ));
output( "lib%s.def: %s\n", importlib, spec_file );
output( "\t$(WINEBUILD) -w --def -o $@ --export %s", spec_file );
output_filenames( get_expanded_make_var_array( "TARGETFLAGS" ));
if (is_win16) output_filename( "-m16" );
output( "\n" );
if (implib_objs.count)
{
strarray_add( &clean_files, strmake( "lib%s.def.a", importlib ));
output( "lib%s.def.a:", importlib );
output_filenames( implib_objs );
output( "\n" );
output( "\t$(RM) $@\n" );
output( "\t$(AR) $(ARFLAGS) $@" );
output_filenames( implib_objs );
output( "\n" );
output( "\t$(RANLIB) $@\n" );
}
}
else
{
strarray_add( &clean_files, strmake( "lib%s.a", importlib ));
output( "lib%s.a: %s", importlib, spec_file );
output_filenames( implib_objs );
output( "\n" );
output( "\t$(WINEBUILD) -w --implib -o $@ --export %s", spec_file );
output_filenames( get_expanded_make_var_array( "TARGETFLAGS" ));
output_filenames( implib_objs );
output( "\n" );
}
if (crosstarget && !is_win16)
{
struct strarray cross_files = strarray_replace_extension( &implib_objs, ".o", ".cross.o" );
strarray_add( &clean_files, strmake( "lib%s.cross.a", importlib ));
output( "lib%s.cross.a: %s", importlib, spec_file );
output_filenames( cross_files );
output( "\n" );
output( "\t$(WINEBUILD) -b %s -w --implib -o $@ --export %s", crosstarget, spec_file );
output_filenames( cross_files );
output( "\n" );
}
}
} }
if (is_test) if (is_test)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment