Makefile revision 286
9eb24f1f84885d5c2e51a7f675264db398c31af7Tinderbox User###############################################################################
7bd455641455950eff7d21be652c8142b134d32fTinderbox User#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Use subject to license terms.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews#
8cbf3b6fc35091abde426930f2eadb8f53476c98Evan Hunt# Permission is hereby granted, free of charge, to any person obtaining a
866d106459313499d0ca7bfccb4b2d23d5e4377cDavid Lawrence# copy of this software and associated documentation files (the
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews# "Software"), to deal in the Software without restriction, including
bff64bf12b58a6f80e740e94f2e42a32df18113aEvan Hunt# without limitation the rights to use, copy, modify, merge, publish,
866d106459313499d0ca7bfccb4b2d23d5e4377cDavid Lawrence# distribute, and/or sell copies of the Software, and to permit persons
7c74e180c206e6ed99e8beb820da5f399d845c3eDavid Lawrence# to whom the Software is furnished to do so, provided that the above
2baa66562a2f119edffded961d3391f87ff98ec0Ondřej Surý# copyright notice(s) and this permission notice appear in all copies of
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# the Software and that both the above copyright notice(s) and this
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# permission notice appear in supporting documentation.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley#
63dd46733010bb9622810faa17d88c3e3c28b730Mark Andrews# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael Graff# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20256cbc1570e344793555b8c2f43a25bb38e373Mark Andrews#
20256cbc1570e344793555b8c2f43a25bb38e373Mark Andrews# Except as contained in this notice, the name of a copyright holder
8b56b8956fc1e6c70efacb4f71db28d0d1f0c577Mark Andrews# shall not be used in advertising or otherwise to promote the sale, use
8b56b8956fc1e6c70efacb4f71db28d0d1f0c577Mark Andrews# or other dealings in this Software without prior written authorization
f4ea363e3acc321b24ffe95a64a583e8041d6fd5Mark Andrews# of the copyright holder.
8b56b8956fc1e6c70efacb4f71db28d0d1f0c577Mark Andrews#
8b56b8956fc1e6c70efacb4f71db28d0d1f0c577Mark Andrews# @(#)Makefile 1.9 07/07/11
8b56b8956fc1e6c70efacb4f71db28d0d1f0c577Mark Andrews#
8b56b8956fc1e6c70efacb4f71db28d0d1f0c577Mark Andrews
914eeb33149a0008e26741d9e7d89dcd6f8b6d0bMark AndrewsPWD:sh=pwd
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael GraffTOP=$(PWD)/../..
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael Graff# Build 32-bit, 64-bit, or both?
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob HalleyBUILD_TYPES=32 64
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob HalleyBUILD_TYPES_SET=yes
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley
3d776d762914d1b675b4fd49728ce353ccf6f77eBrian Wellington# Version number (used in path names)
5b7abbef511cea0b568be0bc8d5b3120a0b9034dEvan HuntMESA_VERS=6.5.2
6b66ee9147e940572a0e873ecbd67456ccb85c39Mark Andrews
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael Graff# Source tarball
11dbf2fc38eea8c5d3fe7123718bf197a8bb2e6bMark AndrewsSOURCE_TARBALL_NAME=MesaLib-$(MESA_VERS).tar.bz2
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews
9ed37e8b9ccd53bc37b546fffe487b9547dda3a0Mark Andrews# Download site for source
9ed37e8b9ccd53bc37b546fffe487b9547dda3a0Mark AndrewsSOURCE_URL=$(SF_DOWNLOADS_URL)/mesa3d/$(SOURCE_TARBALL_NAME)
9ed37e8b9ccd53bc37b546fffe487b9547dda3a0Mark AndrewsSOURCE_URL_SET=yes
11dbf2fc38eea8c5d3fe7123718bf197a8bb2e6bMark Andrews
11dbf2fc38eea8c5d3fe7123718bf197a8bb2e6bMark Andrews# Patches to apply to source after unpacking, in order
11dbf2fc38eea8c5d3fe7123718bf197a8bb2e6bMark AndrewsSOURCE_PATCHES= \
11dbf2fc38eea8c5d3fe7123718bf197a8bb2e6bMark Andrews solaris-paths.patch \
11dbf2fc38eea8c5d3fe7123718bf197a8bb2e6bMark Andrews mklib.patch \
11dbf2fc38eea8c5d3fe7123718bf197a8bb2e6bMark Andrews solaris-dri-port.patch \
11dbf2fc38eea8c5d3fe7123718bf197a8bb2e6bMark Andrews glext.h.patch \
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark Andrews 6538497.patch \
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark Andrews 6559710.patch \
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark Andrews mesa965.patch \
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark Andrews maxtexunit.patch
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark Andrews
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark Andrews# Directory created by unpacking source
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark AndrewsSOURCE_DIR=$(BUILD_DIR)/Mesa-$(MESA_VERS)
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark Andrews
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark Andrews# Library built in tree
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsMESA_LIB=$(SOURCE_DIR)/lib/libGL.so.1
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews# Where to install most files
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan HuntMESA_prefix=$(PROTODIR)$(X11_DIR)
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews# Where to install libraries
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsMESA_libdir=$(MESA_prefix)/lib
1c1290afabb3c8f4dd498170ac9592e5be450161Mark Andrews
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews# What to build
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsBUILD_TARGETS=$(GNUMAKE) $(MESA_LIB)
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews
800cfc8a5ce9ffacfc076003b34b5f787f82c701Mark Andrews### Include common rulesets
32ebb157b1d9409a186c86002827f8a1f4931f5aMark Andrewsinclude $(TOP)/common/Makefile.inc
32ebb157b1d9409a186c86002827f8a1f4931f5aMark Andrews
740e7340c55e9f0cf80c6fbbf7e8d3c1bdeaa255Mark Andrews### Rules specific to this directory:
32ebb157b1d9409a186c86002827f8a1f4931f5aMark Andrews
84f95ddb2572641022619950a211aff49e331c98Mukund Sivaraman# Merge in additional sources from sun-src directory
32ebb157b1d9409a186c86002827f8a1f4931f5aMark Andrewssource_gen:: $(LNDIR)
32ebb157b1d9409a186c86002827f8a1f4931f5aMark Andrews mkdir -p $(SOURCE_DIR)
32ebb157b1d9409a186c86002827f8a1f4931f5aMark Andrews (cd $(SOURCE_DIR) && $(LNDIR) ../../sun-src)
71697fd082b1c76562dc80fa91787af3860146bfEvan Hunt
1c1290afabb3c8f4dd498170ac9592e5be450161Mark AndrewsMESA_CFG_32_sparc=sunos5-v8
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan HuntMESA_CFG_64_sparc=sunos5-v9
a97185d9e01800850222878c2af93ea5cb08a68cMark Andrews
800cfc8a5ce9ffacfc076003b34b5f787f82c701Mark Andrews# Build with gcc on x86:
32ebb157b1d9409a186c86002827f8a1f4931f5aMark AndrewsMESA_CFLAGS=$(DEFAULT_GCC_CFLAGS) $(ARCH_GCC_FLAGS) -D_REENTRANT
32ebb157b1d9409a186c86002827f8a1f4931f5aMark AndrewsMESA_CFG_32_i386=solaris-x86-gcc-dri
800cfc8a5ce9ffacfc076003b34b5f787f82c701Mark AndrewsMESA_CFG_64_i386=solaris-x64-gcc-dri
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt
19d80ce5844e00a021643759adcbe27c11b485a0Witold Krecicki# Build with Sun Studio cc on x86:
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews#MESA_CFLAGS=$(LIB_CFLAGS)
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews#MESA_CFG_32_i386=solaris-x86-cc-dri
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews#MESA_CFG_64_i386=solaris-x64-cc-dri
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsMESA_CFG_32 = $(MESA_CFG_32_$(MACH))
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsMESA_CFG_64 = $(MESA_CFG_64_$(MACH))
19d80ce5844e00a021643759adcbe27c11b485a0Witold Krecicki
19d80ce5844e00a021643759adcbe27c11b485a0Witold KrecickiBUILD_32_FLAGS=ARCH_GCC_FLAGS="$(ARCH32_GCC_FLAGS)" MESA_CFG=$(MESA_CFG_32)
19d80ce5844e00a021643759adcbe27c11b485a0Witold KrecickiBUILD_64_FLAGS=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)" MESA_CFG=$(MESA_CFG_64)
19d80ce5844e00a021643759adcbe27c11b485a0Witold Krecicki
19d80ce5844e00a021643759adcbe27c11b485a0Witold Krecicki# pkg-config --cflags libdrm
19d80ce5844e00a021643759adcbe27c11b485a0Witold KrecickiLIBDRM_CFLAGS = -I$(PROTODIR)$(X11_INCLUDES_DIR) -I$(PROTODIR)$(X11_INCLUDES_DIR)/drm
8bcd80824c51c802c2927236b012cd526f569b04Mark Andrews# pkg-config --libs libdrm
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan HuntLIBDRM_LIB = -L$(PROTODIR)$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) -R$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) -ldrm
8bcd80824c51c802c2927236b012cd526f569b04Mark Andrews
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan HuntMESA_INCLUDES= -I$(PROTODIR)$(X11_INCLUDES_DIR)
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsMESA_MAKEVARS= SHELL=/bin/ksh PASSED_CFLAGS="$(MESA_CFLAGS)" PASSED_INCLUDES="$(MESA_INCLUDES)" ARCH_FLAGS="" LIBDRM_CFLAGS="$(LIBDRM_CFLAGS)" LIBDRM_LIB="$(LIBDRM_LIB)"
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan HuntMESA_MAKEENV= PKG_CONFIG_PATH=$(PROTODIR)/usr/lib$(ARCHLIBSUBDIR)/pkgconfig:$(TOP)/common/pc-files/$(BUILD_DIR):/usr/lib$(ARCHLIBSUBDIR)/pkgconfig
206e697f24e47b8868bd68a5b6ef42f5f62e39d5Evan Hunt# LD_OPTIONS="$(LIB_REQUIRED_LDFLAGS)"
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt# Build Mesa
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt$(MESA_LIB): $(GNUMAKE) $(UNPACK_TARGET)
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt (cd $(SOURCE_DIR)/configs && rm -f current && ln -s $(MESA_CFG) current)
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt (cd $(SOURCE_DIR) && $(MESA_MAKEENV) $(GNUMAKE) $(MFLAGS) -e $(MESA_MAKEVARS) default)
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Huntinstall_gen: $(MESA_LIB)
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt (cd $(SOURCE_DIR) && $(GNUMAKE) $(MFLAGS) -e DESTDIR=$(PROTODIR) ARCHLIBSUBDIR=$(ARCHLIBSUBDIR) install )
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt