Installing headers using EXPORTS

  • Revision slug: Installing_headers_using_EXPORTS
  • Revision title: Installing headers using EXPORTS
  • Revision id: 186661
  • Created:
  • Creator: Benjamin Smedberg
  • Is current revision? No
  • Comment They aren't C headers!

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 <tt>dist/include</tt>), and which headers need to be created from IDL files by xpidl.

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

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 headers, you should set XPIDLSRCS to the list of IDL files to export. These IDL files will be copied to <tt>dist/idl</tt>, 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:

{{ :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 <tt>dist/include</tt>), and which headers need to be created from IDL files by <a href="en/Xpidl">xpidl</a>.
</p><p>For all <tt>Makefile.in</tt>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 <tt>dist/include</tt>.
</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 headers, 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 <tt>dist/idl</tt>, 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>{{ :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