@@ -935,7 +935,7 @@ include $(PGXS)
935935 To use the <acronym>PGXS</acronym> infrastructure for your extension,
936936 you must write a simple makefile.
937937 In the makefile, you need to set some variables
938- and finally include the global <acronym>PGXS</acronym> makefile.
938+ and include the global <acronym>PGXS</acronym> makefile.
939939 Here is an example that builds an extension module named
940940 <literal>isbn_issn</literal>, consisting of a shared library containing
941941 some C code, an extension control file, a SQL script, and a documentation
@@ -1171,6 +1171,33 @@ include $(PGXS)
11711171 </para>
11721172 </caution>
11731173
1174+ <para>
1175+ You can also run <literal>make</literal> in a directory outside the source
1176+ tree of your extension, if you want to keep the build directory separate.
1177+ This procedure is also called a
1178+ <indexterm><primary>VPATH</primary></indexterm><firstterm>VPATH</firstterm>
1179+ build. Here's how:
1180+ <screen>
1181+ <userinput>mkdir build_dir</userinput>
1182+ <userinput>cd build_dir</userinput>
1183+ <userinput>make -f /path/to/extension/source/tree/Makefile</userinput>
1184+ <userinput>make -f /path/to/extension/source/tree/Makefile install</userinput>
1185+ </screen>
1186+ </para>
1187+
1188+ <para>
1189+ Alternatively, you can set up a directory for a VPATH build in a similar
1190+ way to how it is done for the core code. One way to to this is using the
1191+ core script <filename>config/prep_buildtree</>. Once this has been done
1192+ you can build by setting the <literal>make</literal> variable
1193+ <varname>USE_VPATH</varname> like this:
1194+ <screen>
1195+ <userinput>make USE_VPATH=/path/to/extension/source/tree</userinput>
1196+ <userinput>make USE_VPATH=/path/to/extension/source/tree install</userinput>
1197+ </screen>
1198+ This procedure can work with a greater variety of directory layouts.
1199+ </para>
1200+
11741201 <para>
11751202 The scripts listed in the <varname>REGRESS</> variable are used for
11761203 regression testing of your module, which can be invoked by <literal>make
0 commit comments