Alexandre Julliard : makefiles: Add a makedep pragma to mark source files that are parts of the import library .
Alexandre Julliard
julliard at winehq.org
Mon Nov 11 14:08:15 CST 2013
Module: wine
Branch: master
Commit: fe946f253ad8ef8ec2400aaf1d71799ca2a99567
URL: http://source.winehq.org/git/wine.git/?a=commit;h=fe946f253ad8ef8ec2400aaf1d71799ca2a99567
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Nov 11 11:23:38 2013 +0100
makefiles: Add a makedep pragma to mark source files that are parts of the import library.
---
Make.rules.in | 11 +----------
dlls/dinput/data_formats.c | 4 ++++
tools/make_makefiles | 25 +++++++++++++++++++------
tools/makedep.c | 9 +++++++++
4 files changed, 33 insertions(+), 16 deletions(-)
diff --git a/Make.rules.in b/Make.rules.in
index ffa6cc3..d9c9827 100644
--- a/Make.rules.in
+++ b/Make.rules.in
@@ -32,16 +32,7 @@ ALLCROSSCFLAGS = $(INCLUDES) $(DEFS) -DWINE_CROSSTEST $(CPPFLAGS) $(CFLAGS)
# Implicit rules
-.SUFFIXES: .ok .man.in .man .cross.o .po .mo @MAINTAINER_MODE@ .sfd .ttf .svg .ico .bmp
-
-.c.o:
- $(CC) -c $(ALLCFLAGS) -o $@ $<
-
-.m.o:
- $(CC) -c $(ALLCFLAGS) -o $@ $<
-
-.c.cross.o:
- $(CROSSCC) -c $(INCLUDES) $(DEFS) -DWINE_CROSSTEST $(CPPFLAGS) $(CFLAGS) -o $@ $<
+.SUFFIXES: .ok .man.in .man .po .mo @MAINTAINER_MODE@ .sfd .ttf .svg .ico .bmp
.c.ok:
$(RUNTEST) $(RUNTESTFLAGS) $< && touch $@
diff --git a/dlls/dinput/data_formats.c b/dlls/dinput/data_formats.c
index 1f25556..5fac7b7 100644
--- a/dlls/dinput/data_formats.c
+++ b/dlls/dinput/data_formats.c
@@ -16,6 +16,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#if 0
+#pragma makedep implib
+#endif
+
#include <stdarg.h>
#include "windef.h"
diff --git a/tools/make_makefiles b/tools/make_makefiles
index 048dfe3..b61d403 100755
--- a/tools/make_makefiles
+++ b/tools/make_makefiles
@@ -335,9 +335,7 @@ sub parse_makefile($)
my $var = $1;
my @list = split(/\s+/, $2);
$make{$var} = \@list;
- ${$make{"=flags"}}{"mc"} = 1 if $var eq "MC_SRCS";
- ${$make{"=flags"}}{"staticimplib"} = 1 if $var eq "IMPLIB_SRCS";
- ${$make{"=flags"}}{"clean"} = 1 if $var =~ /IDL_[CHIPRS]_SRCS|IDL_TLB_SRCS|PROGRAMS/;
+ ${$make{"=flags"}}{"clean"} = 1 if $var eq "PROGRAMS";
next;
}
if (/(install-lib|install-dev|clean)\s*:/)
@@ -427,12 +425,20 @@ sub assign_sources_to_makefiles(@)
}
else
{
- if ($name =~ /\.c$/) { push @{${$make}{"=C_SRCS"}}, $name; }
- elsif ($name =~ /\.m$/) { push @{${$make}{"=OBJC_SRCS"}}, $name; }
+ if ($name =~ /\.m$/) { push @{${$make}{"=OBJC_SRCS"}}, $name; }
elsif ($name =~ /\.l$/) { push @{${$make}{"=LEX_SRCS"}}, $name; }
elsif ($name =~ /\.y$/) { push @{${$make}{"=BISON_SRCS"}}, $name; }
- elsif ($name =~ /\.mc$/) { push @{${$make}{"=MC_SRCS"}}, $name; }
elsif ($name =~ /\.svg$/) { push @{${$make}{"=SVG_SRCS"}}, $name; }
+ elsif ($name =~ /\.c$/)
+ {
+ my %flags = get_makedep_flags( $file );
+ if (defined $flags{"implib"})
+ {
+ push @{${$make}{"=IMPLIB_SRCS"}}, $name;
+ ${${$make}{"=flags"}}{"staticimplib"} = 1;
+ }
+ push @{${$make}{"=C_SRCS"}}, $name;
+ }
elsif ($name =~ /\.rc$/)
{
my %flags = get_makedep_flags( $file );
@@ -443,6 +449,11 @@ sub assign_sources_to_makefiles(@)
}
push @{${$make}{"=RC_SRCS"}}, $name;
}
+ elsif ($name =~ /\.mc$/)
+ {
+ push @{${$make}{"=MC_SRCS"}}, $name;
+ ${${$make}{"=flags"}}{"mc"} = 1;
+ }
elsif ($name =~ /\.idl$/)
{
my %flags = get_makedep_flags( $file );
@@ -453,6 +464,7 @@ sub assign_sources_to_makefiles(@)
push @{${$make}{"=IDL_R_SRCS"}}, $name if defined $flags{"register"};
push @{${$make}{"=IDL_S_SRCS"}}, $name if defined $flags{"server"};
push @{${$make}{"=IDL_TLB_SRCS"}}, $name if defined $flags{"typelib"};
+ ${${$make}{"=flags"}}{"clean"} = 1;
}
}
}
@@ -567,6 +579,7 @@ sub update_makefiles(@)
replace_makefile_variable( $file, "IDL_S_SRCS" );
replace_makefile_variable( $file, "IDL_TLB_SRCS" );
replace_makefile_variable( $file, "XTEMPLATE_SRCS" );
+ replace_makefile_variable( $file, "IMPLIB_SRCS" );
replace_makefile_variable( $file, "SRCDIR_INCLUDES" );
}
diff --git a/tools/makedep.c b/tools/makedep.c
index aef0f3e..945ba26 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -59,6 +59,7 @@ struct incl_file
#define FLAG_IDL_TYPELIB 0x0040 /* generates a typelib (.tlb) file */
#define FLAG_IDL_HEADER 0x0080 /* generates a header (.h) file */
#define FLAG_RC_PO 0x0100 /* rc file contains translations */
+#define FLAG_C_IMPLIB 0x0200 /* file is part of an import library */
static const struct
{
@@ -747,6 +748,7 @@ static void parse_pragma_directive( struct incl_file *source, char *str )
{
if (!strcmp( flag, "po" )) source->flags |= FLAG_RC_PO;
}
+ else if (!strcmp( flag, "implib" )) source->flags |= FLAG_C_IMPLIB;
}
}
@@ -1232,8 +1234,15 @@ static void output_sources(void)
else
output( "\t$(CC) -c $(ALLCFLAGS) -o $@ %s\n", source->filename );
}
+ if (source->flags & FLAG_C_IMPLIB)
+ {
+ strarray_add( &clean_files, strmake( "%s.cross.o", obj ));
+ output( "%s.cross.o: %s\n", obj, source->filename );
+ output( "\t$(CROSSCC) -c $(ALLCROSSCFLAGS) -o $@ %s\n", source->filename );
+ }
LIST_FOR_EACH_ENTRY( ext, &object_extensions, struct object_extension, entry )
column += output( "%s.%s ", obj, ext->extension );
+ if (source->flags & FLAG_C_IMPLIB) column += output( "%s.cross.o", obj );
column += output( ":" );
}
free( obj );
More information about the wine-cvs
mailing list