Makefile revision 400
0782f6cf216295b70cd608451422f5db560f2cf0kess###############################################################################
0782f6cf216295b70cd608451422f5db560f2cf0kess#
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd# Use subject to license terms.
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd#
0782f6cf216295b70cd608451422f5db560f2cf0kess# Permission is hereby granted, free of charge, to any person obtaining a
0782f6cf216295b70cd608451422f5db560f2cf0kess# copy of this software and associated documentation files (the
0782f6cf216295b70cd608451422f5db560f2cf0kess# "Software"), to deal in the Software without restriction, including
0782f6cf216295b70cd608451422f5db560f2cf0kess# without limitation the rights to use, copy, modify, merge, publish,
96ad5d81ee4a2cc66a4ae19893efc8aa6d06fae7jailletc# distribute, and/or sell copies of the Software, and to permit persons
0782f6cf216295b70cd608451422f5db560f2cf0kess# to whom the Software is furnished to do so, provided that the above
0782f6cf216295b70cd608451422f5db560f2cf0kess# copyright notice(s) and this permission notice appear in all copies of
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen# the Software and that both the above copyright notice(s) and this
2e545ce2450a9953665f701bb05350f0d3f26275nd# permission notice appear in supporting documentation.
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen#
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
0782f6cf216295b70cd608451422f5db560f2cf0kess# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
0782f6cf216295b70cd608451422f5db560f2cf0kess# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
3f08db06526d6901aa08c110b5bc7dde6bc39905nd# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
0782f6cf216295b70cd608451422f5db560f2cf0kess# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
0782f6cf216295b70cd608451422f5db560f2cf0kess# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
0782f6cf216295b70cd608451422f5db560f2cf0kess# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
3f08db06526d6901aa08c110b5bc7dde6bc39905nd# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
0782f6cf216295b70cd608451422f5db560f2cf0kess#
0782f6cf216295b70cd608451422f5db560f2cf0kess# Except as contained in this notice, the name of a copyright holder
0782f6cf216295b70cd608451422f5db560f2cf0kess# shall not be used in advertising or otherwise to promote the sale, use
0782f6cf216295b70cd608451422f5db560f2cf0kess# or other dealings in this Software without prior written authorization
af84459fbf938e508fd10b01cb8d699c79083813takashi# of the copyright holder.
4b3a8afbfcea8b265d179a122bf40dfedd1ce280takashi#
fac8c35bfb158112226ab43ddf84d59daca5dc30nd# @(#)Makefile 1.11 08/03/24
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung#
0782f6cf216295b70cd608451422f5db560f2cf0kess
4b575a6b6704b516f22d65a3ad35696d7b9ba372rpluemPWD:sh=pwd
4b575a6b6704b516f22d65a3ad35696d7b9ba372rpluemTOP=$(PWD)/../..
4b575a6b6704b516f22d65a3ad35696d7b9ba372rpluem
0782f6cf216295b70cd608451422f5db560f2cf0kess# Build 32-bit, 64-bit, or both?
0782f6cf216295b70cd608451422f5db560f2cf0kessBUILD_TYPES=32 64
0782f6cf216295b70cd608451422f5db560f2cf0kessBUILD_TYPES_SET=yes
0782f6cf216295b70cd608451422f5db560f2cf0kess
0782f6cf216295b70cd608451422f5db560f2cf0kess# Version number (used in path names)
0782f6cf216295b70cd608451422f5db560f2cf0kessMESA_VERS=6.5.2
0782f6cf216295b70cd608451422f5db560f2cf0kess
0782f6cf216295b70cd608451422f5db560f2cf0kess# Source tarball
0782f6cf216295b70cd608451422f5db560f2cf0kessSOURCE_TARBALL_NAME=MesaLib-$(MESA_VERS).tar.bz2
0782f6cf216295b70cd608451422f5db560f2cf0kess
0782f6cf216295b70cd608451422f5db560f2cf0kess# Download site for source
0782f6cf216295b70cd608451422f5db560f2cf0kessSOURCE_URL=$(SF_DOWNLOADS_URL)/mesa3d/$(SOURCE_TARBALL_NAME)
0782f6cf216295b70cd608451422f5db560f2cf0kessSOURCE_URL_SET=yes
0782f6cf216295b70cd608451422f5db560f2cf0kess
d1348237b33bc1755b9f1165eea52317465a7671nd# Patches to apply to source after unpacking, in order
0782f6cf216295b70cd608451422f5db560f2cf0kessSOURCE_PATCHES= \
0782f6cf216295b70cd608451422f5db560f2cf0kess solaris-paths.patch \
0782f6cf216295b70cd608451422f5db560f2cf0kess mklib.patch \
0782f6cf216295b70cd608451422f5db560f2cf0kess solaris-dri-port.patch \
0782f6cf216295b70cd608451422f5db560f2cf0kess glext.h.patch \
d1348237b33bc1755b9f1165eea52317465a7671nd glxext.h.patch \
0782f6cf216295b70cd608451422f5db560f2cf0kess 6538497.patch \
b21197dc8e6b8c764fdcc24d4bae8b0eebb6bc4end 6559710.patch \
0782f6cf216295b70cd608451422f5db560f2cf0kess mesa965.patch \
0782f6cf216295b70cd608451422f5db560f2cf0kess maxtexunit.patch
20189240503ef2c8f5dc6e2248b57faab4b23b5and
20189240503ef2c8f5dc6e2248b57faab4b23b5and# Directory created by unpacking source
20189240503ef2c8f5dc6e2248b57faab4b23b5andSOURCE_DIR=$(BUILD_DIR)/Mesa-$(MESA_VERS)
20189240503ef2c8f5dc6e2248b57faab4b23b5and
20189240503ef2c8f5dc6e2248b57faab4b23b5and# Library built in tree
20189240503ef2c8f5dc6e2248b57faab4b23b5andMESA_LIB=$(SOURCE_DIR)/lib/libGL.so.1
20189240503ef2c8f5dc6e2248b57faab4b23b5and
20189240503ef2c8f5dc6e2248b57faab4b23b5and# Where to install most files
20189240503ef2c8f5dc6e2248b57faab4b23b5andMESA_prefix=$(PROTODIR)$(X11_DIR)
0782f6cf216295b70cd608451422f5db560f2cf0kess
0782f6cf216295b70cd608451422f5db560f2cf0kess# Where to install libraries
0782f6cf216295b70cd608451422f5db560f2cf0kessMESA_libdir=$(MESA_prefix)/lib
0782f6cf216295b70cd608451422f5db560f2cf0kess
0782f6cf216295b70cd608451422f5db560f2cf0kess# What to build
0782f6cf216295b70cd608451422f5db560f2cf0kessBUILD_TARGETS=$(GNUMAKE) $(MESA_LIB)
0782f6cf216295b70cd608451422f5db560f2cf0kess
0782f6cf216295b70cd608451422f5db560f2cf0kess### Include common rulesets
0782f6cf216295b70cd608451422f5db560f2cf0kessinclude $(TOP)/common/Makefile.inc
0782f6cf216295b70cd608451422f5db560f2cf0kess
0782f6cf216295b70cd608451422f5db560f2cf0kess### Rules specific to this directory:
0782f6cf216295b70cd608451422f5db560f2cf0kess
0782f6cf216295b70cd608451422f5db560f2cf0kess# Merge in additional sources from sun-src directory
0782f6cf216295b70cd608451422f5db560f2cf0kesssource_gen:: $(LNDIR)
0782f6cf216295b70cd608451422f5db560f2cf0kess mkdir -p $(SOURCE_DIR)
0782f6cf216295b70cd608451422f5db560f2cf0kess (cd $(SOURCE_DIR) && $(LNDIR) ../../sun-src)
0782f6cf216295b70cd608451422f5db560f2cf0kess
0782f6cf216295b70cd608451422f5db560f2cf0kessMESA_CFG_32_sparc=sunos5-v8
0782f6cf216295b70cd608451422f5db560f2cf0kessMESA_CFG_64_sparc=sunos5-v9
0782f6cf216295b70cd608451422f5db560f2cf0kess
0782f6cf216295b70cd608451422f5db560f2cf0kess# Build with gcc on x86:
0782f6cf216295b70cd608451422f5db560f2cf0kessMESA_CFLAGS=$(DEFAULT_GCC_CFLAGS) $(ARCH_GCC_FLAGS) -D_REENTRANT
0782f6cf216295b70cd608451422f5db560f2cf0kessMESA_CFG_32_i386=solaris-x86-gcc-dri
0782f6cf216295b70cd608451422f5db560f2cf0kessMESA_CFG_64_i386=solaris-x64-gcc-dri
d1348237b33bc1755b9f1165eea52317465a7671nd
d1348237b33bc1755b9f1165eea52317465a7671nd# Build with Sun Studio cc on x86:
d1348237b33bc1755b9f1165eea52317465a7671nd#MESA_CFLAGS=$(LIB_CFLAGS)
0782f6cf216295b70cd608451422f5db560f2cf0kess#MESA_CFG_32_i386=solaris-x86-cc-dri
0782f6cf216295b70cd608451422f5db560f2cf0kess#MESA_CFG_64_i386=solaris-x64-cc-dri
0782f6cf216295b70cd608451422f5db560f2cf0kess
0782f6cf216295b70cd608451422f5db560f2cf0kessMESA_CFG_32 = $(MESA_CFG_32_$(MACH))
0782f6cf216295b70cd608451422f5db560f2cf0kessMESA_CFG_64 = $(MESA_CFG_64_$(MACH))
0782f6cf216295b70cd608451422f5db560f2cf0kess
0782f6cf216295b70cd608451422f5db560f2cf0kessBUILD_32_FLAGS=ARCH_GCC_FLAGS="$(ARCH32_GCC_FLAGS)" MESA_CFG=$(MESA_CFG_32)
0782f6cf216295b70cd608451422f5db560f2cf0kessBUILD_64_FLAGS=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)" MESA_CFG=$(MESA_CFG_64)
0782f6cf216295b70cd608451422f5db560f2cf0kess
0782f6cf216295b70cd608451422f5db560f2cf0kess# pkg-config --cflags libdrm
0782f6cf216295b70cd608451422f5db560f2cf0kessLIBDRM_CFLAGS = -I$(PROTODIR)$(X11_INCLUDES_DIR) -I$(PROTODIR)$(X11_INCLUDES_DIR)/drm
0782f6cf216295b70cd608451422f5db560f2cf0kess# pkg-config --libs libdrm
0782f6cf216295b70cd608451422f5db560f2cf0kessLIBDRM_LIB = -L$(PROTODIR)$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) -R$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) -ldrm
0782f6cf216295b70cd608451422f5db560f2cf0kess
d1348237b33bc1755b9f1165eea52317465a7671ndMESA_INCLUDES= -I$(PROTODIR)$(X11_INCLUDES_DIR)
d1348237b33bc1755b9f1165eea52317465a7671nd
0782f6cf216295b70cd608451422f5db560f2cf0kessMESA_MAKEVARS= SHELL=/bin/ksh PASSED_CFLAGS="$(MESA_CFLAGS)" PASSED_INCLUDES="$(MESA_INCLUDES)" ARCH_FLAGS="" LIBDRM_CFLAGS="$(LIBDRM_CFLAGS)" LIBDRM_LIB="$(LIBDRM_LIB)"
0782f6cf216295b70cd608451422f5db560f2cf0kess
0782f6cf216295b70cd608451422f5db560f2cf0kessMESA_MAKEENV= PKG_CONFIG_PATH=$(PROTODIR)/usr/lib$(ARCHLIBSUBDIR)/pkgconfig:$(TOP)/common/pc-files/$(BUILD_DIR):/usr/lib$(ARCHLIBSUBDIR)/pkgconfig
0782f6cf216295b70cd608451422f5db560f2cf0kess# LD_OPTIONS="$(LIB_REQUIRED_LDFLAGS)"
0782f6cf216295b70cd608451422f5db560f2cf0kess
0782f6cf216295b70cd608451422f5db560f2cf0kess# Build Mesa
0782f6cf216295b70cd608451422f5db560f2cf0kess$(MESA_LIB): $(GNUMAKE) $(UNPACK_TARGET)
0782f6cf216295b70cd608451422f5db560f2cf0kess (cd $(SOURCE_DIR)/configs && rm -f current && ln -s $(MESA_CFG) current)
0782f6cf216295b70cd608451422f5db560f2cf0kess (cd $(SOURCE_DIR) && $(MESA_MAKEENV) $(GNUMAKE) $(MFLAGS) -e $(MESA_MAKEVARS) default)
0782f6cf216295b70cd608451422f5db560f2cf0kess
0782f6cf216295b70cd608451422f5db560f2cf0kessinstall_gen:: $(MESA_LIB)
0782f6cf216295b70cd608451422f5db560f2cf0kess (cd $(SOURCE_DIR) && $(GNUMAKE) $(MFLAGS) -e DESTDIR=$(PROTODIR) ARCHLIBSUBDIR=$(ARCHLIBSUBDIR) install )
0782f6cf216295b70cd608451422f5db560f2cf0kess
0782f6cf216295b70cd608451422f5db560f2cf0kess
0782f6cf216295b70cd608451422f5db560f2cf0kess