Makefile revision 98
765N/A###############################################################################
765N/A#
955N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
435N/A# Use subject to license terms.
435N/A#
435N/A# Permission is hereby granted, free of charge, to any person obtaining a
435N/A# copy of this software and associated documentation files (the
435N/A# "Software"), to deal in the Software without restriction, including
435N/A# without limitation the rights to use, copy, modify, merge, publish,
435N/A# distribute, and/or sell copies of the Software, and to permit persons
435N/A# to whom the Software is furnished to do so, provided that the above
435N/A# copyright notice(s) and this permission notice appear in all copies of
435N/A# the Software and that both the above copyright notice(s) and this
435N/A# permission notice appear in supporting documentation.
435N/A#
955N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
570N/A# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
570N/A# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
570N/A# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
955N/A# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
570N/A# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
570N/A# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
570N/A# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
570N/A# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
955N/A#
570N/A# Except as contained in this notice, the name of a copyright holder
570N/A# shall not be used in advertising or otherwise to promote the sale, use
955N/A# or other dealings in this Software without prior written authorization
955N/A# of the copyright holder.
955N/A#
570N/A# @(#)Makefile 1.5 07/01/31
570N/A#
955N/A
765N/APWD:sh=pwd
765N/ATOP=$(PWD)/../..
955N/A
435N/A# Build 32-bit, 64-bit, or both?
435N/ABUILD_TYPES=32 64
435N/A
435N/A# Version number (used in path names)
435N/AMESA_VERS=6.5.2
435N/A
435N/A# Source tarball
435N/ASOURCE_TARBALL_NAME=MesaLib-$(MESA_VERS).tar.bz2
435N/A
435N/A# Download site for source
435N/ASOURCE_URL=http://easynews.dl.sourceforge.net/sourceforge/mesa3d/$(SOURCE_TARBALL_NAME)
435N/A
955N/A# Patches to apply to source after unpacking, in order
570N/ASOURCE_PATCHES= \
570N/A solaris-paths.patch \
570N/A mklib.patch \
955N/A solaris-dri-port.patch \
570N/A glext.h.patch
570N/A
570N/A# Directory created by unpacking source
570N/ASOURCE_DIR=$(BUILD_DIR)/Mesa-$(MESA_VERS)
955N/A
570N/A# Library built in tree
570N/AMESA_LIB=$(SOURCE_DIR)/lib/libGL.so.1
955N/A
955N/A# Where to install most files
955N/AMESA_prefix=$(PROTODIR)$(X11_DIR)
570N/A
570N/A# Where to install libraries
955N/AMESA_libdir=$(MESA_prefix)/lib
765N/A
765N/A# What to build
955N/ABUILD_TARGETS=$(GNUMAKE) $(MESA_LIB)
570N/A
570N/A### Include common rulesets
955N/Ainclude $(TOP)/common/Makefile.inc
955N/A
955N/A### Rules specific to this directory:
570N/A
570N/A# Merge in additional sources from sun-src directory
955N/Asource_gen:: $(LNDIR)
765N/A mkdir -p $(SOURCE_DIR)
765N/A (cd $(SOURCE_DIR) && $(LNDIR) ../../sun-src)
955N/A
570N/AMESA_CFG_32_sun4=sunos5-v8
570N/AMESA_CFG_64_sun4=sunos5-v9
570N/A
955N/A# Build with gcc on x86:
765N/AMESA_CFLAGS=$(DEFAULT_GCC_CFLAGS) $(ARCH_GCC_FLAGS) -D_REENTRANT
570N/AMESA_CFG_32_i86pc=solaris-x86-gcc-dri
570N/AMESA_CFG_64_i86pc=solaris-x64-gcc-dri
570N/A
570N/A# Build with Sun Studio cc on x86:
955N/A#MESA_CFLAGS=$(LIB_CFLAGS)
955N/A#MESA_CFG_32_i86pc=solaris-x86-cc-dri
955N/A#MESA_CFG_64_i86pc=solaris-x64-cc-dri
570N/A
570N/AMESA_CFG_32:sh=arch | sed 's/^\(.*\)$/\$\(MESA_CFG_32_\1\)/'
570N/AMESA_CFG_64:sh=arch | sed 's/^\(.*\)$/\$\(MESA_CFG_64_\1\)/'
765N/A
765N/ABUILD_32_FLAGS=ARCH_GCC_FLAGS="$(ARCH32_GCC_FLAGS)" MESA_CFG=$(MESA_CFG_32)
955N/ABUILD_64_FLAGS=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)" MESA_CFG=$(MESA_CFG_64)
570N/A
570N/A# pkg-config --cflags libdrm
955N/ALIBDRM_CFLAGS = -I$(PROTODIR)$(X11_INCLUDES_DIR) -I$(PROTODIR)$(X11_INCLUDES_DIR)/drm
955N/A# pkg-config --libs libdrm
955N/ALIBDRM_LIB = -L$(PROTODIR)$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) -R$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) -ldrm
570N/A
570N/AMESA_INCLUDES= -I$(PROTODIR)$(X11_INCLUDES_DIR)
955N/A
765N/AMESA_MAKEVARS= SHELL=/bin/ksh PASSED_CFLAGS="$(MESA_CFLAGS)" PASSED_INCLUDES="$(MESA_INCLUDES)" ARCH_FLAGS="" LIBDRM_CFLAGS="$(LIBDRM_CFLAGS)" LIBDRM_LIB="$(LIBDRM_LIB)"
765N/A
570N/AMESA_MAKEENV= PKG_CONFIG_PATH=$(PROTODIR)/usr/lib$(ARCHLIBSUBDIR)/pkgconfig:$(TOP)/common/pc-files/$(BUILD_DIR):/usr/lib$(ARCHLIBSUBDIR)/pkgconfig
570N/A# LD_OPTIONS="$(LIB_REQUIRED_LDFLAGS)"
570N/A
955N/A# Build Mesa
955N/A$(MESA_LIB): $(GNUMAKE) $(UNPACK_TARGET)
955N/A (cd $(SOURCE_DIR)/configs && rm -f current && ln -s $(MESA_CFG) current)
570N/A (cd $(SOURCE_DIR) && $(MESA_MAKEENV) $(GNUMAKE) $(MFLAGS) -e $(MESA_MAKEVARS) default)
570N/A
955N/Ainstall_gen: $(MESA_LIB)
765N/A (cd $(SOURCE_DIR) && $(GNUMAKE) $(MFLAGS) -e DESTDIR=$(PROTODIR) ARCHLIBSUBDIR=$(ARCHLIBSUBDIR) install )
765N/A
955N/A
570N/A