makedep: Generate rules for the main module.

This commit is contained in:
Alexandre Julliard 2013-12-30 20:08:13 +01:00
parent 8d6e916168
commit f6479c0513
4 changed files with 66 additions and 36 deletions

View File

@ -19,7 +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_P_SRCS:.idl=_p.c) $(IDL_S_SRCS:.idl=_s.c)
CLEAN_TARGETS = $(MODULE) $(IMPORTLIB:%=lib%.@IMPLIBEXT@) \
CLEAN_TARGETS = $(IMPORTLIB:%=lib%.@IMPLIBEXT@) \
$(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) \
@ -28,11 +28,6 @@ OBJS = $(C_SRCS:.c=.o) $(BISON_SRCS:.y=.tab.o) $(LEX_SRCS:.l=.yy.o) $(IDL_GEN_C_
CROSSOBJS = $(OBJS:.o=.cross.o)
ALLCROSSCFLAGS = $(DEFS) -DWINE_CROSSTEST $(CPPFLAGS) $(CFLAGS)
# Rules for main module
$(MODULE) $(MODULE:%=%.so) $(MODULE:%=%.fake): $(MAINSPEC) $(OBJS)
$(WINEGCC) $(APPMODE) $(MODULEFLAGS) $(OBJS) -o $@ $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(DELAYIMPORTS:%=-Wb,-d%) -lwine $(LIBPORT) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
# Rules for static libraries
all: $(STATICLIB)

14
configure vendored
View File

@ -16556,20 +16556,9 @@ all: \$(STATICLIB:.a=.cross.a)
fi
if test -n "$DLLEXT"
then
deps="\$(MODULE)$DLLEXT \$(MODULE).fake"
else
deps="\$(MODULE)"
fi
MAKE_DLL_RULES="
DLLFLAGS = $DLLFLAGS
MAINSPEC = \$(srcdir)/\$(MODULE:%.dll=%).spec
IDL_TLB_RES = \$(IDL_TLB_SRCS:.idl=_t.res)
MODULEFLAGS = -shared \$(MAINSPEC) \$(EXTRADLLFLAGS)
all: $deps
manpages:: dummy
\$(C2MAN) -o \$(top_builddir)/documentation/man\$(api_manext) -R\$(top_builddir) -C\$(srcdir) \$(PARENTSRC:%=-P%) -I\$(top_srcdir)/include \$(MAINSPEC:%=-w %) \$(C_SRCS)
@ -16585,8 +16574,6 @@ xmlpages:: dummy
MAKE_PROG_RULES="
DLLFLAGS = $DLLFLAGS
all: $deps
"
@ -17428,7 +17415,6 @@ zh_TW"
wine_fn_ignore_file "*.a"
wine_fn_ignore_file "*.exe"
test -n "$DLLEXT" && wine_fn_ignore_file "*$DLLEXT"
test -n "$DLLEXT" && wine_fn_ignore_file "*.fake"
wine_fn_ignore_file ".gitignore"
wine_fn_ignore_file "Makefile"
wine_fn_ignore_file "TAGS"

View File

@ -2613,20 +2613,9 @@ fi
dnl Dll and program rules
if test -n "$DLLEXT"
then
deps="\$(MODULE)$DLLEXT \$(MODULE).fake"
else
deps="\$(MODULE)"
fi
AC_SUBST(MAKE_DLL_RULES,"
DLLFLAGS = $DLLFLAGS
MAINSPEC = \$(srcdir)/\$(MODULE:%.dll=%).spec
IDL_TLB_RES = \$(IDL_TLB_SRCS:.idl=_t.res)
MODULEFLAGS = -shared \$(MAINSPEC) \$(EXTRADLLFLAGS)
all: $deps
manpages:: dummy
\$(C2MAN) -o \$(top_builddir)/documentation/man\$(api_manext) -R\$(top_builddir) -C\$(srcdir) \$(PARENTSRC:%=-P%) -I\$(top_srcdir)/include \$(MAINSPEC:%=-w %) \$(C_SRCS)
@ -2641,8 +2630,6 @@ xmlpages:: dummy
AC_SUBST(MAKE_PROG_RULES,"
DLLFLAGS = $DLLFLAGS
all: $deps
")
dnl Test rules
@ -3472,7 +3459,6 @@ dnl Main ignore file
WINE_IGNORE_FILE("*.a")
WINE_IGNORE_FILE("*.exe")
test -n "$DLLEXT" && WINE_IGNORE_FILE("*$DLLEXT")
test -n "$DLLEXT" && WINE_IGNORE_FILE("*.fake")
WINE_IGNORE_FILE(".gitignore")
WINE_IGNORE_FILE("Makefile")
WINE_IGNORE_FILE("TAGS")

View File

@ -1366,6 +1366,7 @@ static struct strarray output_sources(void)
{
struct incl_file *source;
int i;
const char *dllext = ".so";
int is_test = find_src_file( "testlist.o" ) != NULL;
struct strarray object_files = empty_strarray;
struct strarray crossobj_files = empty_strarray;
@ -1377,7 +1378,15 @@ static struct strarray output_sources(void)
struct strarray dlldata_files = empty_strarray;
struct strarray includes = empty_strarray;
struct strarray subdirs = empty_strarray;
struct strarray all_targets = empty_strarray;
struct strarray phony_targets = empty_strarray;
struct strarray imports = get_expanded_make_var_array( "IMPORTS" );
struct strarray delayimports = get_expanded_make_var_array( "DELAYIMPORTS" );
char *module = get_expanded_make_variable( "MODULE" );
char *exeext = get_expanded_make_variable( "EXEEXT" );
char *appmode = get_expanded_make_variable( "APPMODE" );
if (exeext && !strcmp( exeext, ".exe" )) dllext = "";
strarray_add( &includes, "-I." );
if (src_dir) strarray_add( &includes, strmake( "-I%s", src_dir ));
@ -1642,6 +1651,52 @@ static struct strarray output_sources(void)
output( "\n" );
}
if (module)
{
struct strarray all_libs = empty_strarray;
char *spec_file = appmode ? NULL : replace_extension( module, ".dll", ".spec" );
if (spec_file && src_dir) spec_file = strmake( "%s/%s", src_dir, spec_file );
for (i = 0; i < delayimports.count; i++)
strarray_add( &all_libs, strmake( "-l%s", delayimports.str[i] ));
for (i = 0; i < imports.count; i++)
strarray_add( &all_libs, strmake( "-l%s", imports.str[i] ));
for (i = 0; i < delayimports.count; i++)
strarray_add( &all_libs, strmake( "-Wb,-d%s", delayimports.str[i] ));
strarray_add( &all_libs, "-lwine" );
strarray_addall( &all_libs, get_expanded_make_var_array( "LIBPORT" ));
strarray_addall( &all_libs, get_expanded_make_var_array( "EXTRALIBS" ));
strarray_addall( &all_libs, get_expanded_make_var_array( "LIBS" ));
if (*dllext)
{
strarray_add( &all_targets, strmake( "%s%s", module, dllext ));
strarray_add( &all_targets, strmake( "%s.fake", module ));
output( "%s%s %s.fake:", module, dllext, module );
}
else
{
strarray_add( &all_targets, module );
output( "%s:", module );
}
if (spec_file) output_filename( spec_file );
output_filenames( object_files );
output_filenames( res_files );
output( "\n" );
output( "\t$(WINEGCC) -o $@" );
if (spec_file)
{
output( " -shared %s", spec_file );
output_filenames( get_expanded_make_var_array( "EXTRADLLFLAGS" ));
}
else output_filename( appmode );
output_filenames( object_files );
output_filenames( res_files );
output_filenames( all_libs );
output_filename( "$(LDFLAGS)" );
output( "\n" );
}
if (is_test)
{
struct strarray ok_files = strarray_replace_extension( &test_files, ".c", ".ok" );
@ -1662,9 +1717,17 @@ static struct strarray output_sources(void)
strarray_add( &phony_targets, "testclean" );
}
if (all_targets.count)
{
output( "all:" );
output_filenames( all_targets );
output( "\n" );
}
strarray_addall( &clean_files, object_files );
strarray_addall( &clean_files, crossobj_files );
strarray_addall( &clean_files, res_files );
strarray_addall( &clean_files, all_targets );
if (clean_files.count)
{
@ -1780,7 +1843,7 @@ static void output_dependencies( const char *path )
}
if (fclose( output_file )) fatal_perror( "write" );
output_file = tmp_file;
if (!found && !list_empty(&sources)) output( "\n%s\n", Separator );
if (!found) output( "\n%s\n", Separator );
}
else
{
@ -1788,7 +1851,7 @@ static void output_dependencies( const char *path )
fatal_perror( "%s", path );
}
if (!list_empty( &sources )) targets = output_sources();
targets = output_sources();
fclose( output_file );
output_file = NULL;