Makefile revision 659
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews###############################################################################
bec154197d3d640b0d5b416cd5218ea58dca5d3aTinderbox User#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Use subject to license terms.
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Permission is hereby granted, free of charge, to any person obtaining a
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# copy of this software and associated documentation files (the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# "Software"), to deal in the Software without restriction, including
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# without limitation the rights to use, copy, modify, merge, publish,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# distribute, and/or sell copies of the Software, and to permit persons
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# to whom the Software is furnished to do so, provided that the above
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# copyright notice(s) and this permission notice appear in all copies of
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# the Software and that both the above copyright notice(s) and this
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# permission notice appear in supporting documentation.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
ea94d370123a5892f6c47a97f21d1b28d44bb168Tinderbox User# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater#
c3dc968140ab7f04795acc7835e4e89ccb0c0a27Tinderbox User# Except as contained in this notice, the name of a copyright holder
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# shall not be used in advertising or otherwise to promote the sale, use
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# or other dealings in this Software without prior written authorization
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# of the copyright holder.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# @(#)Makefile 1.12 09/03/04
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater# Package name used in tarballs
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsMODULE_NAME=MesaDemos
c3dc968140ab7f04795acc7835e4e89ccb0c0a27Tinderbox User
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Version number (used in path names)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsMODULE_VERSION=7.2
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Directory created by unpacking source
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsSOURCE_DIRNAME=Mesa-$(MODULE_VERSION)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsSOURCE_DIRNAME_SET=yes
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsSOURCE_DIR=$(BUILD_DIR)/$(SOURCE_DIRNAME)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Source tarball
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsSOURCE_TARBALL_NAME=MesaDemos-$(MODULE_VERSION).tar.bz2
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsSOURCE_TARBALL_NAME_SET=yes
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Download site for source
97e74139b19368e385a3564746d42db70879195eAutomatic UpdaterSOURCE_URL=$(SF_DOWNLOADS_URL)/mesa3d/$(SOURCE_TARBALL_NAME)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsSOURCE_URL_SET=yes
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
43b94483957d3168796a816ed86cf097518817dcTinderbox User# Patches to apply to source after unpacking, in order
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsSOURCE_PATCHES= \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Xorg-6.9-changes.patch
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Binaries built in tree
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsGLXGEARS_BIN=$(SOURCE_DIR)/progs/xdemos/glxgears
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsGLXINFO_BIN=$(SOURCE_DIR)/progs/xdemos/glxinfo
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# configure script is run in ../lib/mesa build, just link to results here
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCONFIGURE_TARGETS=$(SOURCE_DIR)/configs/current
43b94483957d3168796a816ed86cf097518817dcTinderbox UserCONFIGURE_TARGETS_SET=yes
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# What to build
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsBUILD_TARGETS_sparc=
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsBUILD_TARGETS_i386=$(GLXGEARS_BIN) $(GLXINFO_BIN)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsBUILD_TARGETS= $(BUILD_TARGETS_$(MACH))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsBUILD_TARGETS_SET=yes
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# What to install
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsINSTALL_TARGETS_sparc=install_man
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic UpdaterINSTALL_TARGETS_i386=install_glxgears install_glxinfo install_man
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic UpdaterINSTALL_TARGETS= $(INSTALL_TARGETS_$(MACH))
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic UpdaterINSTALL_TARGETS_SET=yes
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic Updater
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic Updater### Include common rulesets
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic Updaterinclude ../Makefile.inc
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic Updater
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic Updater### Rules specific to this directory:
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic Updater
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater# Only care about building X demos
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic UpdaterDEMOS_DIR=$(SOURCE_DIR)/progs/xdemos
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic UpdaterDEMO_LDFLAGS=$(PROG_LDFLAGS) -L$(PROTODIR)$(X11_DIR)/lib$(ARCHLIBSUBDIR)
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic Updater# Workaround 6724478 libc printf should not SEGV when passed NULL for %s format
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic UpdaterDEMO_LDFLAGS += /usr/lib$(ARCHLIBSUBDIR)/0@0.so.1
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic Updater
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic Updater# Flags passed on make command line when building
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic UpdaterMODULE_BUILD_MAKEFLAGS = LDFLAGS="$(DEMO_LDFLAGS)"
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic Updater
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic Updater# Use configuration generated by Mesa library build
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic Updater$(SOURCE_DIR)/configs/current: $(UNPACK_TARGET)
dba3c818ae00b10388d31703e86a28415db398acTinderbox User mkdir -p $(SOURCE_DIR)/configs
43b94483957d3168796a816ed86cf097518817dcTinderbox User (cd $(SOURCE_DIR)/configs && \
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic Updater $(LNDIR) ../../../../../lib/mesa/$(SOURCE_DIR)/configs)
8ec3c085233cedb22b05da36e2773c8f357a7e45Automatic Updater
8ec3c085233cedb22b05da36e2773c8f357a7e45Automatic Updater# Build Mesa demos
8ec3c085233cedb22b05da36e2773c8f357a7e45Automatic Updater$(GLXGEARS_BIN): $(UNPACK_TARGET) $(CONFIGURE_TARGETS)
8ec3c085233cedb22b05da36e2773c8f357a7e45Automatic Updater (cd $(DEMOS_DIR) && \
8ec3c085233cedb22b05da36e2773c8f357a7e45Automatic Updater $(MODULE_MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS) glxgears )
64affc54f96a2c71cbd10ed71e246ce0746259aaAutomatic Updater
8ec3c085233cedb22b05da36e2773c8f357a7e45Automatic Updater$(GLXINFO_BIN): $(UNPACK_TARGET) $(CONFIGURE_TARGETS)
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater (cd $(DEMOS_DIR) && \
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater $(MODULE_MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS) glxinfo )
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater# For testing - we don't ship the rest of these
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updaterall-xdemos_gen: $(UNPACK_TARGET) $(CONFIGURE_TARGETS)
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater (cd $(DEMOS_DIR) && \
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater $(MODULE_MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS))
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updaterall-xdemos:
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater $(MAKE) $(MAKEFLAGS) $(BUILD_32_FLAGS) all-xdemos_gen
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinstall_gen:: $(INSTALL_TARGETS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsDESTDIR=$(PROTODIR)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinstall_glxgears: $(GLXGEARS_BIN)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews mkdir -p $(DESTDIR)$(MODULE_PREFIX)/bin
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews cp -pf $(GLXGEARS_BIN) $(DESTDIR)$(MODULE_PREFIX)/bin
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinstall_glxinfo: $(GLXINFO_BIN)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews mkdir -p $(DESTDIR)$(MODULE_PREFIX)/bin
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews cp -pf $(GLXINFO_BIN) $(DESTDIR)$(MODULE_PREFIX)/bin
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinstall_man:
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews mkdir -p $(DESTDIR)$(MODULE_PREFIX)/share/man/man1
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews cp -pf glxgears.1 glxinfo.1 $(DESTDIR)$(MODULE_PREFIX)/share/man/man1
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews