From 79c852340c63a68c378c2059e1ffe73ad6d891ad Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 12 Nov 2015 23:19:24 +0900 Subject: [PATCH] makefiles: Generate rules for building the libwine import library. Signed-off-by: Alexandre Julliard --- configure | 15 ++------------- configure.ac | 15 ++------------- tools/makedep.c | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 26 deletions(-) diff --git a/configure b/configure index e83ca7ba4c1..4fecf625428 100755 --- a/configure +++ b/configure @@ -7986,23 +7986,12 @@ fi LIBWINE_RULES=" SHAREDLIB = libwine.dll +IMPORTLIB = libwine.a INSTALL_LIB = libwine.dll +INSTALL_DEV = libwine.a libwine_LDFLAGS = -shared \$(srcdir)/wine.def -EXTRA_TARGETS = libwine.a - -all: libwine.a - -libwine.a: \$(srcdir)/wine.def - \$(DLLTOOL) -l \$@ -d \$(srcdir)/wine.def - libwine.dll: \$(srcdir)/wine.def - -install install-dev:: libwine.a - \$(INSTALL_DATA) libwine.a \$(DESTDIR)\$(libdir)/libwine.a - -uninstall:: - \$(RM) \$(DESTDIR)\$(libdir)/libwine.a " ;; diff --git a/configure.ac b/configure.ac index 372d06e69d2..48268b00f97 100644 --- a/configure.ac +++ b/configure.ac @@ -719,23 +719,12 @@ case $host_os in AC_SUBST(LIBWINE_RULES,[" SHAREDLIB = libwine.dll +IMPORTLIB = libwine.a INSTALL_LIB = libwine.dll +INSTALL_DEV = libwine.a libwine_LDFLAGS = -shared \$(srcdir)/wine.def -EXTRA_TARGETS = libwine.a - -all: libwine.a - -libwine.a: \$(srcdir)/wine.def - \$(DLLTOOL) -l \$@ -d \$(srcdir)/wine.def - libwine.dll: \$(srcdir)/wine.def - -install install-dev:: libwine.a - \$(INSTALL_DATA) libwine.a \$(DESTDIR)\$(libdir)/libwine.a - -uninstall:: - \$(RM) \$(DESTDIR)\$(libdir)/libwine.a "]) ;; diff --git a/tools/makedep.c b/tools/makedep.c index f037d6b1b68..023c0ecee1b 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -145,6 +145,7 @@ static const char *fontforge; static const char *convert; static const char *rsvg; static const char *icotool; +static const char *dlltool; struct makefile { @@ -2612,6 +2613,18 @@ static struct strarray output_sources( const struct makefile *make, struct strar strarray_addall( &all_targets, names ); } + if (make->importlib && !make->module) /* stand-alone import lib (for libwine) */ + { + char *def_file = replace_extension( make->importlib, ".a", ".def" ); + + if (!strncmp( def_file, "lib", 3 )) def_file += 3; + output( "%s: %s\n", obj_dir_path( make, make->importlib ), src_dir_path( make, def_file )); + output( "\t%s -l $@ -d %s\n", dlltool, src_dir_path( make, def_file )); + add_install_rule( make, install_rules, make->importlib, make->importlib, + strmake( "d$(libdir)/%s", make->importlib )); + strarray_add( &all_targets, make->importlib ); + } + if (make->testdll) { char *testmodule = replace_extension( make->testdll, ".dll", "_test.exe" ); @@ -3252,6 +3265,7 @@ int main( int argc, char *argv[] ) convert = get_expanded_make_variable( top_makefile, "CONVERT" ); rsvg = get_expanded_make_variable( top_makefile, "RSVG" ); icotool = get_expanded_make_variable( top_makefile, "ICOTOOL" ); + dlltool = get_expanded_make_variable( top_makefile, "DLLTOOL" ); if (root_src_dir && !strcmp( root_src_dir, "." )) root_src_dir = NULL; if (tools_dir && !strcmp( tools_dir, "." )) tools_dir = NULL;