Makefile.inc revision 1273
0N/A# -*- Makefile -*- rules commonly shared among X consolidation open source dirs
0N/A#
1273N/A# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
0N/A#
0N/A# Permission is hereby granted, free of charge, to any person obtaining a
919N/A# copy of this software and associated documentation files (the "Software"),
919N/A# to deal in the Software without restriction, including without limitation
919N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense,
919N/A# and/or sell copies of the Software, and to permit persons to whom the
919N/A# Software is furnished to do so, subject to the following conditions:
919N/A#
919N/A# The above copyright notice and this permission notice (including the next
919N/A# paragraph) shall be included in all copies or substantial portions of the
919N/A# Software.
919N/A#
919N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
919N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
919N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
919N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
919N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
919N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
919N/A# DEALINGS IN THE SOFTWARE.
0N/A#
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))
851N/A$(MODTYPE_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
970N/A# Where to install documentation files
970N/AMODTYPE_DOC_DIR_DEFAULT = $(MODTYPE_DOC_DIR_SET:yes=$(POUND_SIGN))
970N/A$(MODTYPE_DOC_DIR_DEFAULT) MODTYPE_DOC_DIR=$(MODULE_PREFIX)/share/doc/$(MODULE_NAME)
970N/AMODULE_DOC_DIR_DEFAULT = $(MODULE_DOC_DIR_SET:yes=$(POUND_SIGN))
970N/A$(MODULE_DOC_DIR_DEFAULT) MODULE_DOC_DIR=$(MODTYPE_DOC_DIR)
970N/A
851N/A# Where to install pkgconfig files
851N/AMODTYPE_PKGCONFIG_DIR_DEFAULT = $(MODTYPE_PKGCONFIG_DIR_SET:yes=$(POUND_SIGN))
851N/A$(MODTYPE_PKGCONFIG_DIR_DEFAULT) MODTYPE_PKGCONFIG_DIR=$(PKGCONFIG_DIR)
851N/AMODULE_PKGCONFIG_DIR_DEFAULT = $(MODULE_PKGCONFIG_DIR_SET:yes=$(POUND_SIGN))
851N/A$(MODULE_PKGCONFIG_DIR_DEFAULT) MODULE_PKGCONFIG_DIR=$(MODTYPE_PKGCONFIG_DIR)
851N/A
970N/A# Package files will be delivered in
970N/AMODTYPE_PKGHIER_DEFAULT = $(MODTYPE_PKGHIER_SET:yes=$(POUND_SIGN))
970N/A$(MODTYPE_PKGHIER_DEFAULT) MODTYPE_PKGHIER=x11/$(MODTYPE)
970N/AMODULE_PKGTAIL_DEFAULT = $(MODULE_PKGTAIL_SET:yes=$(POUND_SIGN))
970N/A$(MODULE_PKGTAIL_DEFAULT) MODULE_PKGTAIL_CMD=print $(MODULE_NAME) | \
970N/A tr '[:upper:]' '[:lower:]'
970N/A$(MODULE_PKGTAIL_DEFAULT) MODULE_PKGTAIL=$(MODULE_PKGTAIL_CMD:sh)
970N/AMODULE_PKGNAME_DEFAULT = $(MODULE_PKGNAME_SET:yes=$(POUND_SIGN))
970N/A$(MODULE_PKGNAME_DEFAULT) MODULE_PKGNAME=$(MODTYPE_PKGHIER)/$(MODULE_PKGTAIL)
970N/A
970N/A# Package manifest file
970N/APKG_SRC_DIR = $(TOP)/pkg
970N/APKG_MANIFEST_DIR = $(PKG_SRC_DIR)/manifests
970N/APKG_LICENSE_DIR = $(PKG_SRC_DIR)/license_files
970N/AMODULE_PKG_MANIFEST_NAME_CMD = print $(MODULE_PKGNAME) | tr '/' '-'
970N/AMODULE_PKG_MANIFEST_NAME = $(MODULE_PKG_MANIFEST_NAME_CMD:sh)
1105N/AMODULE_PKG_MANIFEST = $(PKG_MANIFEST_DIR)/$(MODULE_PKG_MANIFEST_NAME).p5m
970N/A
970N/A# Package classification - must be a valid value recognized by pkg gui
970N/AMODULE_PKGCLASS_DEFAULT = $(MODULE_PKGCLASS_SET:yes=$(POUND_SIGN))
970N/A$(MODULE_PKGCLASS_DEFAULT) MODULE_PKGCLASS=System/X11
970N/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
935N/ABUILD_DIR_$(BUILD_TYPE) = build-$(BUILD_TYPE)
922N/A# Special cases for 32-bit & 64-bit directory names to allow building
935N/A# both architectures in the same tree (serially - building both in
922N/A# parallel is likely to have race conditions)
922N/ABUILD_DIR_32 = build-$(MACH32)
922N/ABUILD_DIR_64 = build-$(MACH64)
922N/ABUILD_DIR = $(BUILD_DIR_$(BUILD_TYPE))
922N/A
493N/ASOURCE_DIR = $(BUILD_DIR)/$(SOURCE_DIRNAME)
606N/ASOURCE_DIR_32 = $(BUILD_DIR_32)/$(SOURCE_DIRNAME)
606N/ASOURCE_DIR_64 = $(BUILD_DIR_64)/$(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))
1123N/A$(SOURCE_URL_DEFAULT) SOURCE_URL=$(SOURCE_URL_$(UPSTREAM_PROJECT))
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
1097N/A# Set default build type to 64-bit if not set in module makefile
156N/ABUILD_TYPES_DEFAULT = $(BUILD_TYPES_SET:yes=$(POUND_SIGN))
1097N/A$(BUILD_TYPES_DEFAULT) BUILD_TYPES=64
156N/A
493N/A# Set default rules if not set in module/modtype Makefile
493N/ASOURCE_TARGETS_DEFAULT = $(SOURCE_TARGETS_SET:yes=$(POUND_SIGN))
935N/A$(SOURCE_TARGETS_DEFAULT) SOURCE_TARGETS=$(UNPACK_TARGET) \
591N/A $(MODTYPE_ADD_SOURCE_TARGETS) \
591N/A $(MODULE_ADD_SOURCE_TARGETS)
493N/A
493N/ACONFIGURE_TARGETS_DEFAULT = $(CONFIGURE_TARGETS_SET:yes=$(POUND_SIGN))
591N/A$(CONFIGURE_TARGETS_DEFAULT) CONFIGURE_TARGETS=default_configure \
591N/A $(MODTYPE_ADD_CONFIGURE_TARGETS) \
591N/A $(MODULE_ADD_CONFIGURE_TARGETS)
493N/A
493N/ABUILD_TARGETS_DEFAULT = $(BUILD_TARGETS_SET:yes=$(POUND_SIGN))
591N/A$(BUILD_TARGETS_DEFAULT) BUILD_TARGETS=default_build \
591N/A $(MODTYPE_ADD_BUILD_TARGETS) \
591N/A $(MODULE_ADD_BUILD_TARGETS)
493N/A
493N/AINSTALL_TARGETS_DEFAULT = $(INSTALL_TARGETS_SET:yes=$(POUND_SIGN))
591N/A$(INSTALL_TARGETS_DEFAULT) INSTALL_TARGETS=default_install \
591N/A $(MODTYPE_ADD_INSTALL_TARGETS) \
591N/A $(MODULE_ADD_INSTALL_TARGETS)
493N/A
493N/A# Additional flags to pass to make in 32-bit & 64-bit builds
922N/ABUILD_32_FLAGS= ARCH_FLAGS="$(ARCH32_FLAGS)" \
810N/A $(MODTYPE_BUILD_32_FLAGS) $(MODULE_BUILD_32_FLAGS)
810N/A
922N/ABUILD_64_FLAGS= ARCH_FLAGS="$(ARCH64_FLAGS)" \
810N/A $(MODTYPE_BUILD_64_FLAGS) $(MODULE_BUILD_64_FLAGS)
493N/A
922N/Aall: $(BUILD_TYPES:%=build_%)
922N/Aall_%: build_%
0N/A
1097N/A# We always want to clean 32 & 64 bit subdirs, plus any special ones
1097N/A# But if we just add clean_32 & clean_64, then make complains when they
1097N/A# end up having multiple targets, so we remove them if they're in the list
1097N/A# generated from $(BUILD_TYPES)
1097N/ACLEAN_RULES_1 = $(BUILD_TYPES:%=clean_%)
1097N/ACLEAN_RULES_2 = $(CLEAN_RULES_1:clean_32=)
1097N/ACLEAN_RULES_3 = $(CLEAN_RULES_2:clean_64=)
1097N/ACLEAN_RULES = clean_32 clean_64 $(CLEAN_RULES_3)
922N/Aclean: $(CLEAN_RULES)
922N/A.PARALLEL: $(CLEAN_RULES)
0N/A
922N/A# Remove directories with both styles of naming
922N/A$(CLEAN_RULES):
935N/A -rm -rf $(BUILD_DIR_$(@:clean_%=%)) $(@:clean_%=build_%) $(@:clean_%=build-%)
0N/A
822N/A# Tell dmake not to remove and create source in parallel
822N/A.NOPARALLEL: clean source
822N/A.NOPARALLEL: clean_$(BUILD_TYPE) source_$(BUILD_TYPE)
822N/A
922N/ASOURCE_RULES = $(BUILD_TYPES:%=source_%)
922N/Asource: $(SOURCE_RULES)
922N/A.PARALLEL: $(SOURCE_RULES)
493N/A
922N/Asource-gen: $(SOURCE_TARGETS)
922N/A
922N/A$(SOURCE_RULES):
922N/A $(MAKE) $(MAKEFLAGS) BUILD_TYPE="$(@:source_%=%)" source-gen
493N/A
922N/ACONFIGURE_RULES = $(BUILD_TYPES:%=configure_%)
922N/Aconfigure: $(CONFIGURE_RULES)
922N/A.PARALLEL: $(CONFIGURE_RULES)
493N/A
922N/Aconfigure-gen: source-gen $(CONFIGURE_TARGETS)
493N/A
922N/A$(CONFIGURE_RULES):
922N/A $(MAKE) $(MAKEFLAGS) BUILD_TYPE="$(@:configure_%=%)" \
922N/A $(BUILD_$(@:configure_%=%)_FLAGS) configure-gen
493N/A
922N/ABUILD_RULES = $(BUILD_TYPES:%=build_%)
922N/Abuild: $(BUILD_RULES)
922N/A.PARALLEL: $(BUILD_RULES)
493N/A
922N/Abuild-gen: configure-gen $(BUILD_TARGETS)
0N/A
922N/A$(BUILD_RULES):
922N/A $(MAKE) $(MAKEFLAGS) BUILD_TYPE="$(@:build_%=%)" \
922N/A $(BUILD_$(@:build_%=%)_FLAGS) build-gen
493N/A
922N/AINSTALL_RULES = $(BUILD_TYPES:%=install_%)
922N/Ainstall: $(INSTALL_RULES)
355N/A
970N/Ainstall-gen: build-gen $(INSTALL_TARGETS) install_metadata
970N/Ainstall-gen: install_pkgconfig_uninstalled install_X11_compat_links
0N/A
922N/A$(INSTALL_RULES):
922N/A $(MAKE) $(MAKEFLAGS) BUILD_TYPE="$(@:install_%=%)" \
922N/A $(BUILD_$(@:install_%=%)_FLAGS) install-gen
493N/A
963N/A$(PROTODIR)$(MODULE_DOC_DIR):
963N/A mkdir -p $@
963N/A
493N/ADEBUG_BUILD_FLAGS = BUILD_DEBUG=yes
0N/A
922N/A# Allow adding "debug-" prefix to rules like build_32, install, etc.
922N/Adebug-%:
922N/A $(MAKE) $(MAKEFLAGS) $(@:debug-%=%) $(DEBUG_BUILD_FLAGS)
493N/A
922N/A# Allow debug_XX to run "make all_XX" with debug flags (including without _XX)
922N/Adebug%:
922N/A $(MAKE) $(MAKEFLAGS) $(@:debug%=all%) $(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
911N/A# Allow downloading from local archive/mirror
1003N/A# TARBALL_ARCHIVE is now set in Makefile.options
911N/AARCHIVE_URL=$(TARBALL_ARCHIVE)/$(SOURCE_TARBALL_DIR)/$(SOURCE_TARBALL_NAME)
911N/A
1088N/AGIT_CLONE_DIR=$(MODULE_NAME)-git
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
705N/A# If MODULE_VERSION is git, checkout source from git repo instead of
493N/A# a tarball
911N/Adownload: $(SOURCE_TARBALL)
911N/A
911N/A$(SOURCE_TARBALL): $(TARBALLDIR)
1061N/A @case '$(MAKEFLAGS)' in *[ik]*) set +e;; esac; \
493N/A if [[ "$(MODULE_VERSION)" = "git" ]] ; then \
493N/A if [[ ! -d $(GIT_CLONE_DIR) ]] ; then \
1061N/A $(START_CMD_ECHO) ; \
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 \
911N/A if [[ ! -z "$(TARBALL_ARCHIVE)" ]] ; then \
1061N/A URL='$(ARCHIVE_URL)' ; \
911N/A else \
1061N/A URL='$(SOURCE_URL)' ; \
493N/A fi ; \
1061N/A $(START_CMD_ECHO) ; \
1061N/A $(WGET) -O '$(SOURCE_TARBALL)' "$${URL}" || \
1061N/A ( status=$$? ; rm -f '$(SOURCE_TARBALL)' ; \
1061N/A exit $${status} ) ; \
493N/A fi ; \
493N/A fi
493N/A
935N/ACHECKSUM_TARGET = .checksum_done.$(MODULE_VERSION)
935N/Acheck-checksums: $(CHECKSUM_TARGET)
935N/A
935N/A$(CHECKSUM_TARGET): $(SOURCE_TARBALL)
911N/A @case '$(MAKEFLAGS)' in *[ik]*) set +e;; esac; \
911N/A if [[ "$(MODULE_VERSION)" != "git" && \
911N/A "$(SOURCE_TARBALL_NAME)" != "NONE" ]] ; then \
911N/A ACTUAL_MD5="$$(digest -a md5 $(SOURCE_TARBALL))" ; \
911N/A if [[ "$${ACTUAL_MD5}" != "${TARBALL_MD5}" ]] ; then \
911N/A print -u2 "ERROR: MD5 sum mismatch on ${SOURCE_TARBALL}\n" \
911N/A "$${ACTUAL_MD5} != ${TARBALL_MD5}" ; \
911N/A exit 1; \
911N/A fi ; \
911N/A ACTUAL_SHA1="$$(digest -a sha1 ${SOURCE_TARBALL})" ; \
911N/A if [[ "$${ACTUAL_SHA1}" != "${TARBALL_SHA1}" ]] ; then \
911N/A print -u2 "ERROR: SHA1 sum mismatch on ${SOURCE_TARBALL}\n" \
911N/A "$${ACTUAL_SHA1} != ${TARBALL_SHA1}" ; \
911N/A exit 1; \
911N/A fi ; \
1179N/A if [[ -n "${TARBALL_SHA256}" ]] ; then \
1179N/A ACTUAL_SHA256="$$(digest -a sha256 ${SOURCE_TARBALL})" ; \
1179N/A if [[ "$${ACTUAL_SHA256}" != "${TARBALL_SHA256}" ]] ; then \
1179N/A print -u2 \
1179N/A "ERROR: SHA256 sum mismatch on ${SOURCE_TARBALL}\n" \
1179N/A "$${ACTUAL_SHA256} !=\n ${TARBALL_SHA256}" ; \
1179N/A exit 1; \
1179N/A fi ; \
1179N/A fi ; \
911N/A fi
935N/A touch $(CHECKSUM_TARGET)
935N/A
935N/Aclean: clean-checksums
935N/A
935N/Aclean-checksums:
935N/A -rm -f .checksum_done.*
911N/A
911N/A
911N/A# Submit a tarball to the archive
911N/AARCHIVE_SUBMIT=/ws/x11/tarballs/bin/archive-tarballs
911N/A
911N/Aarchive-tarball:
911N/A @case '$(MAKEFLAGS)' in *[ik]*) set +e;; esac; \
911N/A if [[ "$(MODULE_VERSION)" != "git" && \
911N/A "$(SOURCE_TARBALL_NAME)" != "NONE" ]] ; then \
911N/A $(ARCHIVE_SUBMIT) \
911N/A --modtype='$(SOURCE_TARBALL_DIR)' \
911N/A --tarball='$(SOURCE_TARBALL_NAME)' \
911N/A --url='$(SOURCE_URL)' \
911N/A --md5='$(TARBALL_MD5)' \
911N/A --sha1='$(TARBALL_SHA1)' ; \
911N/A fi
911N/A
851N/A$(TARBALLDIR):
851N/A mkdir -p $(TARBALLDIR)
851N/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
1088N/A# Create a local git repo from tarball and patches, to ease generating
1088N/A# patches for submission to upstream git or rebasing to new tarballs
1088N/Agit-import:
1088N/A mkdir $(GIT_CLONE_DIR)
1088N/A cd $(GIT_CLONE_DIR) && git init
1088N/A $(MAKE) BUILD_DIR="$(GIT_CLONE_DIR)" SOURCE_DIR="$(GIT_CLONE_DIR)" \
1088N/A ADD_TAR_FLAGS="--strip-components=1" init_source
1088N/A cd $(GIT_CLONE_DIR) && git add . && \
1088N/A git commit -a -m 'Initialized from $(SOURCE_TARBALL_NAME)' \
1088N/A && git tag '$(MODULE_NAME)-$(MODULE_VERSION)'
1088N/A @for f in $(SOURCE_PATCHES) ; do \
1088N/A p=$${f%,*} ; \
1088N/A print '=================' $$p ; \
1088N/A if head -n 1 $$p | \
1088N/A ggrep -Eq '^From .* Mon Sep 17 00:00:00 2001' ; then \
1088N/A (cd $(GIT_CLONE_DIR) ; $(START_CMD_ECHO) ; git am $(PWD)/$$p) ; \
1088N/A else \
1088N/A rm -f $(GIT_CLONE_DIR)/$(PATCHED_TARGET_FILE) ; \
1088N/A $(MAKE) SOURCE_PATCHES="$$f" BUILD_DIR="$(GIT_CLONE_DIR)" \
1088N/A SOURCE_DIR="$(GIT_CLONE_DIR)" patched_source ; \
1088N/A printf '%s\n\n' "$${p%.patch}" > git.comments ; \
1088N/A gawk '/^--- / {exit} \
1124N/A /^diff -/ {exit} \
1088N/A {print}' $$p >> git.comments ; \
1088N/A (cd $(GIT_CLONE_DIR) ; $(START_CMD_ECHO) ; \
1088N/A git commit -a --file=$(PWD)/git.comments ) ; \
1088N/A rm git.comments ; \
1088N/A fi ; \
1088N/A done
1088N/A
0N/A
0N/A### Unpack source and apply patches
0N/A
963N/ASOURCE_DEPS = $(SOURCE_TARBALL) $(CHECKSUM_TARGET) \
963N/A $(MODTYPE_SOURCE_DEPS) $(MODULE_SOURCE_DEPS)
963N/A
935N/A# Step 1: Initialize source dir with upstream sources
935N/A# - if there's a tarball, unpack it.
935N/A# - if using a git master, copy it.
935N/ASOURCE_INIT_TARGET_FILE=.source.init.done
935N/ASOURCE_INIT_TARGET=$(SOURCE_DIR)/$(SOURCE_INIT_TARGET_FILE)
935N/Ainit_source: $(SOURCE_INIT_TARGET)
90N/A
963N/A$(SOURCE_INIT_TARGET): $(SOURCE_DEPS)
0N/A mkdir -p $(BUILD_DIR)
935N/A @ if [[ "$(SOURCE_TARBALL_NAME)" == "NONE" ]] ; then \
935N/A $(START_CMD_ECHO); mkdir -p $(SOURCE_DIR) ; \
935N/A else \
493N/A if [[ "$(MODULE_VERSION)" = "git" ]] ; then \
493N/A SOURCE_CMD='gtar --exclude=.git* -cf - $(GIT_CLONE_DIR)' ; \
1228N/A SOURCE_FILE='-' ; \
493N/A else \
1228N/A SOURCE_CMD=':' ; SOURCE_FILE='$(SOURCE_TARBALL)' ; \
493N/A fi ; \
935N/A $(START_CMD_ECHO) ; \
935N/A $${SOURCE_CMD} | \
1228N/A gtar --directory="$(BUILD_DIR)" $(ADD_TAR_FLAGS) \
1228N/A -xf $${SOURCE_FILE} ; \
935N/A fi
935N/A touch $(SOURCE_INIT_TARGET)
935N/A
935N/A# Step 2: Add in any additional local sources from $(ADDITIONAL_SOURCE_DIR)
935N/A# (done after init source to avoid races in directory/file creation)
935N/ASOURCE_ADD_TARGET_FILE=.source.add.done
935N/ASOURCE_ADD_TARGET=$(SOURCE_DIR)/$(SOURCE_ADD_TARGET_FILE)
935N/Aadd_source: $(SOURCE_ADD_TARGET)
935N/A
935N/A$(SOURCE_ADD_TARGET): $(SOURCE_INIT_TARGET)
935N/A @if [[ "$(ADDITIONAL_SOURCE_DIR)" != "" ]] ; then \
493N/A if [[ ! -x $(LNDIR) ]] ; then \
967N/A (cd $(TOP)/open-src/util/lndir && $(MAKE) $(MAKEFLAGS) install) ; \
493N/A fi ; \
935N/A $(START_CMD_ECHO) ; \
935N/A cd $(SOURCE_DIR) && $(LNDIR) ../../$(ADDITIONAL_SOURCE_DIR) ; \
935N/A fi
935N/A touch $(SOURCE_ADD_TARGET)
935N/A
935N/A# Step 3: Apply any local patches (may be done in parallel to add_source,
935N/A# but must come after init_source is finished)
935N/A#
935N/A# SOURCE_PATCHES is a list in the format: filename[,flags]
935N/A# $${p/*,} is ksh93 syntax to remove the comma and everything before it in $p
935N/A# $${p%,*} is ksh93 syntax to remove the comma and everything after it in $p
935N/APATCHED_TARGET_FILE=.patches.done
935N/APATCHED_TARGET=$(SOURCE_DIR)/$(PATCHED_TARGET_FILE)
935N/Apatched_source: $(PATCHED_TARGET)
935N/A
935N/A$(PATCHED_TARGET): $(SOURCE_INIT_TARGET)
935N/A @ if [[ "$(SOURCE_PATCHES)" != "" ]] ; then \
0N/A for p in $(SOURCE_PATCHES) x ; do \
493N/A if [[ "$$p" != "x" ]] ; then \
922N/A patch_file="$${p%,*}" ; \
922N/A if [[ "$$p" =~ "," ]] ; then \
922N/A patch_flags="$${p/*,}" ; \
922N/A else \
922N/A patch_flags="-p0" ; \
922N/A fi ; \
922N/A ($(START_CMD_ECHO) ; \
922N/A gpatch -d $(SOURCE_DIR) $${patch_flags} < "$${patch_file}" ) ; \
0N/A fi ; \
0N/A done ; \
935N/A fi
935N/A touch $(PATCHED_TARGET)
935N/A
935N/A# Step 4: Apply common Solaris changes to man pages in $(SUNTOUCHED_MANPAGES)
947N/AFIXED_MAN_SUFFIX=mantouch.done
947N/AFIXED_MAN_TARGET=$(SUNTOUCHED_MANPAGES:%=$(SOURCE_DIR)/%.$(FIXED_MAN_SUFFIX))
935N/Afixed_man: $(FIXED_MAN_TARGET)
935N/A
1124N/ACOMMON_SUNTOUCH_MAN_FLAGS = -a '{Availability, $(MODULE_PKGNAME)}'
1124N/ACOMMON_SUNTOUCH_MAN_FLAGS += -a '{Interface Stability, $(MODULE_STABILITY)}'
1124N/ACOMMON_SUNTOUCH_MAN_FLAGS += -r '{__distroname__, $(DISTRO_NAME)}'
935N/A
947N/ADEFAULT_SUNTOUCH_MAN_FLAGS = \
935N/A $(COMMON_SUNTOUCH_MAN_FLAGS) \
935N/A $(MODTYPE_SUNTOUCH_MAN_FLAGS) \
935N/A $(MODULE_SUNTOUCH_MAN_FLAGS)
935N/A
947N/ASUNTOUCH_MAN_FLAGS_DEFAULT = $(SUNTOUCH_MAN_FLAGS_SET:yes=$(POUND_SIGN))
947N/A$(SUNTOUCH_MAN_FLAGS_DEFAULT) SUNTOUCH_MAN_FLAGS = $(DEFAULT_SUNTOUCH_MAN_FLAGS)
947N/A
947N/A$(FIXED_MAN_TARGET): $(PATCHED_TARGET) $(SOURCE_ADD_TARGET)
967N/A $(PERL) $(TOP)/open-src/common/suntouch-manpages.pl $(SUNTOUCH_MAN_FLAGS) \
947N/A $(@:%.$(FIXED_MAN_SUFFIX)=%)
947N/A touch $@
935N/A
935N/A# Step 5: Apply common Solaris changes to pkg-config *.pc files listed in
935N/A# $(FIX_PC_FILES)
935N/ASOURCE_PC_FILES = $(FIX_PC_FILES:%=$(SOURCE_DIR)/%)
935N/AORIG_PC_FILES = $(SOURCE_PC_FILES:%=%.orig)
935N/AFIXED_PC_TARGET = $(ORIG_PC_FILES)
935N/Afixed_pc: $(FIXED_PC_TARGET)
935N/A
935N/AFIX_PC_OPS= \
935N/A -e 's|-L\$${libdir}|-L\$${libdir} -R\$${libdir}|;' \
965N/A -e 's|-R\$${libdir}( .*)? -R\$${libdir}|-R\$${libdir}$$1|g;' \
935N/A $(MODTYPE_FIX_PC_FLAGS) \
935N/A $(MODULE_FIX_PC_FLAGS)
935N/A
935N/A$(ORIG_PC_FILES): $(PATCHED_TARGET)
935N/A $(PERL) -i.orig -p $(FIX_PC_OPS) $(@:.orig=)
935N/A
935N/A# Tie them all together
935N/AUNPACK_TARGETS = $(SOURCE_INIT_TARGET) $(PATCHED_TARGET) \
935N/A $(SOURCE_ADD_TARGET) $(FIXED_MAN_TARGET) $(FIXED_PC_TARGET)
935N/A
935N/Adefault_source: $(UNPACK_TARGET)
935N/A
935N/A$(UNPACK_TARGET): $(SOURCE_DEPS) $(UNPACK_TARGETS)
606N/A touch $(UNPACK_TARGET)
0N/A
493N/A### Run configure scripts
191N/A
191N/A# Include Xorg autoconf macros when rebuilding configure scripts
599N/A# and use automake 1.10 instead of the older 1.9.
935N/AACLOCAL_PATH=/usr/bin/aclocal-1.10
599N/AACLOCAL_INCLUDES = -I $(PROTODIR)$(X11_ACLOCAL_DIR) \
1045N/A -I /usr/share/aclocal -I /usr/share/aclocal-1.10
599N/AAUTOMAKE_PATH=/usr/bin/automake-1.10
599N/AAUTORECONF_ENV= ACLOCAL="$(ACLOCAL_PATH) $(ACLOCAL_INCLUDES)" \
599N/A AUTOMAKE="$(AUTOMAKE_PATH)"
493N/A
493N/A# Dependencies for running configure to make a Makefile
922N/ACONFIGURE_DEPS = $(SOURCE_TARGETS) \
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) \
1056N/A --without-xmlto --without-asciidoc --without-fop \
810N/A --mandir='$${prefix}/share/man' --localstatedir=/var
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
967N/ADEFAULT_PKG_CONFIG_PATH=$(TOP)/open-src/common/pc-files/$(BUILD_DIR):$(PROTODIR)$(PKGCONFIG_DIR):$(PROTODIR)$(PKGCONFIG_DIR_SHARE):$(PKGCONFIG_DIR):$(PKGCONFIG_DIR_SHARE)
191N/A
1111N/A# Most upstream software is written by developers using bash as /bin/sh, so
1111N/A# we run configure scripts with that to minimize problems and work around
1111N/A# some ksh93 bugs we've hit
1111N/ACONFIG_SHELL_DEFAULT = $(CONFIG_SHELL_SET:yes=$(POUND_SIGN))
1111N/A$(CONFIG_SHELL_DEFAULT) CONFIG_SHELL = /usr/bin/bash
1111N/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)" \
1176N/A LD="$(CC) $(ARCH_FLAGS) $(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)" \
1147N/A PERL="$(PERL)" \
1132N/A PYTHON="$(PYTHON)" PYTHONPATH="$(PYTHON_PATH)" \
493N/A INSTALL="$(INSTALL_SCRIPT)" CPPROG="cp -p" \
1111N/A MAKE="$(MODULE_MAKE)" CONFIG_SHELL="$(CONFIG_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) ; \
705N/A if [[ "$(AUTORECONF)" = "yes" || "$(MODULE_VERSION)" = "git" ]] ; then \
599N/A $(AUTORECONF_ENV) autoreconf -v --install --force ; \
493N/A fi ; \
493N/A chmod a+x configure ; \
1111N/A $(CONFIG_ENV) $(CONFIG_SHELL) ./configure $(CONFIG_OPTS) ; \
493N/A if [[ "$(DELIBTOOLIZE)" = "yes" ]] ; then \
1147N/A $(PERL) $(TOP)/open-src/common/delibtoolize.pl $(DELIBTOOLIZE_FLAGS) . ; \
493N/A fi
493N/A
910N/Adefault_configure: $(AUTOCONF_TARGET)
493N/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
810N/A# MKDIRPROG - Workaround parallel build race condition
810N/A# in older upstream packaged install-sh
810N/A
536N/ABUILD_ENV = LD_OPTIONS='$(LD_OPTIONS)' \
606N/A PROTODIR='$(PROTODIR)' \
810N/A MAKE='$(MODULE_MAKE)' \
810N/A MKDIRPROG='mkdir -p' \
1132N/A PYTHONPATH="$(PYTHON_PATH)" \
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
922N/A# Dependencies for make build step
922N/ABUILD_DEPS = $(SOURCE_TARGETS) $(CONFIGURE_TARGETS) $(MODTYPE_BUILD_DEPS) $(MODULE_BUILD_DEPS) $(MODULE_MAKE)
922N/A
1124N/ADEFAULT_BUILD_COMMAND = cd @DIR@ ; \
1124N/A $(BUILD_ENV) $(MODULE_MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS)
493N/A
1124N/Adefault_build: $(BUILD_DEPS)
1124N/A $(DEFAULT_BUILD_COMMAND:@DIR@=$(SOURCE_DIR))
493N/A
493N/Abuild-in-subdir:
1124N/A $(DEFAULT_BUILD_COMMAND:@DIR@=$(subdir)) $(subdir_cmd)
493N/A
1132N/AINSTALL_ENV = $(BUILD_ENV) \
1132N/A INSTALL="$(INSTALL_SCRIPT)" CPPROG="cp -p" \
1132N/A $(MODTYPE_INSTALL_ENV) $(MODULE_INSTALL_ENV)
1132N/A
493N/ADEFAULT_INSTALL_MAKEFLAGS= -e DESTDIR=$(PROTODIR) \
851N/A pkgconfigdir=$(MODULE_PKGCONFIG_DIR) \
493N/A $(MODTYPE_MAKEFLAGS) $(MODULE_MAKEFLAGS) \
1132N/A $(MODTYPE_INSTALL_MAKEFLAGS) $(MODULE_INSTALL_MAKEFLAGS)
493N/A
591N/A# Dependencies for make install step
591N/AINSTALL_DEPS = $(BUILD_TARGETS) $(MODTYPE_INSTALL_DEPS) $(MODULE_INSTALL_DEPS)
591N/A
1124N/ADEFAULT_INSTALL_COMMAND = cd @DIR@ ; \
1132N/A $(INSTALL_ENV) $(MODULE_MAKE) $(MAKEFLAGS) $(DEFAULT_INSTALL_MAKEFLAGS)
493N/A
1124N/Adefault_install: $(INSTALL_DEPS)
1124N/A $(DEFAULT_INSTALL_COMMAND:@DIR@=$(SOURCE_DIR)) install
493N/A
935N/Ainstall-in-subdir:
1124N/A $(DEFAULT_INSTALL_COMMAND:@DIR@=$(subdir)) $(subdir_cmd) \
1124N/A $(install_subdir_cmd)
493N/A
606N/A# Adjust paths in pkg-config files for -uninstalled variants used during build
606N/AUNINSTALLED_PC_OPS= \
705N/A -e 'BEGIN {use Cwd; $$protodir=Cwd::realpath("$(PROTODIR)");}' \
705N/A -e 's|(-[LI]\s*)\$$|$$1$$protodir\$$|g;' \
705N/A -e 's|^sdkdir=|sdkdir=$$protodir|g;' \
837N/A -e 's|$$protodir\$${sdkdir}|\$${sdkdir}|g;' \
837N/A $(MODTYPE_ADD_UNINSTALLED_PC_OPS) $(MODULE_ADD_UNINSTALLED_PC_OPS)
606N/A
910N/AINSTALL_PCU_DEPS_DEFAULT = $(INSTALL_PCU_DEPS_SET:yes=$(POUND_SIGN))
910N/A$(INSTALL_PCU_DEPS_DEFAULT) INSTALL_PCU_DEPS = $(INSTALL_TARGETS)
910N/A
910N/Ainstall_pkgconfig_uninstalled: $(INSTALL_PCU_DEPS)
606N/A @ if [[ ! -z "$(FIX_PC_FILES)" ]] ; then \
606N/A cd $(SOURCE_DIR) ; \
606N/A for pcin in $(FIX_PC_FILES:.in=) ; do \
967N/A pc="$${pcin%%+(.pc|.in)}" ; \
967N/A pcu="$${pc##*/}-uninstalled.pc" ; \
851N/A ($(START_CMD_ECHO) ; \
967N/A rm -f $(PROTODIR)$(MODULE_PKGCONFIG_DIR)/$${pcu} ; \
935N/A $(PERL) -p $(UNINSTALLED_PC_OPS) $$pc.pc > \
967N/A $(PROTODIR)$(MODULE_PKGCONFIG_DIR)/$${pcu} ) ; \
606N/A done ; \
606N/A fi
606N/A
970N/A# Add links if needed from /usr/X11/* to new locations in /usr/*
970N/AX11_BINCOMPAT_DIR = $(PROTODIR)/usr/X11/bin
970N/AX11_BINCOMPAT_LINKS = $(MODULE_X11_BINCOMPAT_LINKS:%=$(X11_BINCOMPAT_DIR)/%)
970N/AX11_LIBCOMPAT_DIR = $(PROTODIR)/usr/X11/lib$(ARCHLIBSUBDIR)
970N/AX11_LIBCOMPAT_LINKS = $(MODULE_X11_LIBCOMPAT_LINKS:%=$(X11_LIBCOMPAT_DIR)/%)
970N/A
970N/A$(X11_BINCOMPAT_DIR) $(X11_LIBCOMPAT_DIR):
970N/A mkdir -p $@
970N/A
970N/A$(X11_BINCOMPAT_LINKS): $(X11_BINCOMPAT_DIR)
970N/A @rm -f $@
970N/A ln -s ../../bin/$(@F) $@
970N/A
970N/A$(X11_LIBCOMPAT_LINKS): $(X11_LIBCOMPAT_DIR)
970N/A @rm -f $@
970N/A @if [[ -z "$(ARCHLIBSUBDIR)" ]] ; then \
970N/A TARGETDIR=../../lib ; \
970N/A else \
970N/A TARGETDIR=../../../lib$(ARCHLIBSUBDIR) ; \
970N/A fi ; $(START_CMD_ECHO) ; \
970N/A ln -s $${TARGETDIR}/$(@F) $@
970N/A
970N/Ainstall_X11_compat_links: $(X11_BINCOMPAT_LINKS) $(X11_LIBCOMPAT_LINKS)
970N/A
591N/A# Set comments in ELF binaries to help identify versions/builds
1071N/A$(BUILD_DEBUG:yes=) DEBUG_ELF_COMMENTS=(DEBUG)
1071N/A$(BUILD_DEBUG:yes=) DEBUG_ELF_COMMENTS_FLAGS=-b -B 'hg id'
1071N/A$(BUILD_DEBUG:yes=$(POUND_SIGN)) DEBUG_ELF_COMMENTS=
1071N/A$(BUILD_DEBUG:yes=$(POUND_SIGN)) DEBUG_ELF_COMMENTS_FLAGS=
1071N/A
591N/AELF_COMMENTS = $(MODULE_NAME) $(MODULE_VERSION)
1071N/AELF_COMMENTS += $(DEBUG_ELF_COMMENTS)
591N/AELF_COMMENTS += $(MODTYPE_ELF_COMMENTS)$(MODULE_ELF_COMMENTS)
591N/A
1071N/AELF_COMMENTS_FLAGS = -M '$(ELF_COMMENTS)'
1071N/AELF_COMMENTS_FLAGS += $(DEBUG_ELF_COMMENTS_FLAGS)
994N/AELF_COMMENTS_FLAGS += $(MODTYPE_ELF_COMMENTS_FLAGS) $(MODULE_ELF_COMMENTS_FLAGS)
994N/A
810N/Aset-elf-comments: $(BUILD_TARGETS:set-elf-comments=)
1147N/A $(PERL) $(TOP)/open-src/common/set-elf-comments.pl \
1147N/A $(ELF_COMMENTS_FLAGS) $(SOURCE_DIR)
591N/A
970N/A# Help generate templates for package manifests
970N/ADEFAULT_LICENSE=$(PKG_LICENSE_DIR)/cr_Oracle $(PKG_LICENSE_DIR)/lic_X11
970N/A
970N/AMANIFEST_DEST=$(PWD)/tmp-proto-$(MACH)
1105N/AMANIFEST_TMP=$(PWD)/tmp.p5m
970N/A
970N/AMANIFEST_TARGETS_DEFAULT = $(MANIFEST_TARGETS_SET:yes=$(POUND_SIGN))
970N/A$(MANIFEST_TARGETS_DEFAULT) MANIFEST_TARGETS=$(MODULE_PKG_MANIFEST)
970N/A
970N/Amanifest: $(MANIFEST_TARGETS)
970N/A
970N/Amanifest-per-type: $(MODULE_PKG_MANIFEST)
970N/A
970N/AMANIFEST_INSTALL_RULES = PROTOTOOLSDIR="$(PROTODIR)" \
970N/A PROTODIR="$(MANIFEST_DEST)"
970N/A
970N/A$(MANIFEST_DEST): install
970N/A /usr/xpg4/bin/make $(MAKEFLAGS) install $(MANIFEST_INSTALL_RULES) \
970N/A || (rm -rf $(MANIFEST_DEST) ; exit 1)
970N/A
1207N/A$(MANIFEST_TMP): $(MANIFEST_DEST)
970N/A $(PERL) $(TOP)/open-src/common/pkg-manifest-generate.pl \
970N/A input_manifest='$(MODULE_PKG_MANIFEST)' \
1172N/A exception_manifest='$(PKG_SRC_DIR)/exceptions-validate_pkg.p5m' \
970N/A manifest_license='$(PKG_LICENSE_DIR)/cr_Oracle' \
970N/A manifest_license='$(PKG_LICENSE_DIR)/lic_X11' \
970N/A pkg_name='$(MODULE_PKGNAME)' \
970N/A source_dir='$(SOURCE_DIRNAME)' \
970N/A arch_64='$(ARCH64)' subdir_64='$(SUBDIR64)' \
970N/A proto_area='$(MANIFEST_DEST)' \
970N/A pkgfmt='$(PKGFMT)' \
1088N/A version='__version:$(MODULE_NAME)__' \
970N/A > $(MANIFEST_TMP)
970N/A -rm -rf $(MANIFEST_DEST)
970N/A
970N/A$(MODULE_PKG_MANIFEST): $(MANIFEST_TMP) $(PKG_MANIFEST_DIR)
970N/A mv -f $(MANIFEST_TMP) $@
970N/A
970N/A$(PKG_MANIFEST_DIR):
970N/A mkdir -p $(PKG_MANIFEST_DIR)
493N/A
1201N/A### Doc tools
1201N/A
1201N/A# Convert DocBook/XML to HTML (since Solaris doesn't bundle the xmlto tool
1201N/A# used by most upstream code to do this)
1201N/AXML_TO_HTML = /usr/bin/xsltproc --nonet --xinclude
1201N/AXML_TO_HTML += --stringparam html.stylesheet $(X11_SGML_DIR)/xorg.css
1201N/AXML_TO_HTML += --stringparam current.docid $(@F:.html=)
1201N/AXML_TO_HTML += --stringparam collect.xref.targets no
1201N/AXML_TO_HTML += --path "$(PROTODIR)$(X11_SGML_DIR) $(MODULE_XML_PATH)"
1201N/AXML_TO_HTML += $(TOP)/open-src/doc/xorg-sgml-doctools/xmltohtml.xsl
1201N/A
1201N/A# Convert HTML to text (also normally done by xmlto upstream)
1201N/AHTML_TO_TEXT = /usr/bin/w3m -dump -O UTF-8
1201N/A
1201N/A.SUFFIXES: .xml .html .txt
1201N/A
1201N/A.xml.html:
1201N/A $(XML_TO_HTML) $< > $@
1201N/A @ if [[ ! -s $@ ]] ; then print "xml to html failed" ; exit 1 ; fi
1201N/A
1201N/A.html.txt:
1201N/A $(HTML_TO_TEXT) $< > $@
1201N/A @ if [[ ! -s $@ ]] ; then print "html to text failed" ; exit 1 ; fi
1201N/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):
967N/A (cd $(TOP)/open-src/util/lndir && $(MAKE) $(MAKEFLAGS) install)
90N/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
935N/Aregen-patches:
47N/A CUR_LIST=""
47N/A rm -rf tmp-regen
935N/A $(MAKE) SOURCE_PATCHES="$(CUR_LIST)" BUILD_DIR=tmp-regen patched_source
47N/A mkdir -p new
47N/A for f in $(SOURCE_PATCHES) ; do \
922N/A p=$${f%,*} ; \
493N/A print '=================' $$p ; \
47N/A rm -rf prev ; \
47N/A mv tmp-regen prev ; \
935N/A $(MAKE) SOURCE_PATCHES="$${CUR_LIST} $$f" BUILD_DIR=tmp-regen patched_source ; \
1124N/A find tmp-regen -name '*.orig' -exec rm {} \+ ; \
935N/A gawk '/^--- / {exit} \
1124N/A /^diff -/ {exit} \
90N/A {print}' $$p > new/$$p ; \
1124N/A LC_COLLATE=C git diff --no-color ./prev ./tmp-regen \
1124N/A | sed -e 's% a/\./prev/$(SOURCE_DIRNAME)/% a/%' -e 's% b/\./tmp-regen/$(SOURCE_DIRNAME)/% b/%' \
47N/A | grep -v '^Common subdirectories:' \
47N/A | grep -v '^Only in ' \
90N/A >> new/$$p ; \
1124N/A CUR_LIST="$${CUR_LIST} new/$$p,-p1" ; \
47N/A done
47N/A rm -rf tmp-regen
355N/A
935N/A# Allows running "make list-patches" to get a list of all patches we
606N/A# currently apply in our builds
606N/Alist-patches:
922N/A @if [[ "$(SOURCE_PATCHES)" != "" ]] ; then \
970N/A THIS_MODULE="$${PWD##*/open-src/}" ; \
606N/A for p in $(SOURCE_PATCHES) x ; do \
606N/A if [[ "$$p" != "x" ]] ; then \
970N/A print "$${THIS_MODULE}/$${p%,*}" ; \
606N/A fi ; \
606N/A done ; \
606N/A fi
606N/A
970N/A### Metadata used in packaging
970N/A
970N/AMODULE_PKG_METADATA_DIR = $(PROTOMETA)/$(MODULE_PKG_MANIFEST_NAME)
970N/A
970N/A$(MODULE_PKG_METADATA_DIR):
970N/A mkdir -p $@
970N/A
970N/AMETADATA_TARGETS = $(MODULE_PKG_METADATA_DIR)
970N/A
970N/A# Base URL for ARC cases used in opensolaris.arc_url metadata
970N/A# Set to '$(ARC_URL)' here, resolved by pkgmogrify to the URL
970N/A# set in pkg/Makefile during the package building process
970N/AARC_URL_BASE = $$(ARC_URL)
970N/A
970N/A# Metadata about upstream
970N/AUPSTREAM_NONE = NONE
970N/AUPSTREAM_NONE_SET = yes
970N/A
970N/AUPSTREAM_xorg = X.Org Foundation
970N/AUPSTREAM_URL_xorg = http://www.x.org/
1123N/ASOURCE_URL_xorg = $(XORG_RELEASES_URL)/$(SOURCE_TARBALL_DIR)/$(SOURCE_TARBALL_NAME)
1123N/A
1123N/AUPSTREAM_xcb = The XCB Project
1123N/AUPSTREAM_URL_xcb = http://xcb.freedesktop.org/
1123N/ASOURCE_URL_xcb = http://xcb.freedesktop.org/dist/$(SOURCE_TARBALL_NAME)
1123N/A
1123N/AUPSTREAM_PROJECT_DEFAULT = $(UPSTREAM_PROJECT_SET:yes=$(POUND_SIGN))
1123N/A$(UPSTREAM_PROJECT_DEFAULT) UPSTREAM_PROJECT = xorg
970N/A
970N/AUPSTREAM_DEFAULT = $(UPSTREAM_SET:yes=$(POUND_SIGN))
970N/A$(UPSTREAM_DEFAULT) UPSTREAM = $(UPSTREAM_$(SOURCE_TARBALL_NAME))
970N/A$(UPSTREAM_DEFAULT) UPSTREAM_SET_YET = $(UPSTREAM_$(SOURCE_TARBALL_NAME)_SET)
970N/A$(UPSTREAM_DEFAULT) UPSTREAM_NOTFOUND = $(UPSTREAM_SET_YET:yes=$(POUND_SIGN))
1123N/A$(UPSTREAM_NOTFOUND) $(SOURCE_URL_DEFAULT) UPSTREAM = $(UPSTREAM_$(UPSTREAM_PROJECT))
1123N/A$(UPSTREAM_NOTFOUND) $(SOURCE_URL_DEFAULT) UPSTREAM_URL = $(UPSTREAM_URL_$(UPSTREAM_PROJECT))
970N/A
970N/A## Attributes files
970N/A
1105N/AATTRDATA_FILE_NAME = attributes_$(MODULE_NAME).p5m
970N/AATTRDATA_FILE = $(MODULE_PKG_METADATA_DIR)/$(ATTRDATA_FILE_NAME)
970N/A
970N/AMETADATA_TARGETS += $(ATTRDATA_FILE)
970N/A
970N/A# $${MODVERS//\.+(0)(\d)/.\2} - ksh93 pattern substitution to remove leading
970N/A# 0's from package version number components, to meet pkg(5) fmri requirements
970N/A%/$(ATTRDATA_FILE_NAME): %
970N/A -rm -f $@
970N/A @if [[ "$(SOURCE_TARBALL_NAME)" != "NONE" ]] ; then \
970N/A $(START_CMD_ECHO) ; \
1162N/A print 'set name=info.source-url value="$(SOURCE_URL)"' >> $@ ; \
970N/A fi
970N/A @if [[ "$(UPSTREAM)" != "NONE" ]] ; then \
970N/A $(START_CMD_ECHO) ; \
970N/A print 'set name=info.upstream value="$(UPSTREAM)"' >> $@ ; \
1162N/A print 'set name=info.upstream-url value="$(UPSTREAM_URL)"' >> $@ ; \
970N/A fi
970N/A @if [[ ! -z "$(MODULE_ARC_CASES)" ]] ; then \
970N/A $(START_CMD_ECHO) ; \
1162N/A print 'set name=org.opensolaris.arc-caseid' \
1162N/A '$(MODULE_ARC_CASES:%=value="%")' >> $@ ; \
970N/A fi
970N/A @if [[ ! -z "$(MODULE_PKGCLASS)" ]] ; then \
970N/A $(START_CMD_ECHO) ; \
970N/A print 'set name=info.classification' \
970N/A 'value="org.opensolaris.category.2008:$(MODULE_PKGCLASS)"' \
970N/A >> $@ ; \
970N/A fi
970N/A @ MODVERS="$(MODULE_VERSION)" ; $(START_CMD_ECHO) ; \
970N/A printf '<transform set -> edit value __version:$(MODULE_NAME)__ %s>\n' \
970N/A "$${MODVERS//\.+(0)(\d)/.\2}" >> $@
970N/A $(MODTYPE_ATTRDATA_COMMANDS)
970N/A $(MODULE_ATTRDATA_COMMANDS)
970N/A
970N/A## License 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.
355N/ALICENSE_FILE_DEFAULT = $(LICENSE_FILE_SET:yes=$(POUND_SIGN))
355N/A$(LICENSE_FILE_DEFAULT) LICENSE_FILE=COPYING
355N/A
1003N/A# Default is the MIT/X11 license
1003N/AMIT_LICENSE_NAME = MIT License ($(MODULE_NAME))
1003N/AMIT_LICENSE_FILE = $(PKG_SRC_DIR)/license_files/lic_X11
1003N/A
1003N/AMODULE_LICENSE_DEFAULT = $(MODULE_LICENSE_SET:yes=$(POUND_SIGN))
1003N/A$(MODULE_LICENSE_DEFAULT) MODULE_LICENSE = $(MIT_LICENSE_NAME)
1003N/A
1003N/A# Some packages contain only code that Oracle owns all the rights to.
1003N/A# For these, Makefile.options.oracle.com chooses to omit the license
1003N/A# notice when Oracle is building its distros. Everyone else gets the
1003N/A# notice required by open source license Oracle released the code under.
1003N/ALICENSE_CHOICE_DEFAULT = $(LICENSE_CHOICE_SET:yes=$(POUND_SIGN))
1003N/A$(LICENSE_CHOICE_DEFAULT) LICENSE_CHOICE=open
1003N/A
1003N/AORACLE_LICENSE_NAME_open = $(MIT_LICENSE_NAME)
1003N/AORACLE_LICENSE_APPEND_open = $(MIT_LICENSE_FILE)
1003N/A
1003N/AORACLE_LICENSE_NAME_Oracle = Oracle Copyright Notice ($(MODULE_NAME))
1003N/AORACLE_LICENSE_APPEND_Oracle = # Nothing to append to copyright notice
1003N/A
1003N/AORACLE_LICENSE_NAME = $(ORACLE_LICENSE_NAME_$(LICENSE_CHOICE))
1003N/AORACLE_LICENSE_PREPEND = # Nothing to prepend to copyright notice
1003N/AORACLE_LICENSE_APPEND = $(ORACLE_LICENSE_APPEND_$(LICENSE_CHOICE))
1003N/A
1003N/A# Use default license info unless MODULE_LICENSE = "Oracle"
1003N/ALICENSE_NAME = $(MODULE_LICENSE)
1003N/ALICENSE_PREPEND = $(MODULE_LICENSE_PREPEND)
1003N/ALICENSE_APPEND = $(MODULE_LICENSE_APPEND)
1003N/A
1003N/ALICENSE_OVERRIDE_1 = $(POUND_SIGN)$(MODULE_LICENSE)
1003N/ALICENSE_OVERRIDE = $(LICENSE_OVERRIDE_1:$(POUND_SIGN)Oracle%=)
1003N/A$(LICENSE_OVERRIDE) LICENSE_NAME = $(ORACLE_LICENSE_NAME)
1003N/A$(LICENSE_OVERRIDE) LICENSE_PREPEND = $(ORACLE_LICENSE_PREPEND)
1003N/A$(LICENSE_OVERRIDE) LICENSE_APPEND = $(ORACLE_LICENSE_APPEND)
1003N/A
970N/ALICENSE_FILE_NAME = license_$(MODULE_NAME)
970N/ALICENSE_FILE_DEST = $(MODULE_PKG_METADATA_DIR)/$(LICENSE_FILE_NAME)
1105N/ALICENSE_ATTR_FILE = $(MODULE_PKG_METADATA_DIR)/$(LICENSE_FILE_NAME).p5m
922N/A
970N/Ainstall_license: $(LICENSE_FILE_DEST)
970N/AMETADATA_TARGETS += $(LICENSE_FILE_DEST)
922N/A
970N/A%/$(LICENSE_FILE_NAME): % $(SOURCE_TARGETS)
922N/A @ $(START_CMD_ECHO) ; \
970N/A if [[ -f "$(LICENSE_FILE)" ]] ; then \
1003N/A license_to_copy="$(LICENSE_FILE)" ; \
970N/A elif [[ -f "$(SOURCE_DIR)/$(LICENSE_FILE)" ]] ; then \
1003N/A license_to_copy="$(SOURCE_DIR)/$(LICENSE_FILE)" ; \
493N/A fi ; \
1003N/A if [[ -n "$${license_to_copy}" ]] ; then \
1003N/A cat $(LICENSE_PREPEND) "$${license_to_copy}" $(LICENSE_APPEND) > "$@" ; \
1105N/A print 'license $(LICENSE_FILE_NAME) license="$(LICENSE_NAME)"' > "$@.p5m" ; \
355N/A fi
970N/A
970N/Ainstall_metadata: $(METADATA_TARGETS)