Alexandre Julliard : makefiles: Generate rules for installing IDL headers.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Nov 4 09:40:40 CST 2015


Module: wine
Branch: master
Commit: 316448cd4780855961f397a9947b3e2d16eb3463
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=316448cd4780855961f397a9947b3e2d16eb3463

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Nov  4 14:57:37 2015 +0900

makefiles: Generate rules for installing IDL headers.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 include/Makefile.in       | 30 +++++-------------------------
 include/stdole2.idl       |  3 +++
 include/wine/winedxgi.idl |  2 ++
 tools/make_makefiles      | 16 +++-------------
 tools/makedep.c           | 21 +++++++++++++++++++--
 5 files changed, 32 insertions(+), 40 deletions(-)

diff --git a/include/Makefile.in b/include/Makefile.in
index 682072c..e3c0acc 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -1,7 +1,4 @@
-PRIVATE_IDL_H_SRCS = \
-	wine/winedxgi.idl
-
-PUBLIC_IDL_H_SRCS = \
+IDL_SRCS = \
 	activaut.idl \
 	activdbg.idl \
 	activscp.idl \
@@ -112,6 +109,7 @@ PUBLIC_IDL_H_SRCS = \
 	shldisp.idl \
 	shobjidl.idl \
 	shtypes.idl \
+	stdole2.idl \
 	strmif.idl \
 	structuredquerycondition.idl \
 	taskschd.idl \
@@ -138,6 +136,7 @@ PUBLIC_IDL_H_SRCS = \
 	windows.foundation.idl \
 	wine/itss.idl \
 	wine/svcctl.idl \
+	wine/winedxgi.idl \
 	winsxs.idl \
 	wmiutils.idl \
 	wmp.idl \
@@ -151,9 +150,6 @@ PUBLIC_IDL_H_SRCS = \
 	xaudio2fx.idl \
 	xmllite.idl
 
-IDL_TLB_SRCS = \
-	stdole2.idl
-
 HEADER_SRCS = \
 	accctrl.h \
 	aclapi.h \
@@ -645,8 +641,6 @@ XTEMPLATE_SRCS = \
 	rmxftmpl.x
 
 SRCDIR_INCLUDES = \
-	$(IDL_TLB_SRCS) \
-	$(PUBLIC_IDL_H_SRCS) \
 	access.idl \
 	asynot.idl \
 	asysta.idl \
@@ -681,31 +675,17 @@ SRCDIR_INCLUDES = \
 	xmldom.idl \
 	xmldso.idl
 
-IDL_H_SRCS = $(PUBLIC_IDL_H_SRCS) $(PRIVATE_IDL_H_SRCS)
-IDL_SRCS = $(IDL_H_SRCS) $(IDL_TLB_SRCS)
-
-OBJDIR_INCLUDES = $(PUBLIC_IDL_H_SRCS:.idl=.h)
-
-all: $(IDL_H_SRCS:.idl=.h) $(IDL_TLB_SRCS:.idl=.tlb)
-
-.PHONY: install install-dev uninstall
-
-install install-dev:: $(OBJDIR_INCLUDES)
+install install-dev::
 	for f in $(SRCDIR_INCLUDES); do case $$f in \
 	  wine/*)   $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(includedir)/`expr $$f : 'wine/\(.*\)'` ;; \
 	  msvcrt/*) $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(includedir)/$$f ;; \
 	  *)        $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(includedir)/windows/$$f ;; \
 	esac; done
-	for f in $(OBJDIR_INCLUDES); do case $$f in \
-	  wine/*)   $(INSTALL_DATA) $$f $(DESTDIR)$(includedir)/`expr $$f : 'wine/\(.*\)'` ;; \
-	  msvcrt/*) $(INSTALL_DATA) $$f $(DESTDIR)$(includedir)/$$f ;; \
-	  *)        $(INSTALL_DATA) $$f $(DESTDIR)$(includedir)/windows/$$f ;; \
-	esac; done
 
 # Don't just do a rm -rf on $(includedir) -- don't want to wipe out
 # anything extra the user may have put there.
 uninstall::
-	for f in $(SRCDIR_INCLUDES) $(OBJDIR_INCLUDES); do case $$f in \
+	for f in $(SRCDIR_INCLUDES); do case $$f in \
 	  wine/*)   $(RM) $(DESTDIR)$(includedir)/`expr $$f : 'wine/\(.*\)'` ;; \
 	  msvcrt/*) $(RM) $(DESTDIR)$(includedir)/$$f ;; \
 	  *)        $(RM) $(DESTDIR)$(includedir)/windows/$$f ;; \
diff --git a/include/stdole2.idl b/include/stdole2.idl
index 81b5463..9839c4c 100644
--- a/include/stdole2.idl
+++ b/include/stdole2.idl
@@ -18,7 +18,10 @@
  *
  */
 
+#if 0
+#pragma makedep install
 #pragma makedep typelib
+#endif
 
 #include <olectl.h>
 
