Makefile revision 493
bba1e274cf727c39b4f1dd8970539a2bb967f20fLiam O'Reilly###############################################################################
bba1e274cf727c39b4f1dd8970539a2bb967f20fLiam O'Reilly#
d9c1248c7972dfdafbacb1b73b2eb965eac9ef42Liam O'Reilly# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
bba1e274cf727c39b4f1dd8970539a2bb967f20fLiam O'Reilly# Use subject to license terms.
bba1e274cf727c39b4f1dd8970539a2bb967f20fLiam O'Reilly#
bba1e274cf727c39b4f1dd8970539a2bb967f20fLiam O'Reilly# Permission is hereby granted, free of charge, to any person obtaining a
bba1e274cf727c39b4f1dd8970539a2bb967f20fLiam O'Reilly# copy of this software and associated documentation files (the
bba1e274cf727c39b4f1dd8970539a2bb967f20fLiam O'Reilly# "Software"), to deal in the Software without restriction, including
bba1e274cf727c39b4f1dd8970539a2bb967f20fLiam O'Reilly# without limitation the rights to use, copy, modify, merge, publish,
bba1e274cf727c39b4f1dd8970539a2bb967f20fLiam O'Reilly# distribute, and/or sell copies of the Software, and to permit persons
bba1e274cf727c39b4f1dd8970539a2bb967f20fLiam O'Reilly# to whom the Software is furnished to do so, provided that the above
bba1e274cf727c39b4f1dd8970539a2bb967f20fLiam O'Reilly# copyright notice(s) and this permission notice appear in all copies of
bba1e274cf727c39b4f1dd8970539a2bb967f20fLiam O'Reilly# the Software and that both the above copyright notice(s) and this
bba1e274cf727c39b4f1dd8970539a2bb967f20fLiam O'Reilly# permission notice appear in supporting documentation.
fd8af3ecf2dff782cb2496c1c9bf9d0a76faa98bLiam O'Reilly#
fd8af3ecf2dff782cb2496c1c9bf9d0a76faa98bLiam O'Reilly# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
fd8af3ecf2dff782cb2496c1c9bf9d0a76faa98bLiam O'Reilly# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
bba1e274cf727c39b4f1dd8970539a2bb967f20fLiam O'Reilly# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
bba1e274cf727c39b4f1dd8970539a2bb967f20fLiam O'Reilly# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
bba1e274cf727c39b4f1dd8970539a2bb967f20fLiam O'Reilly# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
bba1e274cf727c39b4f1dd8970539a2bb967f20fLiam O'Reilly# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
fd8af3ecf2dff782cb2496c1c9bf9d0a76faa98bLiam O'Reilly# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
d9c1248c7972dfdafbacb1b73b2eb965eac9ef42Liam O'Reilly# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
d9c1248c7972dfdafbacb1b73b2eb965eac9ef42Liam O'Reilly# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
d9c1248c7972dfdafbacb1b73b2eb965eac9ef42Liam O'Reilly#
fd8af3ecf2dff782cb2496c1c9bf9d0a76faa98bLiam O'Reilly# Except as contained in this notice, the name of a copyright holder
fd8af3ecf2dff782cb2496c1c9bf9d0a76faa98bLiam O'Reilly# shall not be used in advertising or otherwise to promote the sale, use
fd8af3ecf2dff782cb2496c1c9bf9d0a76faa98bLiam O'Reilly# or other dealings in this Software without prior written authorization
fd8af3ecf2dff782cb2496c1c9bf9d0a76faa98bLiam O'Reilly# of the copyright holder.
d9c1248c7972dfdafbacb1b73b2eb965eac9ef42Liam O'Reilly#
d9c1248c7972dfdafbacb1b73b2eb965eac9ef42Liam O'Reilly# @(#)Makefile 1.10 08/08/08
fd8af3ecf2dff782cb2496c1c9bf9d0a76faa98bLiam O'Reilly#
d9c1248c7972dfdafbacb1b73b2eb965eac9ef42Liam O'Reilly
d9c1248c7972dfdafbacb1b73b2eb965eac9ef42Liam O'Reilly# Package name used in tarballs
bba1e274cf727c39b4f1dd8970539a2bb967f20fLiam O'ReillyMODULE_NAME=MesaDemos
bba1e274cf727c39b4f1dd8970539a2bb967f20fLiam O'Reilly
# Version number (used in path names)
MODULE_VERSION=6.5.2
# Directory created by unpacking source
SOURCE_DIRNAME=Mesa-$(MODULE_VERSION)
SOURCE_DIRNAME_SET=yes
SOURCE_DIR=$(BUILD_DIR)/$(SOURCE_DIRNAME)
# Source tarball
SOURCE_TARBALL_NAME=MesaDemos-$(MODULE_VERSION).tar.bz2
SOURCE_TARBALL_NAME_SET=yes
# Download site for source
SOURCE_URL=$(SF_DOWNLOADS_URL)/mesa3d/$(SOURCE_TARBALL_NAME)
SOURCE_URL_SET=yes
# Patches to apply to source after unpacking, in order
SOURCE_PATCHES= \
null-display.patch \
Xorg-6.9-changes.patch
# Binaries built in tree
GLXGEARS_BIN=$(SOURCE_DIR)/progs/xdemos/glxgears
GLXINFO_BIN=$(SOURCE_DIR)/progs/xdemos/glxinfo
# Where to install files
MESA_prefix=$(PROTODIR)$(X11_DIR)
# 6.5.2 doesn't use autoconf, just links configuration files
CONFIGURE_TARGETS=$(SOURCE_DIR)/configs/current
CONFIGURE_TARGETS_SET=yes
# What to build
BUILD_TARGETS_sparc=$(GLXGEARS_BIN)
BUILD_TARGETS_i386=$(GLXGEARS_BIN) $(GLXINFO_BIN)
BUILD_TARGETS= $(BUILD_TARGETS_$(MACH))
BUILD_TARGETS_SET=yes
# What to install
INSTALL_TARGETS_sparc=install_glxgears install_man
INSTALL_TARGETS_i386=install_glxgears install_glxinfo install_man
INSTALL_TARGETS= $(INSTALL_TARGETS_$(MACH))
INSTALL_TARGETS_SET=yes
### Include common rulesets
include ../Makefile.inc
### Rules specific to this directory:
# Merge in additional sources from Mesa library sun-src directory
source_gen:: $(LNDIR)
mkdir -p $(SOURCE_DIR)
(cd $(SOURCE_DIR) && $(LNDIR) ../../../../lib/mesa/sun-src)
(cd $(SOURCE_DIR)/configs && touch default)
# Only care about building X demos
DEMOS_DIR=$(SOURCE_DIR)/progs/xdemos
# Mesa config file names
MESA_CFG_32_sparc=solaris-sparcv8-cc
MESA_CFG_64_sparc=solaris-sparcv9-cc
MESA_CFG_32_i386=solaris-x86-cc-dri
MESA_CFG_64_i386=solaris-x64-cc-dri
MESA_CFG_32= $(MESA_CFG_32_$(MACH))
MESA_CFG_64= $(MESA_CFG_64_$(MACH))
MODULE_BUILD_32_FLAGS= MESA_CFG=$(MESA_CFG_32)
MODULE_BUILD_64_FLAGS= MESA_CFG=$(MESA_CFG_64)
# Flags passed on make command line when building
ADD_MAKE_FLAGS = X11_INCLUDES="-I$(PROTODIR)$(X11_INCLUDES_DIR)" \
LDFLAGS="$(PROG_LDFLAGS) -L$(PROTODIR)$(X11_DIR)/lib$(ARCHLIBSUBDIR)"
# 6.5.2 doesn't use autoconf, just links configuration files
$(SOURCE_DIR)/configs/current: $(UNPACK_TARGET)
(cd $(SOURCE_DIR)/configs && \
rm -f current && \
ln -s $(MESA_CFG) current )
# Build Mesa demos
$(GLXGEARS_BIN): $(UNPACK_TARGET) $(CONFIGURE_TARGETS)
(cd $(DEMOS_DIR) && $(MAKE) $(MAKEFLAGS) $(ADD_MAKE_FLAGS) glxgears )
$(GLXINFO_BIN): $(UNPACK_TARGET) $(CONFIGURE_TARGETS)
(cd $(DEMOS_DIR) && $(MAKE) $(MAKEFLAGS) $(ADD_MAKE_FLAGS) glxinfo )
# For testing - we don't ship the rest of these
all-xdemos_gen: $(UNPACK_TARGET) $(CONFIGURE_TARGETS)
(cd $(DEMOS_DIR) && $(MAKE) $(MAKEFLAGS) $(ADD_MAKE_FLAGS) )
all-xdemos:
$(MAKE) $(MAKEFLAGS) $(BUILD_32_FLAGS) all-xdemos_gen
install_gen:: $(INSTALL_TARGETS)
install_glxgears: $(GLXGEARS_BIN)
mkdir -p $(MESA_prefix)/bin
cp -pf $(GLXGEARS_BIN) $(MESA_prefix)/bin
install_glxinfo: $(GLXINFO_BIN)
mkdir -p $(MESA_prefix)/bin
cp -pf $(GLXINFO_BIN) $(MESA_prefix)/bin
install_man:
mkdir -p $(MESA_prefix)/share/man/man1
cp -pf glxgears.1 glxinfo.1 $(MESA_prefix)/share/man/man1