Next: , Previous: , Up: Anatomy of a GSRC Makefile   [Contents]


A.2.2 Build variables

The second section of a GSRC Makefile holds variable definitions that are used in the build process. When possible, it is preferable to use the metadata variables in the build variable definitions, to minimize the number of items that need to be modified should anything change.

Variable nameDescription
MASTER_SITESThis variable defines the top-level URL from where the package files should be retrieved. Many URLs are already defined in variables in the file gar.master.mk. Most GNU packages are retrievable from http://ftp.gnu.org/gnu, which is assigned to the variable MASTER_GNU in gar.master.mk, so for a GNU package, MASTER_SITES would be set to $(MASTER_GNU). Multiple sites may be listed; attempts to download a files will proceed for each site listed until one succeeds.
MASTER_SUBDIRThis is the directory of the master site under which the package files can be found. For most GNU packages, this can simply be $(GARNAME)/.
DISTFILE_SITESThis variable contains URL(s) from which source distribution archives only are to be downloaded.
DISTFILE_SUBDIRThis variable contains the sub-directory of DISTFILE_SITES where the source distributions can be found.
SIGFILE_SITESThis variable contains URL(s) from which signature files only are to be downloaded.
SIGFILE_SUBDIRThis variable contains the sub-directory of SIGFILE_SITES where the signature files can be found.
PATCHFILE_SITESThis variable contains URL(s) from which patch files only are to be downloaded.
PATCHFILE_SUBDIRThis variable contains the sub-directory of DISTFILE_SITES where the source distributions can be found.
FILE_SITESThis variable lists file URIs where files can be found locally. By default this contains the files sub-directory of the package’s GSRC directory and the location specified by the variable GARCHIVEDIR. Note that these URIs should be prefaced with “file://”.
DISTFILESThis variable contains a space-separated list of all of the source distribution archives to be fetched.
SIGFILESThis variable contains a space-separated list of all the signature files to fetch.
PATCHFILESThis variable contains a space-separated list of all the patch files to fetch.
WORKSRCThis variable contains the name of the directory where all of the work should take place. Its default value is $(WORKDIR)/$(DISTNAME), which should be sufficient for most cases, so it is normally not necessary to set this variable. If, however, the package’s source archive extracts to a directory with some other name, you should set it here. This should always begin with $(WORKDIR), which by default is the work subdirectory of the GSRC package’s sub-directory.
WORKOBJThis variable defines the location where the build process should take place. Normally, and by default, this is the same as WORKSRC, however some packages recommend building in a directory separate from the location of the source code.
CONFIGURE_SCRIPTSThis variable contains a list of the scripts or files that need to be run during the configuration step of the build process. Phony targets may also be included.
BUILD_SCRIPTSThis variable contains a list of the scripts or files that need to be run during the build step of the build process. Phony targets may also be included.
INSTALL_SCRIPTSThis variable contains a list of the scripts or files that need to be run during the install step of the build process. Phony targets may also be included.
INFO_FILESThis variable contains a list of all of the Info documentation files installed by a program. To use this variable, you must include the info.mk file from the gar.lib directory. If this variable is not defined and info.mk is included, then it will have a default value of $(GARNAME).info
BUILDDEPSThis variable contains a space-separated list of the programs required to build the package, using their GARNAMEs.
LIBDEPSThis variable is slightly a misnomer. It is a space-separated list of all the programs and/or libraries required at run-time by the package.

Next: , Previous: , Up: Anatomy of a GSRC Makefile   [Contents]