Makefile.inc revision 587
0N/A# -*- Makefile -*- rules commonly shared among X consolidation open source dirs 291N/A# Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. 0N/A# Use subject to license terms. 0N/A# Permission is hereby granted, free of charge, to any person obtaining a 0N/A# copy of this software and associated documentation files (the 0N/A# "Software"), to deal in the Software without restriction, including 0N/A# without limitation the rights to use, copy, modify, merge, publish, 0N/A# distribute, and/or sell copies of the Software, and to permit persons 0N/A# to whom the Software is furnished to do so, provided that the above 0N/A# copyright notice(s) and this permission notice appear in all copies of 0N/A# the Software and that both the above copyright notice(s) and this 0N/A# permission notice appear in supporting documentation. 0N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 0N/A# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 0N/A# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 0N/A# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 0N/A# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL 0N/A# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING 0N/A# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 0N/A# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 0N/A# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 0N/A# Except as contained in this notice, the name of a copyright holder 0N/A# shall not be used in advertising or otherwise to promote the sale, use 0N/A# or other dealings in this Software without prior written authorization 0N/A# of the copyright holder. 587N/A# @(#)Makefile.inc 1.95 08/11/18 493N/A# Which compiler to use to build module 493N/AMODTYPE_COMPILER_DEFAULT = $(MODTYPE_COMPILER_SET:yes=$(POUND_SIGN)) 493N/A$(MODTYPE_COMPILER_DEFAULT) MODTYPE_COMPILER = $(DEFAULT_COMPILER) 493N/AMODULE_COMPILER_DEFAULT = $(MODULE_COMPILER_SET:yes=$(POUND_SIGN)) 493N/A$(MODULE_COMPILER_DEFAULT) MODULE_COMPILER = $(MODTYPE_COMPILER) 493N/A# Which make to use to build module 493N/AMODTYPE_MAKE_DEFAULT = $(MODTYPE_MAKE_SET:yes=$(POUND_SIGN)) 493N/A$(MODTYPE_MAKE_DEFAULT) MODTYPE_MAKE = $(MAKE) 493N/AMODULE_MAKE_DEFAULT = $(MODULE_MAKE_SET:yes=$(POUND_SIGN)) 493N/A$(MODULE_MAKE_DEFAULT) MODULE_MAKE = $(MODTYPE_MAKE) 493N/A# Where to install files 493N/AMODTYPE_PREFIX_DEFAULT = $(MODTYPE_PREFIX_SET:yes=$(POUND_SIGN)) 493N/A$(MODULE_PREFIX_DEFAULT) MODTYPE_PREFIX=$(X11_DIR) 493N/AMODULE_PREFIX_DEFAULT = $(MODULE_PREFIX_SET:yes=$(POUND_SIGN)) 493N/A$(MODULE_PREFIX_DEFAULT) MODULE_PREFIX=$(MODTYPE_PREFIX) 493N/A# Directory created by unpacking source, if not set in module makefile 493N/ASOURCE_DIRNAME_DEFAULT = $(SOURCE_DIRNAME_SET:yes=$(POUND_SIGN)) 493N/A$(SOURCE_DIRNAME_DEFAULT) SOURCE_DIRNAME=$(MODULE_NAME)-$(MODULE_VERSION) 493N/ASOURCE_DIR = $(BUILD_DIR)/$(SOURCE_DIRNAME) 493N/A# Set default tarball if not set in module makefile 493N/ASOURCE_TARBALL_NAME_DEFAULT = $(SOURCE_TARBALL_NAME_SET:yes=$(POUND_SIGN)) 493N/A$(SOURCE_TARBALL_NAME_DEFAULT) SOURCE_TARBALL_NAME=$(SOURCE_DIRNAME).tar.bz2 493N/A# Tarballs for most modules built here are found in the X.Org archives/repos 493N/A# in a directory with the same name as what we use in our tree 493N/ASOURCE_TARBALL_DIR_DEFAULT = $(SOURCE_TARBALL_DIR_SET:yes=$(POUND_SIGN)) 493N/A$(SOURCE_TARBALL_DIR_DEFAULT) SOURCE_TARBALL_DIR=$(MODTYPE) 493N/A# Set default download location if not set in module makefile 493N/ASOURCE_URL_DEFAULT = $(SOURCE_URL_SET:yes=$(POUND_SIGN)) 493N/A$(SOURCE_URL_DEFAULT) SOURCE_URL=$(XORG_RELEASES_URL)/$(SOURCE_TARBALL_DIR)/$(SOURCE_TARBALL_NAME) 493N/A# Set default git repo location if not set in module makefile 493N/AGIT_URL_DEFAULT = $(GIT_URL_SET:yes=$(POUND_SIGN)) 493N/A$(GIT_URL_DEFAULT) GIT_URL=$(XORG_GIT_URL)/$(SOURCE_TARBALL_DIR)/$(MODULE_NAME).git 0N/ABUILD_DIR_32 = build_32 0N/ABUILD_DIR_64 = build_64 156N/A# Set default build type to 32-bit if not set in module makefile 156N/ABUILD_TYPES_DEFAULT = $(BUILD_TYPES_SET:yes=$(POUND_SIGN)) 156N/A$(BUILD_TYPES_DEFAULT) BUILD_TYPES=32 493N/A# Set default rules if not set in module/modtype Makefile 493N/ASOURCE_TARGETS_DEFAULT = $(SOURCE_TARGETS_SET:yes=$(POUND_SIGN)) 493N/A$(SOURCE_TARGETS_DEFAULT) SOURCE_TARGETS=default_source 493N/ACONFIGURE_TARGETS_DEFAULT = $(CONFIGURE_TARGETS_SET:yes=$(POUND_SIGN)) 493N/A$(CONFIGURE_TARGETS_DEFAULT) CONFIGURE_TARGETS=default_configure 493N/ABUILD_TARGETS_DEFAULT = $(BUILD_TARGETS_SET:yes=$(POUND_SIGN)) 493N/A$(BUILD_TARGETS_DEFAULT) BUILD_TARGETS=default_build 493N/AINSTALL_TARGETS_DEFAULT = $(INSTALL_TARGETS_SET:yes=$(POUND_SIGN)) 493N/A$(INSTALL_TARGETS_DEFAULT) INSTALL_TARGETS=default_install 493N/A# Additional flags to pass to make in 32-bit & 64-bit builds 493N/ABUILD_32_FLAGS= BUILD_DIR=$(BUILD_DIR_32) ARCH_FLAGS="$(ARCH32_FLAGS)" \ 493N/ABUILD_64_FLAGS= BUILD_DIR=$(BUILD_DIR_64) ARCH_FLAGS="$(ARCH64_FLAGS)" \ 0N/Aall: $(BUILD_TYPES:%=source_%) $(BUILD_TYPES:%=build_%) 493N/Aall_32: source_32 configure_32 build_32 493N/Aall_64: source_64 configure_64 build_64 493N/Aclean:: $(BUILD_TYPES:%=clean_%) 493N/Asource: $(BUILD_TYPES:%=source_%) 493N/Asource_gen:: $(SOURCE_TARGETS) 493N/Asource_32: $(BUILD_DIR_32)/.unpack_done 493N/A$(BUILD_DIR_32)/.unpack_done: 493N/Asource_64: $(BUILD_DIR_64)/.unpack_done 493N/A$(BUILD_DIR_64)/.unpack_done: 493N/Aconfigure: $(BUILD_TYPES:%=configure_%) 493N/Aconfigure_gen: $(CONFIGURE_TARGETS) 493N/Abuild: $(BUILD_TYPES:%=build_%) 0N/Abuild_gen: $(BUILD_TARGETS) 493N/Ainstall: $(BUILD_TYPES:%=install_%) 493N/Ainstall_gen:: $(INSTALL_TARGETS) install_license 90N/Ainstall_32:: build_32 90N/Ainstall_64:: build_64 493N/ADEBUG_BUILD_FLAGS = BUILD_DEBUG=yes 493N/A### Source tarballs & downloading if necessary 493N/ASOURCE_TARBALL=$(TARBALLDIR)/$(SOURCE_TARBALL_NAME) 493N/AGIT_CLONE_DIR=$(MODULE_NAME)-$(MODULE_VERSION) 493N/A# Download if SOURCE_TARBALL_NAME is not set to NONE and the file either 493N/A# doesn't exist or is empty 493N/A# If MODULE_VERSION is xgit, checkout source from git repo instead of 493N/A if [[
"$(MODULE_VERSION)" =
"git" ]] ;
then \
493N/A if [[
! -d $(GIT_CLONE_DIR) ]] ; then \ 493N/A if [[
! -z "$(GIT_BRANCH)" ]] ; then \ 493N/A if [[
"$(SOURCE_TARBALL_NAME)" != "NONE" ]] ; then \ 493N/A if [[
! -s $(SOURCE_TARBALL) ]] ; then \ 493N/A# Update a git cloned repo 493N/A if [[
"$(MODULE_VERSION)" =
"git" ]] ;
then \
493N/A if [[
! -z "$(GIT_BRANCH)" ]] ; then \ 0N/A### Unpack source and apply patches 90N/A -e
's|-L\$${libdir}|-L\$${libdir} -R\$${libdir}|;' \
90N/A -e
's|Requires.private: .*$$||;' 354N/A# -e 's|(Requires: .*)\bx11\b|$$1|;' \ 90N/A# -e 's|^prefix=@prefix@|prefix=\$$\{top_builddir\}@prefix@|' 493N/A -a
'{Availability, $(SUN_PACKAGE)}' \
493N/A -a
'{Interface Stability, $(MODULE_STABILITY)}' \
493N/Adefault_source: $(MODULE_SOURCE_DEPS) $(MODTYPE_SOURCE_DEPS) 493N/A @
if [[
"$(SOURCE_TARBALL_NAME)" != "NONE" ]] ; then \ 493N/A if [[
"$(MODULE_VERSION)" =
"git" ]] ;
then \
493N/A print "$${SOURCE_CMD} | (cd $(BUILD_DIR) ; gtar -xf - )" ; \
493N/A print "mkdir -p $(SOURCE_DIR)" ; \
493N/A if [[
"$(ADDITIONAL_SOURCE_DIR)" != "" ]] ; then \ 493N/A if [[
! -x $(LNDIR) ]] ; then \ 493N/A print "cd $(SOURCE_DIR) && $(LNDIR) ../../$(ADDITIONAL_SOURCE_DIR)" ; \
493N/A if [[
"$(SOURCE_PATCHES)" != "" ]] ; then \ 493N/A if [[
"$$p" != "x" ]] ; then \ 493N/A print "$${PATCH_CMD}" ; \
493N/A if [[
"$(SUNTOUCHED_MANPAGES)" != "" ]] ; then \ 40N/A $(SUNTOUCH_MAN_FLAGS) $(SUNTOUCHED_MANPAGES)" ; \
493N/A if [[
"$(FIX_PC_FILES)" != "" ]] ; then \ 90N/A $(FIX_PC_OPS) $(FIX_PC_FILES)" ; \
493N/A### Run configure scripts 191N/A# Include Xorg autoconf macros when rebuilding configure scripts 493N/AACLOCAL_PATH=aclocal -I $(PROTODIR)$(X11_ACLOCAL_DIR) 493N/A# Dependencies for running configure to make a Makefile 493N/ACONFIGURE_DEPS = $(UNPACK_TARGET) \ 493N/A# Command line options to GNU autoconf configure script 493N/ADEFAULT_CONFIG_OPTS = --prefix=$(MODULE_PREFIX) \ 493N/ACONFIG_OPTS = $(DEFAULT_CONFIG_OPTS) \ 493N/A# Environment variable options to GNU autoconf configure script 493N/A$(USE_DEFAULT_CONFIG_CPPFLAGS:no=$(POUND_SIGN)) DEFAULT_CONFIG_CPPFLAGS= \ 493N/A$(USE_DEFAULT_CONFIG_LDFLAGS:no=$(POUND_SIGN)) DEFAULT_CONFIG_LDFLAGS= \ 561N/ADEFAULT_PKG_CONFIG_PATH=$(TOP)/common/pc-files/$(BUILD_DIR):$(PROTODIR)/usr/lib/$(ARCHLIBSUBDIR)/pkgconfig:/usr/lib$(ARCHLIBSUBDIR)/pkgconfig 493N/A# Set USE_DEFAULT_CONFIG_ENV=no in a Makefile to not use this default 493N/A# autoconfig environment 493N/A$(USE_DEFAULT_CONFIG_ENV:no=$(POUND_SIGN)) DEFAULT_CONFIG_ENV = \ 493N/A CPPFLAGS=
"$(DEFAULT_CONFIG_CPPFLAGS) $(MODTYPE_CPPFLAGS) $(MODULE_CPPFLAGS)" \
493N/A LDFLAGS=
"$(DEFAULT_CONFIG_LDFLAGS) $(MODTYPE_CFLAGS) $(MODTYPE_LDFLAGS) $(MODULE_CFLAGS) $(MODULE_LDFLAGS)" \
493N/ACONFIG_ENV = $(DEFAULT_CONFIG_ENV) $(MODTYPE_CONFIG_ENV) $(MODULE_CONFIG_ENV) 493N/A# File created by running configure - defaults to the top-level Makefile 493N/A# in a source directory unless AUTOCONF_TARGET_SET=yes is set 493N/AAUTOCONF_TARGET_DEFAULT = $(AUTOCONF_TARGET_SET:yes=$(POUND_SIGN)) 493N/A$(AUTOCONF_TARGET_DEFAULT) AUTOCONF_TARGET=$(SOURCE_DIR)/Makefile 493N/A$(AUTOCONF_TARGET): $(CONFIGURE_DEPS) 493N/A if [[
"$(AUTORECONF)" =
"yes" ]] ;
then \
493N/A if [[
"$(DELIBTOOLIZE)" =
"yes" ]] ;
then \
493N/Adefault_configure:: $(AUTOCONF_TARGET) 291N/A### Remove libtool from build process when needed 40N/A### Generate mapfiles to limit/version exported symbols in libraries 40N/ASPEC2MAP= /usr/lib/abi/spec2map 40N/ASPECMAP= mapfile.vers.$(LIBNAME) 40N/ASPECFILE= spec/$(LIBNAME).spec 40N/AVERSFILE= spec/versions 40N/A$(BUILD_DIR_32)/$(SPECMAP): $(SPECFILE) $(VERSFILE) 40N/A$(BUILD_DIR_64)/$(SPECMAP): $(SPECFILE) $(VERSFILE) 493N/A### Default rules for common build pattern 493N/ALD_OPTIONS = -L$(PROTODIR)$(X11_DIR)/lib$(LIBSUBDIR) \ 536N/ABUILD_ENV = LD_OPTIONS='$(LD_OPTIONS)' \ 493N/ADEFAULT_BUILD_MAKEFLAGS=$(MODTYPE_MAKEFLAGS) $(MODULE_MAKEFLAGS) \ 493N/Adefault_build:: $(UNPACK_TARGET) $(CONFIGURE_TARGETS) $(MODTYPE_BUILD_DEPS) $(MODULE_BUILD_DEPS) $(MODULE_MAKE) 493N/Aprint_default_build_flags: 493N/A @
print "BUILD_ENV='$(BUILD_ENV)'" ; \
493N/A print "MAKE='$(MODULE_MAKE)'" ; \
493N/A print "MAKE_FLAGS='$(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS)'" 493N/ADEFAULT_INSTALL_MAKEFLAGS= -e DESTDIR=$(PROTODIR) \ 493N/Adefault_install:: $(BUILD_TARGETS) 493N/Aprint_default_install_flags: 493N/A @
print "BUILD_ENV='$(BUILD_ENV)'" ; \
493N/A print "MAKE='$(MODULE_MAKE)'" ; \
493N/A print "MAKE_FLAGS='$(MAKEFLAGS) $(DEFAULT_INSTALL_MAKEFLAGS)'" 493N/A### Other tools/dependencies needed to build 0N/A# Some modules (such as FreeType 2) require GNU make 493N/A @
print -n
"Building with GNU make from $$(whence gmake): " 493N/A @
print "Building with make from $$(whence $(MAKE))" 90N/A# Some modules use lndir to merge in sources from Sun specific directories 493N/A# Some modules use these tools to convert DocBook docs to text or html 493N/A$(DOCBOOK2HTML) $(DOCBOOK2TEXT): 40N/A# Almost everything depends on the headers in xproto 493N/A @
print "$(XPROTO_DEP) not found..." 47N/A### Useful rules for maintaining patch sets 47N/A# regenerate patches against new baseline to reduce messages about hunks 47N/A# having fuzz or offsets when applying patches - new patches will be in new/ 493N/A print '=================' $$p ; \
47N/A /^diff -u/ {exit} \ 47N/A |
sed -e
's% \./prev$(SOURCE_DIR)/% %' -e
's% \./tmp-regen$(SOURCE_DIR)/% %' \
355N/A# Default license file name is COPYING (X.Org & GNU autoconf default) 355N/A# For other license file names, set LICENSE_FILE to the file name 355N/A# and set LICENSE_FILE_SET=yes 387N/A# A file in the same directory as the Makefile takes precedence 387N/A# over one that is delivered in the package. 587N/A# For additional license files, set EXTRA_LICENSE_FILES to a list of 355N/ALICENSE_FILE_DEFAULT = $(LICENSE_FILE_SET:yes=$(POUND_SIGN)) 355N/A$(LICENSE_FILE_DEFAULT) LICENSE_FILE=COPYING 493N/A if [[
"$${LICENSE_TO_COPY}" != "" ]] ; then \ 587N/A if [[
"$(EXTRA_LICENSES)" != "" ]] ; then \