Module: wine Branch: master Commit: 3571c0679918eb008ad0fde52cee9bd06eba75c5 URL: http://source.winehq.org/git/wine.git/?a=commit;h=3571c0679918eb008ad0fde52c...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Oct 28 11:16:11 2013 +0100
makefiles: Generate explicit build rules for C source files from makedep.
---
Make.rules.in | 1 + libs/wine/Makefile.in | 25 ++++++++++--------------- tools/makedep.c | 23 ++++++++++++++++++++--- 3 files changed, 31 insertions(+), 18 deletions(-)
diff --git a/Make.rules.in b/Make.rules.in index 94c2e83..2c0f965 100644 --- a/Make.rules.in +++ b/Make.rules.in @@ -33,6 +33,7 @@ OBJS = $(C_SRCS:.c=.o) $(BISON_SRCS:.y=.tab.o) $(LEX_SRCS:.l=.yy.o) $(IDL_GEN_C_ $(IDL_R_SRCS:.idl=_r.res) $(IDL_TLB_RES) $(RC_SRCS:.rc=.res) $(MC_SRCS:.mc=.res) $(EXTRA_OBJS)
CROSSOBJS = $(OBJS:.o=.cross.o) +ALLCROSSCFLAGS = $(INCLUDES) $(DEFS) -DWINE_CROSSTEST $(CPPFLAGS) $(CFLAGS)
# Implicit rules
diff --git a/libs/wine/Makefile.in b/libs/wine/Makefile.in index 24635c1..b958484 100644 --- a/libs/wine/Makefile.in +++ b/libs/wine/Makefile.in @@ -1,6 +1,13 @@ DLLFLAGS = @DLLFLAGS@ EXTRALIBS = $(LIBPORT) @LIBDL@ @COREFOUNDATIONLIB@ @CORESERVICESLIB@ -EXTRADEFS = -DWINE_UNICODE_API="" +EXTRADEFS = -DWINE_UNICODE_API="" \ + -DBINDIR='"$(bindir)"' \ + -DDLLDIR='"$(dlldir)"' \ + -DDLLPREFIX='"$(DLLPREFIX)"' \ + -DLIB_TO_BINDIR="`$(RELPATH) $(libdir) $(bindir)`" \ + -DLIB_TO_DLLDIR="`$(RELPATH) $(libdir) $(dlldir)`" \ + -DBIN_TO_DLLDIR="`$(RELPATH) $(bindir) $(dlldir)`" \ + -DBIN_TO_DATADIR="`$(RELPATH) $(bindir) $(datadir)/wine`" STATICLIB = libwine_static.a
VERSION = 1.0 @@ -103,23 +110,11 @@ EXTRA_OBJS = version.o
@MAKE_RULES@
-# Special defines needed for config.c - -CONFIGDIRS = \ - -DBINDIR='"$(bindir)"' \ - -DDLLDIR='"$(dlldir)"' \ - -DDLLPREFIX='"$(DLLPREFIX)"' \ - -DLIB_TO_BINDIR="`$(RELPATH) $(libdir) $(bindir)`" \ - -DLIB_TO_DLLDIR="`$(RELPATH) $(libdir) $(dlldir)`" \ - -DBIN_TO_DLLDIR="`$(RELPATH) $(bindir) $(dlldir)`" \ - -DBIN_TO_DATADIR="`$(RELPATH) $(bindir) $(datadir)/wine`" - -config.o: config.c $(RELPATH) - $(CC) -c $(ALLCFLAGS) -o $@ $(srcdir)/config.c $(CONFIGDIRS) - version.c: dummy version=`(GIT_DIR=$(top_srcdir)/.git git describe HEAD 2>/dev/null || echo "wine-@PACKAGE_VERSION@") | sed -n -e '$$s/(.*)/const char wine_build[] = "\1";/p'` && (echo $$version | cmp -s - $@) || echo $$version >$@ || ($(RM) $@ && exit 1)
+$(OBJS): $(RELPATH) + $(RELPATH): @cd $(TOOLSDIR)/tools && $(MAKE) relpath$(TOOLSEXT)
diff --git a/tools/makedep.c b/tools/makedep.c index 982d827..466066e 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -981,14 +981,18 @@ static void output_sources(void) else output( "%s.tab.c: %s\n", obj, source->filename );
output( "\t$(BISON) $(BISONFLAGS) -p %s_ -o $@ %s\n", obj, source->filename ); - column += output( "%s.tab.o: %s.tab.c", obj, obj ); + output( "%s.tab.o: %s.tab.c\n", obj, obj ); + output( "\t$(CC) -c $(ALLCFLAGS) -o $@ %s.tab.c\n", obj ); + column += output( "%s.tab.o:", obj ); free( header ); } else if (!strcmp( ext, "l" )) /* lex file */ { output( "%s.yy.c: %s\n", obj, source->filename ); output( "\t$(FLEX) $(LEXFLAGS) -o$@ %s\n", source->filename ); - column += output( "%s.yy.o: %s.yy.c", obj, obj ); + output( "%s.yy.o: %s.yy.c\n", obj, obj ); + output( "\t$(CC) -c $(ALLCFLAGS) -o $@ %s.yy.c\n", obj ); + column += output( "%s.yy.o:", obj ); } else if (!strcmp( ext, "rc" )) /* resource file */ { @@ -1069,8 +1073,21 @@ static void output_sources(void) { struct object_extension *ext; LIST_FOR_EACH_ENTRY( ext, &object_extensions, struct object_extension, entry ) + { + if (strstr( ext->extension, "cross" )) + { + output( "%s.%s: %s\n", obj, ext->extension, source->filename ); + output( "\t$(CROSSCC) -c $(ALLCROSSCFLAGS) -o $@ %s\n", source->filename ); + } + else + { + output( "%s.%s: %s\n", obj, ext->extension, source->filename ); + output( "\t$(CC) -c $(ALLCFLAGS) -o $@ %s\n", source->filename ); + } + } + LIST_FOR_EACH_ENTRY( ext, &object_extensions, struct object_extension, entry ) column += output( "%s.%s ", obj, ext->extension ); - column += output( ": %s", source->filename ); + column += output( ":" ); } free( obj );