README revision 606
efafbd2aa55b834f714882683fa864a0ac9e64aaTom RumseyThis is documentation of the Makefile system used in this tree.
efafbd2aa55b834f714882683fa864a0ac9e64aaTom RumseyGeneral Overview:
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumsey-----------------
efafbd2aa55b834f714882683fa864a0ac9e64aaTom RumseyThis tree builds dozens of open source modules that are each released
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumseyseparately and delivered as source in seperate tarballs. These modules
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumseyare organized in subdirectories based on the X.Org module list, though
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumseymodules from other sources are included as appropriate. For instance,
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumseythe application xterm is built in open-src/app/xterm, while the fontconfig
efafbd2aa55b834f714882683fa864a0ac9e64aaTom RumseyIn this tree, the term "module" is used for a specific set of source built
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumseygenerally from a single tarball from upstream, such as xterm or fontconfig.
efafbd2aa55b834f714882683fa864a0ac9e64aaTom RumseyThe directories grouping these together are referred to as "module type"
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumseydirectories - app, lib, font, etc. Each module is thus found in a
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumseysubdirectory of the form open-src/<module type>/<module> . Various flags
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumseycan be set at either the individual module level or for all modules of a
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom RumseyFor each module, at build time the tarball is unpacked, patches applied for
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom Rumseypost-release bug fixes or customizations, and then the build is run.
efafbd2aa55b834f714882683fa864a0ac9e64aaTom RumseyTo allow building both 32-bit and 64-bit versions in the same build,
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumseythis all happens in subdirectories named build_32 & build_64 in each
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom Rumseymodules' directory. Since those subdirectories are competely recreatable
8367f835047e57c70a508975d020905f0173f51aTom Rumseyfrom the source tarball and patches, rebuilding the tree or running make clean
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumseysimply removes them entirely and recreates them.
efafbd2aa55b834f714882683fa864a0ac9e64aaTom RumseyYou should be able to run make commands in any module directory or
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumseymodule-type directory, though since most of the intermodule dependencies
e5376708c3eed4e7bde42fa8d7fb20cf76d47861Tom Rumseyare not declared, many modules will break unless you've done a full-tree
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumseybuild at some point to populate the proto area with the bits needed.
8367f835047e57c70a508975d020905f0173f51aTom Rumsey=============================================================================
efafbd2aa55b834f714882683fa864a0ac9e64aaTom RumseyMake targets you can build in each module:
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumsey------------------------------------------
e5376708c3eed4e7bde42fa8d7fb20cf76d47861Tom RumseyFor most of these you can append _32 or _64 to do just the 32-bit or 64-bit
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumseyversions of the targets, while the version listed here repeats for all build
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumseytypes set in the BUILD_TYPES variable. These are defined in the
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumseyopen-src/common/Makefile.inc file, though open-src/<module type>/Makefile.inc
8367f835047e57c70a508975d020905f0173f51aTom Rumseymay add additional rules needed for modules of that type.
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumsey Completely removes build_* directories.
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumsey Creates build_* directories by unpacking sources from tarball
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumsey and applying patches.
e5376708c3eed4e7bde42fa8d7fb20cf76d47861Tom Rumseymake configure
e5376708c3eed4e7bde42fa8d7fb20cf76d47861Tom Rumsey Runs GNU autoconf script or similar configuration steps if
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumsey needed, including autoreconf or delibtoolize if variables are set.
e5376708c3eed4e7bde42fa8d7fb20cf76d47861Tom Rumsey (Runs make source first if needed.)
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom Rumsey Compile the software into the binaries that get installed.
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom Rumsey (Runs make configure first if needed.)
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom Rumsey Install files into the proto area where make_release_packages
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom Rumsey will pull them from to make packages and where other parts of
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom Rumsey the build will use them. (Runs make build first if needed.)
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom Rumseymake all (or just "make" with no arguments)
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumsey equivalent to make build for most modules
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumsey same as make all, but with compiler optimization flags changed
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumsey to "-g". (Note that if you haven't done a make clean first,
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom Rumsey doesn't force a recompile, so running make debug in a directory
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumsey you already built non-debug may not actually build debug versions.)
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumseymake debug-install
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumsey same as make install, but with compiler optimization flags changed
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom Rumsey to "-g". (See warning on make debug about doing a make clean first.)
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom Rumseymake download
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom Rumsey If open-src/tarballs does not contain the tarball needed for this
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumsey module, download it from $(SOURCE_URL). (See "Building from git"
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumsey section below if MODULE_VERSION=git.)
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumseymake regen-patches
8367f835047e57c70a508975d020905f0173f51aTom Rumsey Create a directory new/ containing patches generated against the
8367f835047e57c70a508975d020905f0173f51aTom Rumsey current tarball. Useful when updating to a new version and patches
8367f835047e57c70a508975d020905f0173f51aTom Rumsey still apply, but you want to get rid of warnings about patch fuzz
8367f835047e57c70a508975d020905f0173f51aTom Rumsey and line offsets.
8367f835047e57c70a508975d020905f0173f51aTom Rumseymake git-update
8367f835047e57c70a508975d020905f0173f51aTom Rumsey See "Building from git" section below.
8367f835047e57c70a508975d020905f0173f51aTom Rumsey=============================================================================
8367f835047e57c70a508975d020905f0173f51aTom RumseyMake targets you can build in parent directories:
8367f835047e57c70a508975d020905f0173f51aTom Rumsey-------------------------------------------------
8367f835047e57c70a508975d020905f0173f51aTom RumseyIn the top-level open-src directory, or any of the module type directories,
8367f835047e57c70a508975d020905f0173f51aTom Rumseyyou can run these make commands to run the appropriate targets for all modules
8367f835047e57c70a508975d020905f0173f51aTom Rumseyin that directory. The Makefiles at each level all include the same rules
8367f835047e57c70a508975d020905f0173f51aTom Rumseyfrom open-src/common/Makefile.subdirs to define these.
8367f835047e57c70a508975d020905f0173f51aTom Rumsey Run make all in all subdirectories.
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumsey Run make clean in all subdirectories.
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumsey Run make clean in all subdirectories, then make all in all subdirs.
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumsey Run make install in all subdirectories.
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumseymake download
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumsey Run make download in all subdirectories.
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumsey Run make source in all subdirectories.
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumseymake git-update
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumsey Run make git-update in all subdirectories.
8367f835047e57c70a508975d020905f0173f51aTom Rumseymake debug-build
8367f835047e57c70a508975d020905f0173f51aTom Rumsey Run make debug-build in all subdirectories.
8367f835047e57c70a508975d020905f0173f51aTom Rumseymake debug-install
8367f835047e57c70a508975d020905f0173f51aTom Rumsey Run make debug-install in all subdirectories.
8367f835047e57c70a508975d020905f0173f51aTom Rumsey=============================================================================
8367f835047e57c70a508975d020905f0173f51aTom RumseyVariables that can be set in the Makefile for each module:
8367f835047e57c70a508975d020905f0173f51aTom Rumsey----------------------------------------------------------
efafbd2aa55b834f714882683fa864a0ac9e64aaTom RumseyRequired for all modules:
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom Rumsey - Name of the module being built - usually the same as the name of the
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom Rumsey directory it's being built in and the tarball used for the sources.
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom RumseyMODULE_VERSION
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom Rumsey - Version of the source to use, used by default in the tarball name and
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom Rumsey source directory unpacked from it.
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom Rumsey - Special values:
e5376708c3eed4e7bde42fa8d7fb20cf76d47861Tom Rumsey "git" - see "Building from git" below
e5376708c3eed4e7bde42fa8d7fb20cf76d47861Tom Rumsey "src" - used when there is no upstream tarball, only local sources
e5376708c3eed4e7bde42fa8d7fb20cf76d47861Tom Rumsey "NONE" - used when no build_* directories are created
e5376708c3eed4e7bde42fa8d7fb20cf76d47861Tom RumseyRequired for some modules:
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom Rumsey - Package name that this module is shipped in, to list in attributes section
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom Rumsey * Required if SUNTOUCHED_MANPAGES is not empty
c00a5587d32883c0f366fd6c47c3e674dad9dba7Tom RumseyMODULE_STABILITY
efafbd2aa55b834f714882683fa864a0ac9e64aaTom Rumsey - Interface Stability to list in attributes section of man page
man page conventions to, via the open-src/common/suntouch-manpages.pl
- Additional flags to pass to open-src/common/suntouch-manpages.pl, such as
- Names of pkgconfig .pc or .pc.in files in the module, which will be
unnecessary Requires.privates lines from.
- Makefile targets/rules that the default_* rules list as dependencies
- Additional targets/rules run by "make source", "make configure", etc.
running configure, to regenerate autoconf/automake/libtool created
open-src/common/delibtoolize.pl to remove libtool calls from Makefiles
libtool/compiler etc. Used by default_build & default_install rules.
for use by include statements in package copyright.add files, where
Makefile.inc is included to prevent the default from being set. For
SOURCE_URL=http://fontconfig.org/release/$(SOURCE_TARBALL_NAME)
Default: $(DEFAULT_COMPILER) setting in common/Makefile.init,
Default: $(X11_DIR) (aka /usr/X11).
- Name of tarball file under open-src/tarballs directory for this module.
Default: $(SOURCE_DIRNAME).tar.bz2
- For X.Org sources, what directory the source tarball & git repo is in
on freedesktop.org - usually the same as the module type directory in
the binaries built (32 and/or 64), but may be set to any string if other
- Makefile targets/rules to run for "make source", "make configure",
and/or MODULE_ADD_*_TARGETS variables.
for use by include statements in package copyright.add files, where
Variables that can be set in the Makefile.inc for each module type:
open-src/<module_type>/Makefile.inc - they have the same meanings and uses
directory for the module type in X.Org's source trees.
open-src/common/Makefile.init defines $MACH to be either sparc or i386
on x86/x64, you can do:
Variables you may want to customize for your site/tree:
XORG_RELEASES_URL & SF_DOWNLOADS_URL (set in open-src/common/Makefile.init)
- urls for X.Org & sourceforge mirrors to download tarballs from
FDO_GIT_URL (set in open-src/common/Makefile.init)
- url for git repositories hosted on freedesktop.org, including
X.Org, Mesa, pixman, etc. - defaults to anonymous git over http, can
Some tools to ease development are available in the util/build-tools
find-build-errors - looks for a log/buildit-XW file (or another file you
a X.org release still in development, you can choose to to check out a
- Setting up proper parallel make rules so that multi-core/cpu
makefiles - you can't bringover the tree and just cd open-src/xserver/xorg
dependencies will probably take a while - getting them done for xserver/xorg
distribute, and/or sell copies of the Software, and to permit persons