mozilla

Revision 186657 of Installing headers using EXPORTS

  • Revision slug: Installing_headers_using_EXPORTS
  • Revision title: Installing headers using EXPORTS
  • Revision id: 186657
  • Created:
  • Creator: BenjaminSmedberg
  • Is current revision? No
  • Comment

Revision Content

Public headers and IDL files are copied during the export phase of the build. This is accomplished by setting make variables telling the build system which module the headers are for (since headers are organized by module under dist/include), and which headers need to be created from IDL files by xpidl.

For all Makefile.in's which export public headers, you should set MODULE to the module name where the files should be copied to in dist/include.

For normal headers that are to be exported, you should set EXPORTS to the list of headers to be exported. They will be copied to <tt>dist/include/$(MODULE)</tt>.

For XPIDL-generated headerrs, you should set XPIDLSRCS to the list of IDL files to export. These IDL files will be copied to dist/idl, and the generated headers will be copied to <tt>dist/include/$(MODULE)</tt>.

For XPIDL-generated headers, you may also set XPIDL_MODULE to determine which typelib file is produced from the IDL files. The distinction between XPIDL_MODULE and MODULE is that each directory with IDL files must have a unique typelib file, but several directories may export headers to the same location. Here is an example <tt>Makefile.in</tt> which has both C++ and IDL headers:

{{wiki.template(':en/Standard_Makefile_Header')}}

MODULE = content
XPIDL_MODULE = content_base

EXPORTS = \
  nsIContent.h \
  nsIDocument.h \
  nsIStyleSheet.h \
  $(NULL)

XPIDLSRCS = \
  nsIContentPolicy.idl \
  nsISelectionController.idl \
  $(NULL)

include $(topsrcdir)/config/rules.mk

Revision Source

<p>Public headers and IDL files are copied during the export phase of the build. This is accomplished by setting make variables telling the build system which <i>module</i> the headers are for (since headers are organized by module under dist/include), and which headers need to be created from IDL files by xpidl.
</p><p>For all Makefile.in's which export public headers, you should set <code><a href="en/MODULE">MODULE</a></code> to the module name where the files should be copied to in dist/include.
</p><p>For normal headers that are to be exported, you should set <code><a href="en/EXPORTS">EXPORTS</a></code> to the list of headers to be exported. They will be copied to <tt>dist/include/$(MODULE)</tt>.
</p><p>For XPIDL-generated headerrs, you should set <code><a href="en/XPIDLSRCS">XPIDLSRCS</a></code> to the list of IDL files to export. These IDL files will be copied to dist/idl, and the generated headers will be copied to <tt>dist/include/$(MODULE)</tt>.
</p><p>For XPIDL-generated headers, you may also set <code><a href="en/XPIDL_MODULE">XPIDL_MODULE</a></code> to determine which <i>typelib</i> file is produced from the IDL files. The distinction between <code><a href="en/XPIDL_MODULE">XPIDL_MODULE</a></code> and <code><a href="en/MODULE">MODULE</a></code> is that each directory with IDL files <b>must</b> have a unique typelib file, but several directories may export headers to the same location. Here is an example <tt>Makefile.in</tt> which has both C++ and IDL headers:
</p><p>{{wiki.template(':en/Standard_Makefile_Header')}}
</p>
<pre class="eval"><a href="en/MODULE">MODULE</a> = content
<a href="en/XPIDL_MODULE">XPIDL_MODULE</a> = content_base

<a href="en/EXPORTS">EXPORTS</a> = \
  nsIContent.h \
  nsIDocument.h \
  nsIStyleSheet.h \
  $(NULL)

<a href="en/XPIDLSRCS">XPIDLSRCS</a> = \
  nsIContentPolicy.idl \
  nsISelectionController.idl \
  $(NULL)

include $(topsrcdir)/config/rules.mk
</pre>
Revert to this revision