diff --git a/include/wine/winedxgi.idl b/include/wine/winedxgi.idl
index 452f022..d13a2f1 100644
--- a/include/wine/winedxgi.idl
+++ b/include/wine/winedxgi.idl
@@ -16,6 +16,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#pragma makedep header
+
 import "dxgi.idl";
 
 [
diff --git a/tools/make_makefiles b/tools/make_makefiles
index 7229d06..b97f04e 100755
--- a/tools/make_makefiles
+++ b/tools/make_makefiles
@@ -373,16 +373,15 @@ sub assign_sources_to_makefiles(@)
             next if ($name =~ /\.in$/);
             if ($name =~ /^wine\// && !$exported_wine_headers{$name})
             {
-                if ($private_idl_headers{$name}) { push @{${$make}{"=PRIVATE_IDL_H_SRCS"}}, $name; }
+                if ($private_idl_headers{$name}) { push @{${$make}{"=IDL_SRCS"}}, $name; }
                 next;
             }
-            if ($name =~ /stdole2\.idl$/) { push @{${$make}{"=IDL_TLB_SRCS"}}, $name; }
-            elsif ($private_idl_headers{$name}) { push @{${$make}{"=SRCDIR_INCLUDES"}}, $name; }
+            if ($private_idl_headers{$name}) { push @{${$make}{"=SRCDIR_INCLUDES"}}, $name; }
             elsif ($name =~ /\.h$/) { push @{${$make}{"=HEADER_SRCS"}}, $name; }
             elsif ($name =~ /\.x$/) { push @{${$make}{"=XTEMPLATE_SRCS"}}, $name; }
             elsif ($name =~ /\.rh$/) { push @{${$make}{"=HEADER_SRCS"}}, $name; }
             elsif ($name =~ /\.inl$/) { push @{${$make}{"=HEADER_SRCS"}}, $name; }
-            elsif ($name =~ /\.idl$/) { push @{${$make}{"=PUBLIC_IDL_H_SRCS"}}, $name; }
+            elsif ($name =~ /\.idl$/) { push @{${$make}{"=IDL_SRCS"}}, $name; }
             else { die "unknown file $name in include dir"; }
         }
         else
@@ -432,12 +431,6 @@ sub assign_sources_to_makefiles(@)
         }
     }
 
-    # add extra variables to include source list
-    my $make = $makefiles{"include/Makefile"};
-    unshift @{${$make}{"=SRCDIR_INCLUDES"}}, "\$(PUBLIC_IDL_H_SRCS)";
-    unshift @{${$make}{"=SRCDIR_INCLUDES"}}, "\$(IDL_TLB_SRCS)";
-    unshift @{${$make}{"=IDL_SRCS"}}, "\$(IDL_H_SRCS) \$(IDL_TLB_SRCS)";
-
     # preserve shared source files from the parent makefile
     foreach my $file (@makefiles)
     {
@@ -556,9 +549,6 @@ sub update_makefiles(@)
         replace_makefile_variable( $file, "IMPLIB_SRCS" );
         replace_makefile_variable( $file, "MANPAGES" );
         next unless $file eq "include/Makefile";
-        replace_makefile_variable( $file, "PRIVATE_IDL_H_SRCS" );
-        replace_makefile_variable( $file, "PUBLIC_IDL_H_SRCS" );
-        replace_makefile_variable( $file, "IDL_TLB_SRCS" );
         replace_makefile_variable( $file, "SRCDIR_INCLUDES" );
     }
 
diff --git a/tools/makedep.c b/tools/makedep.c
index d2d39a6..9ea3fb6 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -1702,6 +1702,10 @@ static void add_generated_sources( struct makefile *make )
         {
             add_generated_source( make, replace_extension( source->name, ".idl", "_r.res" ), NULL );
         }
+        if (!source->file->flags && strendswith( source->name, ".idl" ))
+        {
+            add_generated_source( make, replace_extension( source->name, ".idl", ".h" ), NULL );
+        }
         if (strendswith( source->name, ".x" ))
         {
             add_generated_source( make, replace_extension( source->name, ".x", ".h" ), NULL );
@@ -2035,8 +2039,8 @@ static struct strarray output_sources( struct makefile *make, struct strarray *t
             struct strarray targets = empty_strarray;
             char *dest;
 
-            if (!source->file->flags || find_include_file( make, strmake( "%s.h", obj )))
-                source->file->flags |= FLAG_IDL_HEADER;
+            if (!source->file->flags) source->file->flags |= FLAG_IDL_HEADER | FLAG_INSTALL;
+            if (find_include_file( make, strmake( "%s.h", obj ))) source->file->flags |= FLAG_IDL_HEADER;
 
             for (i = 0; i < sizeof(idl_outputs) / sizeof(idl_outputs[0]); i++)
             {
@@ -2046,6 +2050,19 @@ static struct strarray output_sources( struct makefile *make, struct strarray *t
                 strarray_add( &targets, dest );
             }
             if (source->file->flags & FLAG_IDL_PROXY) strarray_add( &dlldata_files, source->name );
+            if (source->file->flags & FLAG_INSTALL)
+            {
+                strarray_add( &make->install_dev_rules, xstrdup( source->filename ));
+                strarray_add( &make->install_dev_rules,
+                              strmake( "D$(includedir)/%s.idl", get_include_install_path( obj ) ));
+                if (source->file->flags & FLAG_IDL_HEADER)
+                {
+                    strarray_add( &make->install_dev_rules, strmake( "%s.h", obj ));
+                    strarray_add( &make->install_dev_rules,
+                                  strmake( "d$(includedir)/%s.h", get_include_install_path( obj ) ));
+                }
+            }
+            if (!targets.count) continue;
             output_filenames_obj_dir( make, targets );
             output( ": %s\n", tools_path( make, "widl" ));
             output( "\t%s -o $@", tools_path( make, "widl" ) );




More information about the wine-cvs mailing list