Makefile.inc revision 587
0N/A# -*- Makefile -*- rules commonly shared among X consolidation open source dirs
0N/A#
291N/A# Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
0N/A# Use subject to license terms.
0N/A#
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#
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#
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.
0N/A#
587N/A# @(#)Makefile.inc 1.95 08/11/18
0N/A#
0N/A
493N/A### Default rules
156N/A
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)
0N/A
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)
0N/A
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)
0N/A
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)
0N/A
493N/ASOURCE_DIR = $(BUILD_DIR)/$(SOURCE_DIRNAME)
90N/A
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
90N/A
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)
0N/A
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)
98N/A
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
98N/A
0N/A
0N/ABUILD_DIR_32 = build_32
0N/ABUILD_DIR_64 = build_64
0N/A
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
156N/A
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/A
493N/ACONFIGURE_TARGETS_DEFAULT = $(CONFIGURE_TARGETS_SET:yes=$(POUND_SIGN))
493N/A$(CONFIGURE_TARGETS_DEFAULT) CONFIGURE_TARGETS=default_configure
493N/A
493N/ABUILD_TARGETS_DEFAULT = $(BUILD_TARGETS_SET:yes=$(POUND_SIGN))
493N/A$(BUILD_TARGETS_DEFAULT) BUILD_TARGETS=default_build
493N/A
493N/AINSTALL_TARGETS_DEFAULT = $(INSTALL_TARGETS_SET:yes=$(POUND_SIGN))
493N/A$(INSTALL_TARGETS_DEFAULT) INSTALL_TARGETS=default_install
493N/A
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/A $(MODTYPE_BUILD_32_FLAGS) $(MODULE_BUILD_32_FLAGS)
493N/A
493N/ABUILD_64_FLAGS= BUILD_DIR=$(BUILD_DIR_64) ARCH_FLAGS="$(ARCH64_FLAGS)" \
493N/A $(MODTYPE_BUILD_64_FLAGS) $(MODULE_BUILD_64_FLAGS)
493N/A
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
0N/A
493N/Aclean:: $(BUILD_TYPES:%=clean_%)
0N/A
0N/Aclean_32::
0N/A -rm -rf $(BUILD_DIR_32)
0N/A
0N/Aclean_64::
0N/A -rm -rf $(BUILD_DIR_64)
0N/A
493N/Asource: $(BUILD_TYPES:%=source_%)
493N/A
493N/Asource_gen:: $(SOURCE_TARGETS)
493N/A
493N/Asource_32: $(BUILD_DIR_32)/.unpack_done
493N/A$(BUILD_DIR_32)/.unpack_done:
493N/A $(MAKE) $(MAKEFLAGS) BUILD_DIR=$(BUILD_DIR_32) source_gen
493N/A
493N/Asource_64: $(BUILD_DIR_64)/.unpack_done
493N/A$(BUILD_DIR_64)/.unpack_done:
493N/A $(MAKE) $(MAKEFLAGS) BUILD_DIR=$(BUILD_DIR_64) source_gen
493N/A
493N/Aconfigure: $(BUILD_TYPES:%=configure_%)
493N/A
493N/Aconfigure_gen: $(CONFIGURE_TARGETS)
493N/A
493N/Aconfigure_32::
493N/A $(MAKE) $(MAKEFLAGS) $(BUILD_32_FLAGS) configure_gen
493N/A
493N/Aconfigure_64::
493N/A $(MAKE) $(MAKEFLAGS) LIBSUBDIR=/$(SUBDIR64) ARCHLIBSUBDIR=/$(SUBDIR64) $(BUILD_64_FLAGS) configure_gen
493N/A
493N/Abuild: $(BUILD_TYPES:%=build_%)
493N/A
0N/Abuild_gen: $(BUILD_TARGETS)
0N/A
0N/Abuild_32::
493N/A $(MAKE) $(MAKEFLAGS) $(BUILD_32_FLAGS) build_gen
0N/A
0N/Abuild_64::
493N/A $(MAKE) $(MAKEFLAGS) LIBSUBDIR=/$(SUBDIR64) ARCHLIBSUBDIR=/$(SUBDIR64) $(BUILD_64_FLAGS) build_gen
0N/A
493N/Ainstall: $(BUILD_TYPES:%=install_%)
493N/A
493N/Ainstall_gen:: $(INSTALL_TARGETS) install_license
355N/A
90N/Ainstall_32:: build_32
493N/A $(MAKE) $(MAKEFLAGS) $(BUILD_32_FLAGS) install_gen
0N/A
90N/Ainstall_64:: build_64
493N/A $(MAKE) $(MAKEFLAGS) LIBSUBDIR=/64 ARCHLIBSUBDIR=/$(SUBDIR64) $(BUILD_64_FLAGS) install_gen
493N/A
493N/ADEBUG_BUILD_FLAGS = BUILD_DEBUG=yes
0N/A
0N/Adebug:
493N/A $(MAKE) $(MAKEFLAGS) all $(DEBUG_BUILD_FLAGS)
493N/A
493N/Adebug_32:
493N/A $(MAKE) $(MAKEFLAGS) all_32 $(DEBUG_BUILD_FLAGS)
493N/A
493N/Adebug_64:
493N/A $(MAKE) $(MAKEFLAGS) all_64 $(DEBUG_BUILD_FLAGS)
493N/A
493N/Adebug-install:
493N/A $(MAKE) $(MAKEFLAGS) install $(DEBUG_BUILD_FLAGS)
493N/A
493N/Adebug-install_32:
493N/A $(MAKE) $(MAKEFLAGS) install_32 $(DEBUG_BUILD_FLAGS)
493N/A
493N/Adebug-install_64:
493N/A $(MAKE) $(MAKEFLAGS) install $(DEBUG_BUILD_FLAGS)
493N/A
493N/A
493N/A### Source tarballs & downloading if necessary
493N/A
493N/ASOURCE_TARBALL=$(TARBALLDIR)/$(SOURCE_TARBALL_NAME)
493N/A
493N/AGIT_CLONE_DIR=$(MODULE_NAME)-$(MODULE_VERSION)
493N/A
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# a tarball
493N/Adownload:
493N/A @case '$(MAKEFLAGS)' in *[ik]*) set +e;; esac; set -x ; \
493N/A if [[ "$(MODULE_VERSION)" = "git" ]] ; then \
493N/A if [[ ! -d $(GIT_CLONE_DIR) ]] ; then \
493N/A $(GIT) clone $(GIT_URL) $(GIT_CLONE_DIR) ; \
493N/A if [[ ! -z "$(GIT_BRANCH)" ]] ; then \
493N/A cd $(GIT_CLONE_DIR) && $(GIT) checkout $(GIT_BRANCH) ; \
493N/A fi ; \
493N/A fi ; \
493N/A else \
493N/A if [[ "$(SOURCE_TARBALL_NAME)" != "NONE" ]] ; then \
493N/A if [[ ! -s $(SOURCE_TARBALL) ]] ; then \
493N/A $(WGET) -O $(SOURCE_TARBALL) $(SOURCE_URL) ; \
493N/A fi ; \
493N/A fi ; \
493N/A fi
493N/A
493N/A# Update a git cloned repo
493N/Agit-update:
493N/A if [[ "$(MODULE_VERSION)" = "git" ]] ; then \
493N/A if [[ -d $(GIT_CLONE_DIR) ]] ; then \
493N/A cd $(GIT_CLONE_DIR) ; \
493N/A if [[ ! -z "$(GIT_BRANCH)" ]] ; then \
493N/A $(GIT) checkout master && \
493N/A $(GIT) fetch && \
493N/A $(GIT) checkout $(GIT_BRANCH) ; \
493N/A else \
493N/A $(GIT) fetch ; \
493N/A fi ; \
493N/A fi ; \
493N/A fi
493N/A
0N/A
0N/A### Unpack source and apply patches
0N/A
90N/AFIX_PC_OPS= \
90N/A -e 's|-L\$${libdir}|-L\$${libdir} -R\$${libdir}|;' \
90N/A -e 's|Requires.private: .*$$||;'
90N/A
354N/A# -e 's|(Requires: .*)\bx11\b|$$1|;' \
90N/A# -e 's|^prefix=@prefix@|prefix=\$$\{top_builddir\}@prefix@|'
90N/A
493N/ASUNTOUCH_MAN_FLAGS = \
493N/A -a '{Availability, $(SUN_PACKAGE)}' \
493N/A -a '{Interface Stability, $(MODULE_STABILITY)}' \
493N/A $(MODTYPE_SUNTOUCH_MAN_FLAGS) \
493N/A $(MODULE_SUNTOUCH_MAN_FLAGS)
493N/A
493N/Adefault_source: $(MODULE_SOURCE_DEPS) $(MODTYPE_SOURCE_DEPS)
0N/A mkdir -p $(BUILD_DIR)
493N/A @ if [[ "$(SOURCE_TARBALL_NAME)" != "NONE" ]] ; then \
493N/A if [[ "$(MODULE_VERSION)" = "git" ]] ; then \
493N/A SOURCE_CMD='gtar --exclude=.git* -cf - $(GIT_CLONE_DIR)' ; \
493N/A else \
493N/A UNCOMP_CMD="$(SOURCE_UNCOMPRESS)" ; \
493N/A SOURCE_CMD="$${UNCOMP_CMD:-bzcat} $(SOURCE_TARBALL)" ; \
493N/A fi ; \
493N/A print "$${SOURCE_CMD} | (cd $(BUILD_DIR) ; gtar -xf - )" ; \
493N/A $${SOURCE_CMD} | (cd $(BUILD_DIR) ; gtar -xf - ) ; \
493N/A else \
493N/A print "mkdir -p $(SOURCE_DIR)" ; \
493N/A mkdir -p $(SOURCE_DIR) ; \
191N/A fi ; \
493N/A if [[ "$(ADDITIONAL_SOURCE_DIR)" != "" ]] ; then \
493N/A if [[ ! -x $(LNDIR) ]] ; then \
493N/A (cd $(TOP)/util/lndir && $(MAKE) $(MAKEFLAGS) install) ; \
493N/A fi ; \
493N/A print "cd $(SOURCE_DIR) && $(LNDIR) ../../$(ADDITIONAL_SOURCE_DIR)" ; \
493N/A (cd $(SOURCE_DIR) && $(LNDIR) ../../$(ADDITIONAL_SOURCE_DIR) ) ; \
493N/A fi ; \
493N/A if [[ "$(SOURCE_PATCHES)" != "" ]] ; then \
0N/A for p in $(SOURCE_PATCHES) x ; do \
493N/A if [[ "$$p" != "x" ]] ; then \
493N/A PATCH_CMD="$$(print $$p | awk -F, '{if (NF > 1) FLAGS = $$2; else FLAGS="-p0" ; printf "gpatch -d $(SOURCE_DIR) %s < %s\n", FLAGS, $$1}')" ; \
493N/A print "$${PATCH_CMD}" ; \
90N/A eval $${PATCH_CMD} ; \
0N/A fi ; \
0N/A done ; \
191N/A fi ; \
493N/A if [[ "$(SUNTOUCHED_MANPAGES)" != "" ]] ; then \
493N/A print "/usr/perl5/bin/perl $(TOP)/common/suntouch-manpages.pl \
40N/A $(SUNTOUCH_MAN_FLAGS) $(SUNTOUCHED_MANPAGES)" ; \
40N/A (cd $(SOURCE_DIR) && \
40N/A /usr/perl5/bin/perl $(TOP)/common/suntouch-manpages.pl \
40N/A $(SUNTOUCH_MAN_FLAGS) $(SUNTOUCHED_MANPAGES) ) ; \
191N/A fi ; \
493N/A if [[ "$(FIX_PC_FILES)" != "" ]] ; then \
493N/A print "/usr/perl5/bin/perl -i.orig -p \
90N/A $(FIX_PC_OPS) $(FIX_PC_FILES)" ; \
70N/A (cd $(SOURCE_DIR) && \
90N/A /usr/perl5/bin/perl -i.orig -p \
90N/A $(FIX_PC_OPS) $(FIX_PC_FILES) ); \
70N/A fi
493N/A touch $(BUILD_DIR)/$(UNPACK_FILE)
0N/A
493N/A### Run configure scripts
191N/A
191N/A# Include Xorg autoconf macros when rebuilding configure scripts
493N/AACLOCAL_PATH=aclocal -I $(PROTODIR)$(X11_ACLOCAL_DIR)
493N/A
493N/A# Dependencies for running configure to make a Makefile
493N/ACONFIGURE_DEPS = $(UNPACK_TARGET) \
493N/A $(MODTYPE_CONFIGURE_DEPS) $(MODULE_CONFIGURE_DEPS)
493N/A
493N/A# Command line options to GNU autoconf configure script
493N/ADEFAULT_CONFIG_OPTS = --prefix=$(MODULE_PREFIX) \
493N/A --mandir='$${prefix}/share/man' --localstatedir=/var \
493N/A --disable-libtool-lock
493N/A
493N/ACONFIG_OPTS = $(DEFAULT_CONFIG_OPTS) \
493N/A $(MODTYPE_CONFIG_OPTS) $(MODULE_CONFIG_OPTS)
493N/A
493N/A# Environment variable options to GNU autoconf configure script
493N/A$(USE_DEFAULT_CONFIG_CPPFLAGS:no=$(POUND_SIGN)) DEFAULT_CONFIG_CPPFLAGS= \
494N/A -I$(PROTODIR)$(X11_INCLUDES_DIR) \
494N/A -I$(PROTODIR)/usr/include -I$(PROTODIR)/usr/include/freetype2
493N/A$(USE_DEFAULT_CONFIG_LDFLAGS:no=$(POUND_SIGN)) DEFAULT_CONFIG_LDFLAGS= \
493N/A -L$(PROTODIR)/usr/lib$(ARCHLIBSUBDIR) \
493N/A -L$(PROTODIR)$(X11_DIR)/lib$(ARCHLIBSUBDIR)
561N/A
561N/ADEFAULT_PKG_CONFIG_PATH=$(TOP)/common/pc-files/$(BUILD_DIR):$(PROTODIR)/usr/lib/$(ARCHLIBSUBDIR)/pkgconfig:/usr/lib$(ARCHLIBSUBDIR)/pkgconfig
191N/A
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 CC="$(CC)" CXX="$(CXX)" \
493N/A LD="$(CC) $(LDFLAGS)" \
493N/A CFLAGS="$(MODTYPE_CFLAGS) $(MODULE_CFLAGS)" \
493N/A CXXFLAGS="$(MODTYPE_CXXFLAGS) $(MODULE_CXXFLAGS)" \
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/A PKG_CONFIG_PATH="$(DEFAULT_PKG_CONFIG_PATH)" \
493N/A INSTALL="$(INSTALL_SCRIPT)" CPPROG="cp -p" \
493N/A MAKE="$(MODULE_MAKE)" CONFIG_SHELL="$(SHELL)"
493N/A
493N/ACONFIG_ENV = $(DEFAULT_CONFIG_ENV) $(MODTYPE_CONFIG_ENV) $(MODULE_CONFIG_ENV)
493N/A
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
493N/A$(AUTOCONF_TARGET): $(CONFIGURE_DEPS)
493N/A cd $(SOURCE_DIR) ; \
493N/A if [[ "$(AUTORECONF)" = "yes" ]] ; then \
493N/A ACLOCAL="$(ACLOCAL_PATH)" autoreconf -v --install --force ; \
493N/A fi ; \
493N/A chmod a+x configure ; \
493N/A $(CONFIG_ENV) $(SHELL) ./configure $(CONFIG_OPTS) ; \
493N/A if [[ "$(DELIBTOOLIZE)" = "yes" ]] ; then \
493N/A $(TOP)/common/delibtoolize.pl $(DELIBTOOLIZE_FLAGS) . ; \
493N/A fi
493N/A
493N/Adefault_configure:: $(AUTOCONF_TARGET)
493N/A
0N/A
291N/A### Remove libtool from build process when needed
291N/A
291N/Adelibtoolize:
341N/A $(TOP)/common/delibtoolize.pl $(DELIBTOOLIZE_FLAGS) $(SOURCE_DIR)
291N/A
0N/A
40N/A### Generate mapfiles to limit/version exported symbols in libraries
40N/A
40N/ASPEC2MAP= /usr/lib/abi/spec2map
40N/A
40N/ASPECMAP= mapfile.vers.$(LIBNAME)
40N/ASPECFILE= spec/$(LIBNAME).spec
40N/AVERSFILE= spec/versions
40N/A
40N/A$(BUILD_DIR_32)/$(SPECMAP): $(SPECFILE) $(VERSFILE)
493N/A $(MAKE) $(MAKEFLAGS) BUILD_DIR=$(BUILD_DIR_32) MACH=$(MACH32) spec_gen
40N/A
40N/A$(BUILD_DIR_64)/$(SPECMAP): $(SPECFILE) $(VERSFILE)
493N/A $(MAKE) $(MAKEFLAGS) BUILD_DIR=$(BUILD_DIR_64) MACH=$(MACH64) spec_gen
40N/A
40N/Aspec_gen:
40N/A $(SPEC2MAP) -a $(MACH) -v $(VERSFILE) -p -l $(LIBNAME) \
40N/A -o $(BUILD_DIR)/$(SPECMAP) $(SPECFILE)
40N/A
493N/A### Default rules for common build pattern
493N/A
493N/ALD_OPTIONS = -L$(PROTODIR)$(X11_DIR)/lib$(LIBSUBDIR) \
493N/A $(MODTYPE_LD_OPTIONS) $(MODULE_LD_OPTIONS)
493N/A
536N/ABUILD_ENV = LD_OPTIONS='$(LD_OPTIONS)' \
493N/A $(MODTYPE_BUILD_ENV) $(MODULE_BUILD_ENV)
493N/A
493N/ADEFAULT_BUILD_MAKEFLAGS=$(MODTYPE_MAKEFLAGS) $(MODULE_MAKEFLAGS) \
493N/A $(MODTYPE_BUILD_MAKEFLAGS) $(MODULE_BUILD_MAKEFLAGS)
493N/A
493N/Adefault_build:: $(UNPACK_TARGET) $(CONFIGURE_TARGETS) $(MODTYPE_BUILD_DEPS) $(MODULE_BUILD_DEPS) $(MODULE_MAKE)
493N/A (cd $(SOURCE_DIR) ; \
493N/A $(BUILD_ENV) $(MODULE_MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS))
493N/A
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/A
493N/Abuild-in-subdir:
493N/A (cd $(subdir) ; \
493N/A $(BUILD_ENV) $(MODULE_MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS) \
493N/A $(subdir_cmd) )
493N/A
493N/ADEFAULT_INSTALL_MAKEFLAGS= -e DESTDIR=$(PROTODIR) \
493N/A pkgconfigdir=/usr/lib$(ARCHLIBSUBDIR)/pkgconfig \
493N/A $(MODTYPE_MAKEFLAGS) $(MODULE_MAKEFLAGS) \
493N/A $(MODTYPE_INSTALL_MAKEFLAGS) $(MODULE_INSTALL_MAKEFLAGS) \
493N/A
493N/Adefault_install:: $(BUILD_TARGETS)
493N/A (cd $(SOURCE_DIR) ; \
493N/A $(BUILD_ENV) $(MODULE_MAKE) $(MAKEFLAGS) $(DEFAULT_INSTALL_MAKEFLAGS) \
493N/A install)
493N/A
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
493N/Ainstall-in-subdir:
493N/A (cd $(subdir) ; \
493N/A $(BUILD_ENV) $(MODULE_MAKE) $(MAKEFLAGS) $(DEFAULT_INSTALL_MAKEFLAGS) \
493N/A $(subdir_cmd))
493N/A
493N/A
493N/A### Other tools/dependencies needed to build
0N/A
0N/A# Some modules (such as FreeType 2) require GNU make
493N/A$(GNUMAKE):
493N/A @print -n "Building with GNU make from $$(whence gmake): "
493N/A @$(GNUMAKE) --version
0N/A
493N/A$(MAKE):
493N/A @print "Building with make from $$(whence $(MAKE))"
0N/A
90N/A# Some modules use lndir to merge in sources from Sun specific directories
90N/A$(LNDIR):
493N/A (cd $(TOP)/util/lndir && $(MAKE) $(MAKEFLAGS) install)
90N/A
493N/A# Some modules use these tools to convert DocBook docs to text or html
493N/A$(DOCBOOK2HTML) $(DOCBOOK2TEXT):
493N/A cd $(TOP)/doc/docbook-utils && $(MAKE) $(MAKEFLAGS) install
98N/A
493N/A$(XORG_DEFS_ENT):
493N/A cd $(TOP)/doc/xorg-sgml-doctools && $(MAKE) $(MAKEFLAGS) install
0N/A
40N/A# Almost everything depends on the headers in xproto
40N/A$(XPROTO_DEP):
493N/A @print "$(XPROTO_DEP) not found..."
493N/A @print "Installing dependency proto/x11proto"
253N/A (cd $(TOP)/proto/x11proto ; make install)
40N/A
47N/A### Useful rules for maintaining patch sets
47N/A
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/
47N/A
90N/Aregen-patches:
47N/A CUR_LIST=""
47N/A rm -rf tmp-regen
47N/A make SOURCE_PATCHES="$(CUR_LIST)" BUILD_DIR=tmp-regen source_gen
47N/A mkdir -p new
47N/A for f in $(SOURCE_PATCHES) ; do \
493N/A p=$$(print $$f | sed 's/,.*$$//') ; \
493N/A print '=================' $$p ; \
47N/A rm -rf prev ; \
47N/A mv tmp-regen prev ; \
47N/A $(MAKE) SOURCE_PATCHES="$${CUR_LIST} $$f" BUILD_DIR=tmp-regen source_gen ; \
47N/A awk '/^--- / {exit} \
47N/A /^diff -u/ {exit} \
90N/A {print}' $$p > new/$$p ; \
98N/A gdiff -urp -x '*~' -x '*.orig' ./prev ./tmp-regen \
47N/A | sed -e 's% \./prev$(SOURCE_DIR)/% %' -e 's% \./tmp-regen$(SOURCE_DIR)/% %' \
47N/A | grep -v '^Common subdirectories:' \
47N/A | grep -v '^Only in ' \
90N/A >> new/$$p ; \
90N/A CUR_LIST="$${CUR_LIST} new/$$p" ; \
47N/A done
47N/A rm -rf tmp-regen
355N/A
355N/A### Licensing files
355N/A
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
587N/A# licenses to copy
355N/ALICENSE_FILE_DEFAULT = $(LICENSE_FILE_SET:yes=$(POUND_SIGN))
355N/A$(LICENSE_FILE_DEFAULT) LICENSE_FILE=COPYING
355N/A
355N/Ainstall_license:
587N/A @ THIS_MODULE="$$(echo $(PWD) | sed 's|.*/open-src/||')" ; \
587N/A PS4="" ; set -x ; \
493N/A if [[ -f $(LICENSE_FILE) ]] ; then \
493N/A LICENSE_TO_COPY="$(LICENSE_FILE)" ; \
493N/A elif [[ -f $(SOURCE_DIR)/$(LICENSE_FILE) ]] ; then \
493N/A LICENSE_TO_COPY="$(SOURCE_DIR)/$(LICENSE_FILE)" ; \
493N/A fi ; \
493N/A if [[ "$${LICENSE_TO_COPY}" != "" ]] ; then \
493N/A mkdir -p $(LICENSE_DEST)/$${THIS_MODULE}/ ; \
493N/A cp -pf $${LICENSE_TO_COPY} \
493N/A $(LICENSE_DEST)/$${THIS_MODULE}/COPYING ; \
587N/A fi ; \
587N/A if [[ "$(EXTRA_LICENSES)" != "" ]] ; then \
587N/A mkdir -p $(LICENSE_DEST)/$${THIS_MODULE}/ ; \
587N/A cp -pf $(EXTRA_LICENSES) $(LICENSE_DEST)/$${THIS_MODULE} ; \
355N/A fi