Skip to content

Commit 6ed3c5f

Browse files
committed
Document support for VPATH builds of extensions.
Cédric Villemain and me.
1 parent d648af0 commit 6ed3c5f

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

doc/src/sgml/extend.sgml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ include $(PGXS)
928928
To use the <acronym>PGXS</acronym> infrastructure for your extension,
929929
you must write a simple makefile.
930930
In the makefile, you need to set some variables
931-
and finally include the global <acronym>PGXS</acronym> makefile.
931+
and include the global <acronym>PGXS</acronym> makefile.
932932
Here is an example that builds an extension module named
933933
<literal>isbn_issn</literal>, consisting of a shared library containing
934934
some C code, an extension control file, a SQL script, and a documentation
@@ -1164,6 +1164,33 @@ include $(PGXS)
11641164
</para>
11651165
</caution>
11661166

1167+
<para>
1168+
You can also run <literal>make</literal> in a directory outside the source
1169+
tree of your extension, if you want to keep the build directory separate.
1170+
This procedure is also called a
1171+
<indexterm><primary>VPATH</primary></indexterm><firstterm>VPATH</firstterm>
1172+
build. Here's how:
1173+
<screen>
1174+
<userinput>mkdir build_dir</userinput>
1175+
<userinput>cd build_dir</userinput>
1176+
<userinput>make -f /path/to/extension/source/tree/Makefile</userinput>
1177+
<userinput>make -f /path/to/extension/source/tree/Makefile install</userinput>
1178+
</screen>
1179+
</para>
1180+
1181+
<para>
1182+
Alternatively, you can set up a directory for a VPATH build in a similar
1183+
way to how it is done for the core code. One way to to this is using the
1184+
core script <filename>config/prep_buildtree</>. Once this has been done
1185+
you can build by setting the <literal>make</literal> variable
1186+
<varname>USE_VPATH</varname> like this:
1187+
<screen>
1188+
<userinput>make USE_VPATH=/path/to/extension/source/tree</userinput>
1189+
<userinput>make USE_VPATH=/path/to/extension/source/tree install</userinput>
1190+
</screen>
1191+
This procedure can work with a greater variety of directory layouts.
1192+
</para>
1193+
11671194
<para>
11681195
The scripts listed in the <varname>REGRESS</> variable are used for
11691196
regression testing of your module, which can be invoked by <literal>make

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy