summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Rusin <zack@tungstengraphics.com>2008-12-16 21:25:03 -0500
committerZack Rusin <zack@tungstengraphics.com>2008-12-16 21:25:03 -0500
commit4c301992967b2bf1cbce03dcaf52947f7bff8512 (patch)
treea0a8d376f13c7d9cc3407a52f8d560212e366279
parent4be89372100418453447d7d58fee4ea29b9b23f1 (diff)
build using cmake
-rw-r--r--.gitignore3
-rw-r--r--CMakeLists.txt5
-rw-r--r--Makefile259
-rwxr-xr-xbin/installmesa74
-rwxr-xr-xbin/minstall89
-rwxr-xr-xbin/mklib801
-rwxr-xr-xbin/raw2png.py366
-rwxr-xr-xbin/win32kprof.py309
-rw-r--r--configs/.gitignore1
-rw-r--r--configs/default67
-rw-r--r--configs/linux-dri35
-rw-r--r--configs/linux-dri-debug16
-rw-r--r--configs/linux-dri-x8610
-rw-r--r--configs/linux-dri-x86-6412
-rw-r--r--examples/.gitignore1
-rw-r--r--examples/CMakeLists.txt1
-rw-r--r--examples/trivial/CMakeLists.txt8
-rw-r--r--examples/trivial/Makefile167
-rw-r--r--src/.gitignore2
-rw-r--r--src/CMakeLists.txt28
-rw-r--r--src/Makefile512
21 files changed, 848 insertions, 1918 deletions
diff --git a/.gitignore b/.gitignore
index 6d56e83..60ca819 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,5 @@
depend
depend.bak
+CMakeCache.txt
+CMakeFiles/
+cmake_install.cmake
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..95f2b2d
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.6)
+project(Clover)
+
+add_subdirectory(src)
+add_subdirectory(examples)
diff --git a/Makefile b/Makefile
index 097a7a1..20630e9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,118 +1,147 @@
-TOP = .
-include $(TOP)/configs/current
-
-
-CL_SOURCES = \
- src/api_command.cpp \
- src/api_context.cpp \
- src/api_device.cpp \
- src/api_enqueue.cpp \
- src/api_event.cpp \
- src/api_flush.cpp \
- src/api_kernel.cpp \
- src/api_memory.cpp \
- src/api_platform.cpp \
- src/api_profiling.cpp \
- src/api_program.cpp \
- src/api_sampler.cpp \
- src/device.cpp
-
-CPUWS_SOURCES = \
- cpuwinsys/cpuwinsys.c
-
-### All the core C sources
-
-ALL_SOURCES = \
- $(CL_SOURCES) \
- $(CPUWS_SOURCES)
-
-
-### Object files
-CL_OBJECTS = \
- $(CL_SOURCES:.cpp=.o) \
- $(CPUWS_SOURCES:.c=.o)
-
-### Include directories
-
-INCLUDE_DIRS = \
- -I$(TOP) \
- -I$(TOP)/include \
- -I$(GALLIUM)/include \
- -I$(GALLIUM)/src/gallium/include \
- -I$(GALLIUM)/src/gallium/auxiliary \
- -I$(GALLIUM)/src/gallium/drivers
-
-CL_LIB = OpenCL
-CL_LIB_NAME = lib$(CL_LIB).so
-
-CL_MAJOR = 1
-CL_MINOR = 0
-CL_TINY = 0
-
-GALLIUM_LIBS = \
- $(GALLIUM)/src/gallium/auxiliary/pipebuffer/libpipebuffer.a \
- $(GALLIUM)/src/gallium/auxiliary/sct/libsct.a \
- $(GALLIUM)/src/gallium/auxiliary/draw/libdraw.a \
- $(GALLIUM)/src/gallium/auxiliary/rtasm/librtasm.a \
- $(GALLIUM)/src/gallium/auxiliary/translate/libtranslate.a \
- $(GALLIUM)/src/gallium/auxiliary/cso_cache/libcso_cache.a \
- $(GALLIUM)/src/gallium/auxiliary/tgsi/libtgsi.a \
- $(GALLIUM)/src/gallium/auxiliary/util/libutil.a \
- $(GALLIUM)/src/gallium/drivers/softpipe/libsoftpipe.a
-
-.SUFFIXES : .cpp
-
-.c.o:
- $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
-
-.cpp.o:
- $(CXX) -c $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $@
-
-.S.o:
- $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
-
-
-default: depend subdirs $(TOP)/$(LIB_DIR)/$(CL_LIB_NAME)
-
-# Make the OpenCL library
-$(TOP)/$(LIB_DIR)/$(CL_LIB_NAME): $(CL_OBJECTS) $(GALLIUM_LIBS)
- $(TOP)/bin/mklib -o $(CL_LIB) \
- -major $(CL_MAJOR) \
- -minor $(CL_MINOR) \
- -patch $(CL_TINY) \
- -install $(TOP)/$(LIB_DIR) \
- $(CL_OBJECTS) $(GALLIUM_LIBS) \
- -Wl,--whole-archive $(LIBS) -Wl,--no-whole-archive $(SYS_LIBS)
-
-######################################################################
-# Generic stuff
-
-depend: $(ALL_SOURCES)
- @ echo "running $(MKDEP)"
- @ rm -f depend # workaround oops on gutsy?!?
- @ touch depend
- @ $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(ALL_SOURCES) \
- > /dev/null 2>/dev/null
-
-
-subdirs:
-
-install: default
- $(INSTALL) -d $(INSTALL_DIR)/include/OpenCL
- $(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR)
- $(INSTALL) -m 644 $(TOP)/include/OpenCL/*.h $(INSTALL_DIR)/include/OpenCL
- @if [ -e $(TOP)/$(LIB_DIR)/$(CL_LIB_NAME) ]; then \
- $(INSTALL) $(TOP)/$(LIB_DIR)/libOpenCL* $(INSTALL_DIR)/$(LIB_DIR); \
- fi
-
-# Emacs tags
-tags:
- etags `find . -name \*.[ch]` $(TOP)/include/OpenCL/*.h
+# CMAKE generated file: DO NOT EDIT!
+# Generated by "Unix Makefiles" Generator, CMake Version 2.6
-clean:
- -rm -f */*.o
- -rm -f */*/*.o
- -rm -f depend depend.bak
+# Default target executed when no arguments are given to make.
+default_target: all
+.PHONY : default_target
+
+#=============================================================================
+# Special targets provided by cmake.
+
+# Disable implicit rules so canoncical targets will work.
+.SUFFIXES:
+
+# Remove some rules from gmake that .SUFFIXES does not remove.
+SUFFIXES =
+
+.SUFFIXES: .hpux_make_needs_suffix_list
+
+# Suppress display of executed commands.
+$(VERBOSE).SILENT:
+
+# A target that is always out of date.
+cmake_force:
+.PHONY : cmake_force
+
+#=============================================================================
+# Set environment variables for the build.
+
+# The shell in which to execute make rules.
+SHELL = /bin/sh
+
+# The CMake executable.
+CMAKE_COMMAND = /usr/bin/cmake
-include depend
+# The command to remove a file.
+RM = /usr/bin/cmake -E remove -f
+
+# The top-level source directory on which CMake was run.
+CMAKE_SOURCE_DIR = /home/zack/projects/clover
+
+# The top-level build directory on which CMake was run.
+CMAKE_BINARY_DIR = /home/zack/projects/clover
+
+#=============================================================================
+# Targets provided globally by CMake.
+
+# Special rule for the target edit_cache
+edit_cache:
+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..."
+ /usr/bin/cmake -i .
+.PHONY : edit_cache
+
+# Special rule for the target edit_cache
+edit_cache/fast: edit_cache
+.PHONY : edit_cache/fast
+
+# Special rule for the target rebuild_cache
+rebuild_cache:
+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
+ /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
+.PHONY : rebuild_cache
+
+# Special rule for the target rebuild_cache
+rebuild_cache/fast: rebuild_cache
+.PHONY : rebuild_cache/fast
+
+# The main all target
+all: cmake_check_build_system
+ $(CMAKE_COMMAND) -E cmake_progress_start /home/zack/projects/clover/CMakeFiles /home/zack/projects/clover/CMakeFiles/progress.make
+ $(MAKE) -f CMakeFiles/Makefile2 all
+ $(CMAKE_COMMAND) -E cmake_progress_start /home/zack/projects/clover/CMakeFiles 0
+.PHONY : all
+
+# The main clean target
+clean:
+ $(MAKE) -f CMakeFiles/Makefile2 clean
+.PHONY : clean
+
+# The main clean target
+clean/fast: clean
+.PHONY : clean/fast
+
+# Prepare targets for installation.
+preinstall: all
+ $(MAKE) -f CMakeFiles/Makefile2 preinstall
+.PHONY : preinstall
+
+# Prepare targets for installation.
+preinstall/fast:
+ $(MAKE) -f CMakeFiles/Makefile2 preinstall
+.PHONY : preinstall/fast
+
+# clear depends
+depend:
+ $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
+.PHONY : depend
+
+#=============================================================================
+# Target rules for targets named OpenCL
+
+# Build rule for target.
+OpenCL: cmake_check_build_system
+ $(MAKE) -f CMakeFiles/Makefile2 OpenCL
+.PHONY : OpenCL
+
+# fast build rule for target.
+OpenCL/fast:
+ $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/build
+.PHONY : OpenCL/fast
+
+#=============================================================================
+# Target rules for targets named basic
+
+# Build rule for target.
+basic: cmake_check_build_system
+ $(MAKE) -f CMakeFiles/Makefile2 basic
+.PHONY : basic
+
+# fast build rule for target.
+basic/fast:
+ $(MAKE) -f examples/trivial/CMakeFiles/basic.dir/build.make examples/trivial/CMakeFiles/basic.dir/build
+.PHONY : basic/fast
+
+# Help Target
+help:
+ @echo "The following are some of the valid targets for this Makefile:"
+ @echo "... all (the default if no target is provided)"
+ @echo "... clean"
+ @echo "... depend"
+ @echo "... edit_cache"
+ @echo "... rebuild_cache"
+ @echo "... OpenCL"
+ @echo "... basic"
+.PHONY : help
+
+
+
+#=============================================================================
+# Special targets to cleanup operation of make.
+
+# Special rule to run CMake to check the build system integrity.
+# No rule that depends on this can have commands that come from listfiles
+# because they might be regenerated.
+cmake_check_build_system:
+ $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
+.PHONY : cmake_check_build_system
diff --git a/bin/installmesa b/bin/installmesa
deleted file mode 100755
index 1e24c05..0000000
--- a/bin/installmesa
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/sh
-
-#
-# Simple shell script for installing Mesa's header and library files.
-# If the copy commands below don't work on a particular system (i.e. the
-# -f or -d flags), we may need to branch on `uname` to do the right thing.
-#
-
-
-TOP=.
-
-INCLUDE_DIR="/usr/local/include"
-LIB_DIR="/usr/local/lib"
-
-if [ "x$#" = "x0" ] ; then
-echo
-echo "***** Mesa installation - You may need root privileges to do this *****"
-echo
-echo "Default directory for header files is:" ${INCLUDE_DIR}
-echo "Enter new directory or press <Enter> to accept this default."
-
-read INPUT
-if [ "x${INPUT}" != "x" ] ; then
- INCLUDE_DIR=${INPUT}
-fi
-
-echo
-echo "Default directory for library files is:" ${LIB_DIR}
-echo "Enter new directory or press <Enter> to accept this default."
-
-read INPUT
-if [ "x${INPUT}" != "x" ] ; then
- LIB_DIR=${INPUT}
-fi
-
-echo
-echo "About to install Mesa header files (GL/*.h) in: " ${INCLUDE_DIR}/GL
-echo "and Mesa library files (libGL.*, etc) in: " ${LIB_DIR}
-echo "Press <Enter> to continue, or <ctrl>-C to abort."
-
-read INPUT
-
-else
-INCLUDE_DIR=$1/include
-LIB_DIR=$1/lib
-fi
-
-# flags:
-# -f = force
-# -d = preserve symlinks (does not work on BSD)
-
-if [ `uname` = "FreeBSD" ] ; then
- CP_FLAGS="-f"
-elif [ `uname` = "Darwin" ] ; then
- CP_FLAGS="-f"
-elif [ `uname` = "AIX" ] ; then
- CP_FLAGS="-fh"
-else
- CP_FLAGS="-fd"
-fi
-
-
-set -v
-
-mkdir -p ${INCLUDE_DIR}
-mkdir -p ${INCLUDE_DIR}/GL
-# NOT YET: mkdir -p ${INCLUDE_DIR}/GLES
-mkdir -p ${LIB_DIR}
-cp -f ${TOP}/include/GL/*.h ${INCLUDE_DIR}/GL
-cp -f ${TOP}/src/glw/*.h ${INCLUDE_DIR}/GL
-# NOT YET: cp -f ${TOP}/include/GLES/*.h ${INCLUDE_DIR}/GLES
-cp ${CP_FLAGS} ${TOP}/lib*/lib* ${LIB_DIR}
-
-echo "Done."
diff --git a/bin/minstall b/bin/minstall
deleted file mode 100755
index 819b2bc..0000000
--- a/bin/minstall
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/bin/sh
-
-
-# A minimal replacement for 'install' that supports installing symbolic links.
-# Only a limited number of options are supported:
-# -d dir Create a directory
-# -m mode Sets a file's mode when installing
-
-
-# If these commands aren't portable, we'll need some "if (arch)" type stuff
-SYMLINK="ln -s"
-MKDIR="mkdir -p"
-RM="rm -f"
-
-MODE=""
-
-if [ "$1" = "-d" ] ; then
- # make a directory path
- $MKDIR "$2"
- exit 0
-fi
-
-if [ "$1" = "-m" ] ; then
- # set file mode
- MODE=$2
- shift 2
-fi
-
-# install file(s) into destination
-if [ $# -ge 2 ] ; then
-
- # Last cmd line arg is the dest dir
- for FILE in $@ ; do
- DEST="$FILE"
- done
-
- # Loop over args, moving them to DEST directory
- I=1
- for FILE in $@ ; do
- if [ $I = $# ] ; then
- # stop, don't want to install $DEST into $DEST
- exit 0
- fi
-
- # determine file's type
- if [ -h "$FILE" ] ; then
- #echo $FILE is a symlink
- # Unfortunately, cp -d isn't universal so we have to
- # use a work-around.
-
- # Use ls -l to find the target that the link points to
- LL=`ls -l "$FILE"`
- for L in $LL ; do
- TARGET=$L
- done
- #echo $FILE is a symlink pointing to $TARGET
-
- FILE=`basename "$FILE"`
- # Go to $DEST and make the link
- PWDSAVE="$PWD"
- cd "$DEST" # pushd
- $RM "$FILE"
- $SYMLINK "$TARGET" "$FILE"
- cd "$PWDSAVE" # popd
-
- elif [ -f "$FILE" ] ; then
- #echo "$FILE" is a regular file
- $RM "$DEST/`basename $FILE`"
- cp "$FILE" "$DEST"
- if [ $MODE ] ; then
- FILE=`basename "$FILE"`
- chmod $MODE "$DEST/$FILE"
- fi
- else
- echo "Unknown type of argument: " "$FILE"
- exit 1
- fi
-
- I=`expr $I + 1`
- done
-
- exit 0
-fi
-
-# If we get here, we didn't find anything to do
-echo "Usage:"
-echo " install -d dir Create named directory"
-echo " install [-m mode] file [...] dest Install files in destination"
-
diff --git a/bin/mklib b/bin/mklib
deleted file mode 100755
index e17e2fe..0000000
--- a/bin/mklib
+++ /dev/null
@@ -1,801 +0,0 @@
-#!/bin/sh
-
-# Make a shared library.
-# This script should be useful for projects other than Mesa.
-# Improvements/fixes are welcome.
-
-
-# Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-#
-# Option defaults
-#
-LIBNAME=""
-MAJOR=1
-MINOR=0
-PATCH=""
-DEPS=""
-LINK=""
-CPLUSPLUS=0
-STATIC=0
-DLOPEN=0
-INSTALLDIR="."
-ARCH="auto"
-ARCHOPT=""
-NOPREFIX=0
-EXPORTS=""
-
-
-#
-# Parse arguments
-#
-while true
-do
- case $1 in
- '-h' | '--help')
- echo 'Usage: mklib [options] objects'
- echo 'Create a shared library from object files.'
- echo ' -o LIBRARY specifies the name of the resulting library, without'
- echo ' the leading "lib" or any suffix.'
- echo ' (eg: "-o GL" might result in "libGL.so" being made)'
- echo ' -major N specifies major version number (default is 1)'
- echo ' -minor N specifies minor version number (default is 0)'
- echo ' -patch N specifies patch version number (default is 0)'
- echo ' -lLIBRARY specifies a dependency on LIBRARY'
- echo ' -LDIR search in DIR for library dependencies'
- echo ' -linker L explicity specify the linker program to use (eg: gcc, g++)'
- echo ' Not observed on all systems at this time.'
- echo ' -cplusplus link with C++ runtime'
- echo ' -static make a static library (default is dynamic/shared)'
- echo ' -dlopen make a shared library suitable for dynamic loading'
- echo ' -install DIR put resulting library file(s) in DIR'
- echo ' -arch ARCH override using `uname` to determine host system'
- echo ' -archopt OPT specify an extra achitecture-specific option OPT'
- echo " -noprefix don't prefix library name with 'lib' nor add any suffix"
- echo ' -exports FILE only export the symbols listed in FILE'
- echo ' -h, --help display this information and exit'
- exit 1
- ;;
- '-o')
- shift 1;
- LIBNAME=$1
- ;;
- '-major')
- shift 1;
- MAJOR=$1
- ;;
- '-minor')
- shift 1;
- MINOR=$1
- ;;
- '-patch')
- shift 1;
- PATCH=$1
- ;;
- '-linker')
- shift 1;
- LINK=$1
- ;;
- -l*)
- DEPS="$DEPS $1"
- ;;
- -L*)
- DEPS="$DEPS $1"
- ;;
- -pthread)
- # this is a special case (see bugzilla 10876)
- DEPS="$DEPS $1"
- ;;
- '-pthread')
- DEPS="$DEPS -pthread"
- ;;
- '-cplusplus')
- CPLUSPLUS=1
- ;;
- '-static')
- STATIC=1
- ;;
- '-dlopen')
- DLOPEN=1
- ;;
- '-install')
- shift 1;
- INSTALLDIR=$1
- ;;
- '-arch')
- shift 1;
- ARCH=$1
- ;;
- '-archopt')
- shift 1;
- ARCHOPT=$1
- ;;
- '-noprefix')
- NOPREFIX=1
- ;;
- '-exports')
- shift 1;
- EXPORTS=$1
- ;;
- -*)
- echo "mklib: Unknown option: " $1 ;
- exit 1
- ;;
- *)
- # This should be the first object file, stop parsing
- break
- esac
- shift 1
-done
-OBJECTS=$@
-
-
-if [ ${ARCH} = "auto" ] ; then
- ARCH=`uname`
-fi
-
-
-#
-# Error checking
-#
-if [ "x${LIBNAME}" = "x" ] ; then
- echo "mklib: Error: no library name specified"
- exit 1
-fi
-if [ "x${OBJECTS}" = "x" ] ; then
- echo "mklib: Error: no object files specified"
- exit 1
-fi
-
-
-#
-# Debugging info
-#
-if [ ] ; then
- echo "-----------------"
- echo ARCH is $ARCH
- echo LIBNAME is $LIBNAME
- echo MAJOR is $MAJOR
- echo MINOR is $MINOR
- echo PATCH is $PATCH
- echo DEPS are $DEPS
- echo "EXPORTS in" $EXPORTS
- echo "-----------------"
-fi
-
-
-#
-# OK, make the library now
-#
-case $ARCH in
-
- 'Linux' | 'OpenBSD' | 'GNU' | GNU/*)
- # we assume gcc
-
- if [ "x$LINK" = "x" ] ; then
- # -linker was not specified so set default link command now
- if [ $CPLUSPLUS = 1 ] ; then
- LINK=g++
- else
- LINK=gcc
- fi
- fi
-
- if [ $NOPREFIX = 1 ] ; then
- # No "lib" or ".so" part
- echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}
- case $ARCH in 'Linux' | 'GNU' | GNU/*)
- OPTS="-Xlinker -Bsymbolic -shared"
- ;;
- *)
- OPTS="-shared"
- ;;
- esac
-
- # Check if objects are 32-bit and we're running in 64-bit
- # environment. If so, pass -m32 flag to linker.
- set ${OBJECTS}
- ABI32=`file $1 | grep 32-bit`
- if [ "${ABI32}" -a `uname -m` = "x86_64" ] ; then
- OPTS="-m32 ${OPTS}"
- fi
-
- rm -f ${LIBNAME}
- # make lib
- ${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
- # finish up
- FINAL_LIBS="${LIBNAME}"
- elif [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}.a" # prefix with "lib", suffix with ".a"
- echo "mklib: Making" $ARCH "static library: " ${LIBNAME}
- LINK="ar"
- OPTS="-ru"
- rm -f ${LIBNAME}
- # make lib
- ${LINK} ${OPTS} ${LIBNAME} ${OBJECTS}
- ranlib ${LIBNAME}
- # finish up
- FINAL_LIBS=${LIBNAME}
- else
- LIBNAME="lib${LIBNAME}" # prefix with "lib"
- case $ARCH in 'Linux' | 'GNU' | GNU/*)
- OPTS="-Xlinker -Bsymbolic -shared -Wl,-soname,${LIBNAME}.so.${MAJOR}"
- ;;
- *)
- OPTS="-shared -Wl,-soname,${LIBNAME}.so.${MAJOR}"
- ;;
- esac
- if [ $EXPORTS ] ; then
- #OPTS="${OPTS} -Xlinker --retain-symbols-file ${EXPORTS}"
- # Make the 'exptmp' file for --version-script option
- echo "VERSION_${MAJOR}.${MINOR} {" > exptmp
- echo "global:" >> exptmp
- sed 's/$/;/' ${EXPORTS} >> exptmp
- echo "local:" >> exptmp
- echo "*;" >> exptmp
- echo "};" >> exptmp
- OPTS="${OPTS} -Xlinker --version-script=exptmp"
- # exptmp is removed below
- fi
-
- # Check if objects are 32-bit and we're running in 64-bit
- # environment. If so, pass -m32 flag to linker.
- set ${OBJECTS}
- ABI32=`file $1 | grep 32-bit`
- if [ "${ABI32}" -a `uname -m` = "x86_64" ] ; then
- OPTS="-m32 ${OPTS}"
- fi
-
- if [ x${PATCH} = "x" ] ; then
- VERSION="${MAJOR}.${MINOR}"
- else
- VERSION="${MAJOR}.${MINOR}.${PATCH}"
- fi
-
- echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}.so.${VERSION}
-
- # rm any old libs
- rm -f ${LIBNAME}.so.${VERSION}
- rm -f ${LIBNAME}.so.${MAJOR}
- rm -f ${LIBNAME}.so
-
- # make lib
- ${LINK} ${OPTS} -o ${LIBNAME}.so.${VERSION} ${OBJECTS} ${DEPS}
- # make usual symlinks
- ln -s ${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR}
- ln -s ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so
- # finish up
- FINAL_LIBS="${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so"
-# rm -f exptmp
- fi
- ;;
-
- 'SunOS')
- if [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making SunOS static library: " ${LIBNAME}
- rm -f ${LIBNAME}
- ar -ruv ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- else
- if [ $NOPREFIX = 0 ] ; then
- LIBNAME="lib${LIBNAME}.so"
- fi
- echo "mklib: Making SunOS shared library: " ${LIBNAME}
-
- if [ "x$LINK" = "x" ] ; then
- # -linker was not specified, choose default linker now
- if [ $CPLUSPLUS = 1 ] ; then
- # determine linker and options for C++ code
- if [ `which c++` ] ; then
- # use Sun c++
- LINK="c++"
- elif [ `type g++` ] ; then
- # use g++
- LINK="g++"
- else
- echo "mklib: warning: can't find C++ comiler, trying CC."
- LINK="CC"
- fi
- else
- # use native Sun linker for C code
- LINK="ld"
- fi
- fi
-
- # linker options
- if [ ${LINK} = "ld" -o ${LINK} = "cc" -o ${LINK} = "CC" ] ; then
- # SunOS tools, -G to make shared libs
- OPTS="-G"
- else
- # gcc linker
- # Check if objects are 32-bit and we're running in 64-bit
- # environment. If so, pass -m32 flag to linker.
- set ${OBJECTS}
- ABI32=`file $1 | grep 32-bit`
- if [ "${ABI32}" ] ; then
- OPTS="-m32 -shared -Wl,-Bdynamic"
- else
- OPTS="-m64 -shared -Wl,-Bdynamic"
- fi
- fi
-
- # Check if objects are SPARC v9
- # file says: ELF 64-bit MSB relocatable SPARCV9 Version 1
- set ${OBJECTS}
- SPARCV9=`file $1 | grep SPARCV9`
- if [ "${SPARCV9}" ] ; then
- OPTS="${OPTS} -xarch=v9"
- fi
-
- # for debug:
- #echo "mklib: linker is" ${LINK} ${OPTS}
- if [ $NOPREFIX = 1 ] ; then
- rm -f ${LIBNAME}
- ${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
- else
- rm -f ${LIBNAME}.${MAJOR} ${LIBNAME}
- ${LINK} ${OPTS} -o ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS}
- ln -s ${LIBNAME}.${MAJOR} ${LIBNAME}
- fi
- FINAL_LIBS="${LIBNAME}.${MAJOR} ${LIBNAME}"
- fi
- ;;
-
- 'FreeBSD')
- # we assume gcc
-
- if [ "x$LINK" = "x" ] ; then
- # -linker was not specified so set default link command now
- if [ $CPLUSPLUS = 1 ] ; then
- LINK=g++
- else
- LINK=gcc
- fi
- fi
-
- if [ $NOPREFIX = 1 ] ; then
- # No "lib" or ".so" part
- echo "mklib: Making FreeBSD shared library: " ${LIBNAME}
- OPTS="-shared"
- rm -f ${LIBNAME}
- ${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
- FINAL_LIBS=${LIBNAME}
- elif [ $STATIC = 1 ] ; then
- STLIB="lib${LIBNAME}.a"
- echo "mklib: Making FreeBSD static library: " ${STLIB}
- rm -f ${STLIB}
- ar cq ${STLIB} ${OBJECTS}
- ranlib ${STLIB}
- FINAL_LIBS=${STLIB}
- else
- SHLIB="lib${LIBNAME}.so.${MAJOR}"
- OPTS="-shared -Wl,-soname,${SHLIB}"
- echo "mklib: Making FreeBSD shared library: " ${SHLIB}
- rm -f ${SHLIB}
- ${LINK} ${OPTS} -o ${SHLIB} ${OBJECTS} ${DEPS}
- ln -sf ${SHLIB} "lib${LIBNAME}.so"
- FINAL_LIBS="${SHLIB} lib${LIBNAME}.so"
- fi
- ;;
-
- 'NetBSD')
- if [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}_pic.a"
- echo "mklib: Making NetBSD PIC static library: " ${LIBNAME}
- rm -f ${LIBNAME}
- ar cq ${LIBNAME} ${OBJECTS}
- ranlib ${LIBNAME}
- FINAL_LIBS=${LIBNAME}
- else
- LIBNAME="lib${LIBNAME}.so.${MAJOR}.${MINOR}"
- echo "mklib: Making NetBSD PIC shared library: " ${LIBNAME}
- rm -f ${LIBNAME}
- ld -x -Bshareable -Bforcearchive -o ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- fi
- ;;
-
- 'IRIX' | 'IRIX64')
- if [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}.a"
- rm -f ${LIBNAME}
- ar rc ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- else
- LIBNAME="lib${LIBNAME}.so" # prefix with "lib", suffix with ".so"
-
- # examine first object to determine ABI
- set ${OBJECTS}
- ABI_O32=`file $1 | grep 'ELF 32-bit'`
- ABI_N32=`file $1 | grep 'ELF N32'`
- ABI_N64=`file $1 | grep 'ELF 64-bit'`
- if [ "${ABI_O32}" ] ; then
- OPTS="-32 -shared -all"
- ABI="o32-bit"
- elif [ "${ABI_N32}" ] ; then
- OPTS="-n32 -shared -all"
- ABI="n32-bit"
- elif [ "${ABI_N64}" ] ; then
- OPTS="-64 -shared -all"
- ABI="64-bit"
- else
- echo "Error: Unexpected IRIX ABI!"
- exit 1
- fi
-
- if [ $CPLUSPLUS = 1 ] ; then
- LINK="CC"
- else
- LINK="ld"
- fi
-
- echo "mklib: Making IRIX " ${ABI} " shared library: " ${LIBNAME}
- ${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
- FINAL_LIBS=${LIBNAME}
- fi
- ;;
-
- 'linux-cygwin')
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making linux-cygwin library: " ${LIBNAME}
- rm -f ${LIBNAME}
- gnuwin32ar ruv ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- ;;
-
- 'HP-UX')
- if [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making HP-UX static library: " ${LIBNAME}
- rm -f ${LIBNAME}
- ar -ruv ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- else
- # HP uses a .2 for their current GL/GLU libraries
- if [ ${LIBNAME} = "GL" -o ${LIBNAME} = "GLU" ] ; then
- MAJOR=2
- fi
- RUNLIB="lib${LIBNAME}.${MAJOR}"
- DEVLIB="lib${LIBNAME}.sl"
- echo "mklib: Making HP-UX shared library: " ${RUNLIB} ${DEVLIB}
- ld -b -o ${RUNLIB} +b ${RUNLIB} ${OBJECTS} ${DEPS}
- ln -s ${RUNLIB} ${DEVLIB}
- FINAL_LIBS="${RUNLIB} ${DEVLIB}"
- fi
- ;;
-
- 'AIX' )
- # examine first object to determine ABI
- set ${OBJECTS}
- ABI_64=`file $1 | grep '64-bit'`
- if [ "${ABI_64}" ] ; then
- X64="-X64"
- Q64="-q64"
- OFILE=shr_64.o
- else
- OFILE=shr.o #Want to be consistent with the IBM libGL.a
- fi
-
- if [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making AIX static library: " ${LIBNAME}
- ar -ruv ${X64} ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- else
- EXPFILE="lib${LIBNAME}.exp"
- LIBNAME="lib${LIBNAME}.a" # shared objects are still stored in the .a libraries
- OPTS="-bE:${EXPFILE} -bM:SRE -bnoentry ${Q64}"
- rm -f ${EXPFILE} ${OFILE}
- NM="/bin/nm -eC ${X64}"
- echo "#! /usr/lib/${LIBNAME}" > ${EXPFILE}
- ${NM} ${OBJECTS} | awk '{
- if ((($2 == "T") || ($2 == "D") || ($2 == "B")) \
- && ( substr($1,1,1) != ".")) {
- if (substr ($1, 1, 7) != "__sinit" &&
- substr ($1, 1, 7) != "__sterm") {
- if (substr ($1, 1, 5) == "__tf1")
- print (substr ($1, 7))
- else if (substr ($1, 1, 5) == "__tf9")
- print (substr ($1, 15))
- else
- print $1
- }
- }
- }' | sort -u >> ${EXPFILE}
-
- # On AIX a shared library is linked differently when
- # you want to dlopen the file
- if [ $DLOPEN = "1" ] ; then
- cc -G ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
- else
- cc ${OPTS} -o ${OFILE} ${OBJECTS} ${DEPS}
- ar ${X64} -r ${LIBNAME} ${OFILE}
- fi
-
- FINAL_LIBS="${LIBNAME}"
- fi
- ;;
-
- 'OpenSTEP')
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making OpenSTEP static library: " ${LIBNAME}
- libtool -static -o ${LIBNAME} - ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- ;;
-
- 'OSF1')
- if [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making OSF/1 static library: " ${LIBNAME}
- rm -f ${LIBNAME}
- ar -ruv ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- else
- VERSION="${MAJOR}.${MINOR}"
- LIBNAME="lib${LIBNAME}.so"
- echo "mklib: Making OSF/1 shared library: " ${LIBNAME}
- if [ "x$LINK" = "x" ] ; then
- if [ $CPLUSPLUS = 1 ] ; then
- LINK=cxx
- else
- LINK=cc
- fi
- fi
- rm -f ${LIBNAME}.${VERSION}
- ${LINK} -o ${LIBNAME}.${VERSION} -shared -set_version ${VERSION} -soname ${LIBNAME}.${VERSION} -expect_unresolved \* -all ${OBJECTS} ${DEPS}
- ln -sf ${LIBNAME}.${VERSION} ${LIBNAME}
- FINAL_LIBS="${LIBNAME} ${LIBNAME}.${VERSION}"
- fi
- ;;
-
- 'Darwin')
- if [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making Darwin static library: " ${LIBNAME}
- LINK="ar"
- OPTS="-ruvs"
- ${LINK} ${OPTS} ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- else
- # On Darwin a .bundle is used for a library that you want to dlopen
- if [ $DLOPEN = "1" ] ; then
- LIBSUFFIX="bundle"
- OPTS="${ARCHOPT} -bundle -multiply_defined suppress"
- else
- LIBSUFFIX="dylib"
- OPTS="${ARCHOPT} -dynamiclib -multiply_defined suppress -current_version ${MAJOR}.${MINOR}.0 -compatibility_version ${MAJOR}.${MINOR}.0 -install_name lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
- fi
- LINKNAME="lib${LIBNAME}.${LIBSUFFIX}"
- LIBNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
-
- # examine first object to determine ABI
- set ${OBJECTS}
- ABI_PPC=`file $1 | grep 'object ppc'`
- ABI_I386=`file $1 | grep 'object i386'`
- if [ "${ABI_PPC}" ] ; then
- OPTS="${OPTS} -arch ppc"
- fi
- if [ "${ABI_I386}" ] ; then
- OPTS="${OPTS} -arch i386"
- fi
-
- # XXX can we always add -isysroot /Developer/SDKs/MacOSX10.4u.sdk
- # to OPTS here?
-
- # determine linker
- if [ $CPLUSPLUS = 1 ] ; then
- LINK="g++"
- else
- LINK="cc"
- fi
-
- echo "mklib: Making Darwin shared library: " ${LIBNAME}
- ${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
- ln -s ${LIBNAME} ${LINKNAME}
- FINAL_LIBS="${LIBNAME} ${LINKNAME}"
- fi
- ;;
-
- 'LynxOS')
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making LynxOS static library: " ${LIBNAME}
- rm -f ${LIBNAME}
- ar ru ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- ;;
-
- 'BeOS')
- if [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making BeOS static library: " ${LIBNAME}
- ar -cru "${LIBNAME}" ${OBJECTS}
- else
- LIBNAME="lib${LIBNAME}.so"
- echo "mklib: Making BeOS shared library: " ${LIBNAME}
- gcc -nostart -Xlinker "-soname=${LIBNAME}" -L/Be/develop/lib/x86 -lbe ${DEPS} ${OBJECTS} -o "${LIBNAME}"
- mimeset -f "${LIBNAME}"
- # XXX remove the Mesa3D stuff here since mklib isn't mesa-specific.
- setversion "${LIBNAME}" -app ${MAJOR} ${MINOR} ${PATCH} -short "Powered by Mesa3D!" -long "Powered by Mesa3D!"
- fi
- FINAL_LIBS=${LIBNAME}
- ;;
-
- 'QNX')
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making QNX library: " ${LIBNAME}
- wlib ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- ;;
-
- 'MorphOS')
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making MorphOS library: " ${LIBNAME}
- ppc-morphos-ar rc ${LIBNAME} ${OBJECTS}
- FINAL_LIBS="${LIBNAME}"
- ;;
-
- 'icc' | 'icc-istatic')
- # Intel C compiler
- # This should get merged into the Linux code, above, since this isn't
- # really a different architecture.
- LIBNAME="lib${LIBNAME}" # prefix with "lib"
-
- if [ $STATIC = 1 ] ; then
- echo "mklib: Making Intel ICC static library: " ${LIBNAME}.a
- LINK="ar"
- OPTS="-ruv"
- # make lib
- ${LINK} ${OPTS} ${LIBNAME}.a ${OBJECTS}
- # finish up
- FINAL_LIBS="${LIBNAME}.a"
- else
- if [ $ARCH = icc-istatic ] ; then
- OPTS="-shared -i-static -cxxlib-icc"
- else
- OPTS="-shared"
- fi
- VERSION="${MAJOR}.${MINOR}.${PATCH}"
- echo "mklib: Making Intel ICC shared library: " ${LIBNAME}.so.${VERSION}
-
- if [ $CPLUSPLUS = 1 ] ; then
- LINK="icpc"
- else
- LINK="icc"
- fi
- # rm any old libs
- rm -f ${LIBNAME}.so.${VERSION}
- rm -f ${LIBNAME}.so.${MAJOR}
- rm -f ${LIBNAME}.so
- # make lib
- ${LINK} ${OPTS} -o ${LIBNAME}.so.${VERSION} ${OBJECTS} ${DEPS}
- # make usual symlinks
- ln -s ${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR}
- ln -s ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so
- # finish up
- FINAL_LIBS="${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so"
- fi
- ;;
-
- 'aix-gcc')
- # AIX with gcc
- if [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making AIX GCC static library: " ${LIBNAME}
- rm -f ${LIBNAME}
- ar ru ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- else
- LIBNAME="lib${LIBNAME}.so" # prefix with "lib", suffix with ".so"
- echo "mklib: Making AIX GCC shared library: " ${LIBNAME}
- # remove old lib
- rm -f ${LIBNAME}
- # make the lib
- gcc -shared -Wl,-G ${OBJECTS} ${DEPS} -o ${LIBNAME}
- # NOTE: the application linking with this library must specify
- # the -Wl,-brtl flags to gcc
- FINAL_LIBS=${LIBNAME}
- fi
- ;;
-
- 'ultrix')
- # XXX untested
- if [ $STATIC = 0 ] ; then
- echo "mklib: Warning shared libs not supported on Ultrix"
- fi
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making static library for Ultrix: " ${LIBNAME}
- rm -f ${LIBNAME}
- ar ru ${LIBNAME} ${OBJECTS}
- FINAL_LIBS="${LIBNAME}"
- ;;
-
- CYGWIN*)
- # GCC-based environment
- CYGNAME="cyg${LIBNAME}" # prefix with "cyg"
- LIBNAME="lib${LIBNAME}" # prefix with "lib"
-
- if [ $STATIC = 1 ] ; then
- echo "mklib: Making" $ARCH "static library: " ${LIBNAME}.a
- LINK="ar"
- OPTS="-ru"
- # make lib
- ${LINK} ${OPTS} ${LIBNAME}.a ${OBJECTS}
- ranlib ${LIBNAME}.a
- # finish up
- FINAL_LIBS=${LIBNAME}.a
- else
- OPTS="-shared -Wl,-export-all -Wl,--out-implib=${LIBNAME}-${MAJOR}.dll.a"
- echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}-${MAJOR}.dll
-
- if [ $CPLUSPLUS = 1 ] ; then
- LINK="g++"
- else
- LINK="gcc"
- fi
-
- # rm any old libs
- rm -f ${LIBNAME}-${MAJOR}.dll
- rm -f ${LIBNAME}.dll.a
- rm -f ${LIBNAME}.a
-
- # make lib
- ${LINK} ${OPTS} -o ${CYGNAME}-${MAJOR}.dll ${OBJECTS} ${DEPS}
- # make usual symlinks
- ln -s ${LIBNAME}-${MAJOR}.dll.a ${LIBNAME}.dll.a
- # finish up
- FINAL_LIBS="${LIBNAME}-${MAJOR}.dll.a ${LIBNAME}.dll.a"
- # special case for installing in bin
- FINAL_BINS="${CYGNAME}-${MAJOR}.dll"
- fi
- ;;
-
- 'example')
- # If you're adding support for a new architecture, you can
- # start with this:
- if [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making static library for example arch: " ${LIBNAME}
- rm -f ${LIBNAME}
- ar rv ${LIBNAME} ${OBJECTS}
- FINAL_LIBS="${LIBNAME}"
- else
- LIBNAME="lib${LIBNAME}.so" # prefix with "lib", suffix with ".so"
- echo "mklib: Making shared library for example arch: " ${LIBNAME}
- ld -o ${LIBNAME} ${OBJECTS} ${DEPS}
- FINAL_LIBS="${LIBNAME}"
- fi
- ;;
-
- *)
- echo "mklib: ERROR: Don't know how to make a static/shared library for" ${ARCH}
- echo "mklib: Please add necessary commands to mklib script."
- ;;
-esac
-
-
-#
-# Put library files into installation directory if specified.
-#
-if [ ${INSTALLDIR} != "." ] ; then
- echo "mklib: Installing" ${FINAL_LIBS} "in" ${INSTALLDIR}
- mv ${FINAL_LIBS} ${INSTALLDIR}/
-fi
diff --git a/bin/raw2png.py b/bin/raw2png.py
deleted file mode 100755
index f01e799..0000000
--- a/bin/raw2png.py
+++ /dev/null
@@ -1,366 +0,0 @@
-#!/usr/bin/env python
-##########################################################################
-#
-# Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sub license, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice (including the
-# next paragraph) shall be included in all copies or substantial portions
-# of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-# IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
-# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-##########################################################################
-
-
-import os.path
-import sys
-import struct
-import Image # http://www.pythonware.com/products/pil/
-
-PIPE_FORMAT_LAYOUT_RGBAZS = 0
-PIPE_FORMAT_LAYOUT_YCBCR = 1
-PIPE_FORMAT_LAYOUT_DXT = 2
-PIPE_FORMAT_LAYOUT_MIXED = 3
-
-PIPE_FORMAT_COMP_R = 0
-PIPE_FORMAT_COMP_G = 1
-PIPE_FORMAT_COMP_B = 2
-PIPE_FORMAT_COMP_A = 3
-PIPE_FORMAT_COMP_0 = 4
-PIPE_FORMAT_COMP_1 = 5
-PIPE_FORMAT_COMP_Z = 6
-PIPE_FORMAT_COMP_S = 7
-
-PIPE_FORMAT_TYPE_UNKNOWN = 0
-PIPE_FORMAT_TYPE_FLOAT = 1
-PIPE_FORMAT_TYPE_UNORM = 2
-PIPE_FORMAT_TYPE_SNORM = 3
-PIPE_FORMAT_TYPE_USCALED = 4
-PIPE_FORMAT_TYPE_SSCALED = 5
-PIPE_FORMAT_TYPE_SRGB = 6
-PIPE_FORMAT_TYPE_FIXED = 7
-
-def _PIPE_FORMAT_RGBAZS( SWZ, SIZEX, SIZEY, SIZEZ, SIZEW, EXP2, TYPE ):
- return ((PIPE_FORMAT_LAYOUT_RGBAZS << 0) |\
- ((SWZ) << 2) |\
- ((SIZEX) << 14) |\
- ((SIZEY) << 17) |\
- ((SIZEZ) << 20) |\
- ((SIZEW) << 23) |\
- ((EXP2) << 26) |\
- ((TYPE) << 29) )
-
-def _PIPE_FORMAT_SWZ( SWZX, SWZY, SWZZ, SWZW ):
- return (((SWZX) << 0) | ((SWZY) << 3) | ((SWZZ) << 6) | ((SWZW) << 9))
-
-def _PIPE_FORMAT_RGBAZS_1( SWZ, SIZEX, SIZEY, SIZEZ, SIZEW, TYPE ):
- return _PIPE_FORMAT_RGBAZS( SWZ, SIZEX, SIZEY, SIZEZ, SIZEW, 0, TYPE )
-
-def _PIPE_FORMAT_RGBAZS_2( SWZ, SIZEX, SIZEY, SIZEZ, SIZEW, TYPE ):
- _PIPE_FORMAT_RGBAZS( SWZ, SIZEX, SIZEY, SIZEZ, SIZEW, 1, TYPE )
-
-def _PIPE_FORMAT_RGBAZS_8( SWZ, SIZEX, SIZEY, SIZEZ, SIZEW, TYPE ):
- return _PIPE_FORMAT_RGBAZS( SWZ, SIZEX, SIZEY, SIZEZ, SIZEW, 3, TYPE )
-
-def _PIPE_FORMAT_RGBAZS_64( SWZ, SIZEX, SIZEY, SIZEZ, SIZEW, TYPE ):
- return _PIPE_FORMAT_RGBAZS( SWZ, SIZEX, SIZEY, SIZEZ, SIZEW, 6, TYPE )
-
-def _PIPE_FORMAT_MIXED( SWZ, SIZEX, SIZEY, SIZEZ, SIZEW, SIGNX, SIGNY, SIGNZ, SIGNW, NORMALIZED, SCALE8 ):
- return ((PIPE_FORMAT_LAYOUT_MIXED << 0) |\
- ((SWZ) << 2) |\
- ((SIZEX) << 14) |\
- ((SIZEY) << 17) |\
- ((SIZEZ) << 20) |\
- ((SIZEW) << 23) |\
- ((SIGNX) << 26) |\
- ((SIGNY) << 27) |\
- ((SIGNZ) << 28) |\
- ((SIGNW) << 29) |\
- ((NORMALIZED) << 30) |\
- ((SCALE8) << 31) )
-
-
-_PIPE_FORMAT_R001 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_1 )
-_PIPE_FORMAT_RG01 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_G, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_1 )
-_PIPE_FORMAT_RGB1 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_G, PIPE_FORMAT_COMP_B, PIPE_FORMAT_COMP_1 )
-_PIPE_FORMAT_RGBA = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_G, PIPE_FORMAT_COMP_B, PIPE_FORMAT_COMP_A )
-_PIPE_FORMAT_ARGB = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_A, PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_G, PIPE_FORMAT_COMP_B )
-_PIPE_FORMAT_ABGR = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_A, PIPE_FORMAT_COMP_B, PIPE_FORMAT_COMP_G, PIPE_FORMAT_COMP_R )
-_PIPE_FORMAT_BGRA = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_B, PIPE_FORMAT_COMP_G, PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_A )
-_PIPE_FORMAT_1RGB = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_1, PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_G, PIPE_FORMAT_COMP_B )
-_PIPE_FORMAT_1BGR = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_1, PIPE_FORMAT_COMP_B, PIPE_FORMAT_COMP_G, PIPE_FORMAT_COMP_R )
-_PIPE_FORMAT_BGR1 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_B, PIPE_FORMAT_COMP_G, PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_1 )
-_PIPE_FORMAT_0000 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0 )
-_PIPE_FORMAT_000R = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_R )
-_PIPE_FORMAT_RRR1 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_1 )
-_PIPE_FORMAT_RRRR = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_R )
-_PIPE_FORMAT_RRRG = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_G )
-_PIPE_FORMAT_Z000 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_Z, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0 )
-_PIPE_FORMAT_0Z00 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_Z, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0 )
-_PIPE_FORMAT_SZ00 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_S, PIPE_FORMAT_COMP_Z, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0 )
-_PIPE_FORMAT_ZS00 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_Z, PIPE_FORMAT_COMP_S, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0 )
-_PIPE_FORMAT_S000 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_S, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0 )
-
-def _PIPE_FORMAT_YCBCR( REV ):
- return ((PIPE_FORMAT_LAYOUT_YCBCR << 0) |\
- ((REV) << 2) )
-
-def _PIPE_FORMAT_DXT( LEVEL, RSIZE, GSIZE, BSIZE, ASIZE ):
- return ((PIPE_FORMAT_LAYOUT_DXT << 0) | \
- ((LEVEL) << 2) | \
- ((RSIZE) << 5) | \
- ((GSIZE) << 8) | \
- ((BSIZE) << 11) | \
- ((ASIZE) << 14) )
-
-PIPE_FORMAT_NONE = _PIPE_FORMAT_RGBAZS_1 ( _PIPE_FORMAT_0000, 0, 0, 0, 0, PIPE_FORMAT_TYPE_UNKNOWN )
-PIPE_FORMAT_A8R8G8B8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_ARGB, 1, 1, 1, 1, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_X8R8G8B8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_1RGB, 1, 1, 1, 1, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_B8G8R8A8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_BGRA, 1, 1, 1, 1, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_B8G8R8X8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_BGR1, 1, 1, 1, 1, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_A1R5G5B5_UNORM = _PIPE_FORMAT_RGBAZS_1 ( _PIPE_FORMAT_ARGB, 1, 5, 5, 5, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_A4R4G4B4_UNORM = _PIPE_FORMAT_RGBAZS_1 ( _PIPE_FORMAT_ARGB, 4, 4, 4, 4, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_R5G6B5_UNORM = _PIPE_FORMAT_RGBAZS_1 ( _PIPE_FORMAT_RGB1, 5, 6, 5, 0, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_A2B10G10R10_UNORM = _PIPE_FORMAT_RGBAZS_2 ( _PIPE_FORMAT_ABGR, 1, 5, 5, 5, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_L8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RRR1, 1, 1, 1, 0, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_A8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_000R, 0, 0, 0, 1, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_I8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RRRR, 1, 1, 1, 1, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_A8L8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RRRG, 1, 1, 1, 1, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_L16_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RRR1, 2, 2, 2, 0, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_YCBCR = _PIPE_FORMAT_YCBCR( 0 )
-PIPE_FORMAT_YCBCR_REV = _PIPE_FORMAT_YCBCR( 1 )
-PIPE_FORMAT_Z16_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_Z000, 2, 0, 0, 0, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_Z32_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_Z000, 4, 0, 0, 0, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_Z32_FLOAT = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_Z000, 4, 0, 0, 0, PIPE_FORMAT_TYPE_FLOAT )
-PIPE_FORMAT_S8Z24_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_SZ00, 1, 3, 0, 0, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_Z24S8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_ZS00, 3, 1, 0, 0, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_X8Z24_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_0Z00, 1, 3, 0, 0, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_Z24X8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_Z000, 3, 1, 0, 0, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_S8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_S000, 1, 0, 0, 0, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_R64_FLOAT = _PIPE_FORMAT_RGBAZS_64( _PIPE_FORMAT_R001, 1, 0, 0, 0, PIPE_FORMAT_TYPE_FLOAT )
-PIPE_FORMAT_R64G64_FLOAT = _PIPE_FORMAT_RGBAZS_64( _PIPE_FORMAT_RG01, 1, 1, 0, 0, PIPE_FORMAT_TYPE_FLOAT )
-PIPE_FORMAT_R64G64B64_FLOAT = _PIPE_FORMAT_RGBAZS_64( _PIPE_FORMAT_RGB1, 1, 1, 1, 0, PIPE_FORMAT_TYPE_FLOAT )
-PIPE_FORMAT_R64G64B64A64_FLOAT = _PIPE_FORMAT_RGBAZS_64( _PIPE_FORMAT_RGBA, 1, 1, 1, 1, PIPE_FORMAT_TYPE_FLOAT )
-PIPE_FORMAT_R32_FLOAT = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 4, 0, 0, 0, PIPE_FORMAT_TYPE_FLOAT )
-PIPE_FORMAT_R32G32_FLOAT = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 4, 4, 0, 0, PIPE_FORMAT_TYPE_FLOAT )
-PIPE_FORMAT_R32G32B32_FLOAT = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 4, 4, 4, 0, PIPE_FORMAT_TYPE_FLOAT )
-PIPE_FORMAT_R32G32B32A32_FLOAT = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 4, 4, 4, 4, PIPE_FORMAT_TYPE_FLOAT )
-PIPE_FORMAT_R32_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 4, 0, 0, 0, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_R32G32_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 4, 4, 0, 0, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_R32G32B32_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 4, 4, 4, 0, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_R32G32B32A32_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 4, 4, 4, 4, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_R32_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 4, 0, 0, 0, PIPE_FORMAT_TYPE_USCALED )
-PIPE_FORMAT_R32G32_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 4, 4, 0, 0, PIPE_FORMAT_TYPE_USCALED )
-PIPE_FORMAT_R32G32B32_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 4, 4, 4, 0, PIPE_FORMAT_TYPE_USCALED )
-PIPE_FORMAT_R32G32B32A32_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 4, 4, 4, 4, PIPE_FORMAT_TYPE_USCALED )
-PIPE_FORMAT_R32_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 4, 0, 0, 0, PIPE_FORMAT_TYPE_SNORM )
-PIPE_FORMAT_R32G32_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 4, 4, 0, 0, PIPE_FORMAT_TYPE_SNORM )
-PIPE_FORMAT_R32G32B32_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 4, 4, 4, 0, PIPE_FORMAT_TYPE_SNORM )
-PIPE_FORMAT_R32G32B32A32_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 4, 4, 4, 4, PIPE_FORMAT_TYPE_SNORM )
-PIPE_FORMAT_R32_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 4, 0, 0, 0, PIPE_FORMAT_TYPE_SSCALED )
-PIPE_FORMAT_R32G32_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 4, 4, 0, 0, PIPE_FORMAT_TYPE_SSCALED )
-PIPE_FORMAT_R32G32B32_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 4, 4, 4, 0, PIPE_FORMAT_TYPE_SSCALED )
-PIPE_FORMAT_R32G32B32A32_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 4, 4, 4, 4, PIPE_FORMAT_TYPE_SSCALED )
-PIPE_FORMAT_R16_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 2, 0, 0, 0, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_R16G16_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 2, 2, 0, 0, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_R16G16B16_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 2, 2, 2, 0, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_R16G16B16A16_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 2, 2, 2, 2, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_R16_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 2, 0, 0, 0, PIPE_FORMAT_TYPE_USCALED )
-PIPE_FORMAT_R16G16_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 2, 2, 0, 0, PIPE_FORMAT_TYPE_USCALED )
-PIPE_FORMAT_R16G16B16_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 2, 2, 2, 0, PIPE_FORMAT_TYPE_USCALED )
-PIPE_FORMAT_R16G16B16A16_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 2, 2, 2, 2, PIPE_FORMAT_TYPE_USCALED )
-PIPE_FORMAT_R16_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 2, 0, 0, 0, PIPE_FORMAT_TYPE_SNORM )
-PIPE_FORMAT_R16G16_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 2, 2, 0, 0, PIPE_FORMAT_TYPE_SNORM )
-PIPE_FORMAT_R16G16B16_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 2, 2, 2, 0, PIPE_FORMAT_TYPE_SNORM )
-PIPE_FORMAT_R16G16B16A16_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 2, 2, 2, 2, PIPE_FORMAT_TYPE_SNORM )
-PIPE_FORMAT_R16_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 2, 0, 0, 0, PIPE_FORMAT_TYPE_SSCALED )
-PIPE_FORMAT_R16G16_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 2, 2, 0, 0, PIPE_FORMAT_TYPE_SSCALED )
-PIPE_FORMAT_R16G16B16_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 2, 2, 2, 0, PIPE_FORMAT_TYPE_SSCALED )
-PIPE_FORMAT_R16G16B16A16_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 2, 2, 2, 2, PIPE_FORMAT_TYPE_SSCALED )
-PIPE_FORMAT_R8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 1, 0, 0, 0, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_R8G8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 1, 1, 0, 0, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_R8G8B8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 0, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_R8G8B8A8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 1, 1, 1, 1, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_R8G8B8X8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 1, PIPE_FORMAT_TYPE_UNORM )
-PIPE_FORMAT_R8_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 1, 0, 0, 0, PIPE_FORMAT_TYPE_USCALED )
-PIPE_FORMAT_R8G8_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 1, 1, 0, 0, PIPE_FORMAT_TYPE_USCALED )
-PIPE_FORMAT_R8G8B8_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 0, PIPE_FORMAT_TYPE_USCALED )
-PIPE_FORMAT_R8G8B8A8_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 1, 1, 1, 1, PIPE_FORMAT_TYPE_USCALED )
-PIPE_FORMAT_R8G8B8X8_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 1, PIPE_FORMAT_TYPE_USCALED )
-PIPE_FORMAT_R8_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 1, 0, 0, 0, PIPE_FORMAT_TYPE_SNORM )
-PIPE_FORMAT_R8G8_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 1, 1, 0, 0, PIPE_FORMAT_TYPE_SNORM )
-PIPE_FORMAT_R8G8B8_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 0, PIPE_FORMAT_TYPE_SNORM )
-PIPE_FORMAT_R8G8B8A8_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 1, 1, 1, 1, PIPE_FORMAT_TYPE_SNORM )
-PIPE_FORMAT_R8G8B8X8_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 1, PIPE_FORMAT_TYPE_SNORM )
-PIPE_FORMAT_B6G5R5_SNORM = _PIPE_FORMAT_RGBAZS_1 ( _PIPE_FORMAT_BGR1, 6, 5, 5, 0, PIPE_FORMAT_TYPE_SNORM )
-PIPE_FORMAT_A8B8G8R8_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_BGRA, 1, 1, 1, 1, PIPE_FORMAT_TYPE_SNORM )
-PIPE_FORMAT_X8B8G8R8_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 1, PIPE_FORMAT_TYPE_SNORM )
-PIPE_FORMAT_R8_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 1, 0, 0, 0, PIPE_FORMAT_TYPE_SSCALED )
-PIPE_FORMAT_R8G8_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 1, 1, 0, 0, PIPE_FORMAT_TYPE_SSCALED )
-PIPE_FORMAT_R8G8B8_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 0, PIPE_FORMAT_TYPE_SSCALED )
-PIPE_FORMAT_R8G8B8A8_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 1, 1, 1, 1, PIPE_FORMAT_TYPE_SSCALED )
-PIPE_FORMAT_R8G8B8X8_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 1, PIPE_FORMAT_TYPE_SSCALED )
-PIPE_FORMAT_R32_FIXED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 4, 0, 0, 0, PIPE_FORMAT_TYPE_FIXED )
-PIPE_FORMAT_R32G32_FIXED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 4, 4, 0, 0, PIPE_FORMAT_TYPE_FIXED )
-PIPE_FORMAT_R32G32B32_FIXED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 4, 4, 4, 0, PIPE_FORMAT_TYPE_FIXED )
-PIPE_FORMAT_R32G32B32A32_FIXED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 4, 4, 4, 4, PIPE_FORMAT_TYPE_FIXED )
-PIPE_FORMAT_L8_SRGB = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RRR1, 1, 1, 1, 0, PIPE_FORMAT_TYPE_SRGB )
-PIPE_FORMAT_A8_L8_SRGB = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RRRG, 1, 1, 1, 1, PIPE_FORMAT_TYPE_SRGB )
-PIPE_FORMAT_R8G8B8_SRGB = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 0, PIPE_FORMAT_TYPE_SRGB )
-PIPE_FORMAT_R8G8B8A8_SRGB = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 1, 1, 1, 1, PIPE_FORMAT_TYPE_SRGB )
-PIPE_FORMAT_R8G8B8X8_SRGB = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 1, PIPE_FORMAT_TYPE_SRGB )
-PIPE_FORMAT_X8UB8UG8SR8S_NORM = _PIPE_FORMAT_MIXED( _PIPE_FORMAT_1BGR, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1 )
-PIPE_FORMAT_B6UG5SR5S_NORM = _PIPE_FORMAT_MIXED( _PIPE_FORMAT_BGR1, 6, 5, 5, 0, 0, 1, 1, 0, 1, 0 )
-PIPE_FORMAT_DXT1_RGB = _PIPE_FORMAT_DXT( 1, 8, 8, 8, 0 )
-PIPE_FORMAT_DXT1_RGBA = _PIPE_FORMAT_DXT( 1, 8, 8, 8, 8 )
-PIPE_FORMAT_DXT3_RGBA = _PIPE_FORMAT_DXT( 3, 8, 8, 8, 8 )
-PIPE_FORMAT_DXT5_RGBA = _PIPE_FORMAT_DXT( 5, 8, 8, 8, 8 )
-
-
-formats = {}
-for name, value in globals().items():
- if name.startswith("PIPE_FORMAT_") and isinstance(value, int):
- formats[value] = name
-
-
-def clip(g):
- return min(max(g, 0), 255)
-
-
-def yuv2rgb(y, u, v):
- C = y - 16
- D = u - 128
- E = v - 128
-
- r = clip(( 298 * C + 409 * E + 128) >> 8)
- g = clip(( 298 * C - 100 * D - 208 * E + 128) >> 8)
- b = clip(( 298 * C + 516 * D + 128) >> 8)
-
- return r, g, b
-
-
-def translate_r5g6b5(data):
- value, = struct.unpack_from("H", data)
- r = ((value >> 11) & 0x1f)*0xff/0x1f
- g = ((value >> 5) & 0x3f)*0xff/0x3f
- b = ((value >> 0) & 0x1f)*0xff/0x1f
- a = 255
- return [[(r, g, b, a)]]
-
-def translate_a8r8g8b8(data):
- b, g, r, a = struct.unpack_from("BBBB", data)
- return [[(r, g, b, a)]]
-
-
-def translate_x8r8g8b8(data):
- b, g, r, x = struct.unpack_from("BBBB", data)
- a = 255
- return [[(r, g, b, a)]]
-
-def translate_r8g8b8a8(data):
- r, g, b, a = struct.unpack_from("BBBB", data)
- return [[(r, g, b, a)]]
-
-def translate_ycbcr(data):
- y1, u, y2, v = struct.unpack_from("BBBB", data)
- r1, g1, b1 = yuv2rgb(y1, u, v)
- r2, g2, b2 = yuv2rgb(y1, u, v)
- return [[(r1, g1, b1, 255), (r2, g2, b2, 255)]]
-
-def translate_ycbcr_rev(data):
- v, y2, u, y1 = struct.unpack_from("BBBB", data)
- r1, g1, b1 = yuv2rgb(y1, u, v)
- r2, g2, b2 = yuv2rgb(y1, u, v)
- return [[(r1, g1, b1, 255), (r2, g2, b2, 255)]]
-
-def translate_x8z24(data):
- value, = struct.unpack_from("I", data)
- r = g = b = (value & 0xffffff)*0xff/0xffffff
- a = 255
- return [[(r, g, b, a)]]
-
-def translate_s8z24(data):
- value, = struct.unpack_from("I", data)
- r = (value & 0xffffff)*0xff/0xffffff
- g = value >> 24
- b = 0
- a = 255
- return [[(r, g, b, a)]]
-
-
-translate = {
- PIPE_FORMAT_A8R8G8B8_UNORM: (4, 1, 1, translate_a8r8g8b8),
- PIPE_FORMAT_X8R8G8B8_UNORM: (4, 1, 1, translate_x8r8g8b8),
- PIPE_FORMAT_B8G8R8A8_UNORM: (4, 1, 1, translate_r8g8b8a8),
- PIPE_FORMAT_B8G8R8X8_UNORM: (4, 1, 1, translate_r8g8b8a8),
- PIPE_FORMAT_A8B8G8R8_SNORM: (4, 1, 1, translate_r8g8b8a8),
- PIPE_FORMAT_R5G6B5_UNORM: (2, 1, 1, translate_r5g6b5),
- PIPE_FORMAT_YCBCR: (4, 2, 1, translate_ycbcr),
- PIPE_FORMAT_YCBCR_REV: (4, 2, 1, translate_ycbcr_rev),
- PIPE_FORMAT_S8Z24_UNORM: (4, 1, 1, translate_s8z24),
- PIPE_FORMAT_X8Z24_UNORM: (4, 1, 1, translate_x8z24),
-}
-
-def read_header(infile):
- header_fmt = "IIII"
- header = infile.read(struct.calcsize(header_fmt))
- return struct.unpack_from(header_fmt, header)
-
-def process(infilename, outfilename):
- sys.stderr.write("%s -> %s\n" % (infilename, outfilename))
- infile = open(infilename, "rb")
- format, cpp, width, height = read_header(infile)
- sys.stderr.write(" %ux%ux%ubpp %s\n" % (width, height, cpp*8, formats[format]))
- outimage = Image.new(
- mode='RGB',
- size=(width, height),
- color=(0,0,0))
- outpixels = outimage.load()
- try:
- bsize, bwidth, bheight, translate_func = translate[format]
- except KeyError:
- sys.stderr.write('error: unsupported format %s\n' % formats[format])
- return
- for y in range(0, height, bheight):
- for x in range(0, width, bwidth):
- indata = infile.read(bsize)
- outdata = translate_func(indata)
- for j in range(bheight):
- for i in range(bwidth):
- r, g, b, a = outdata[j][i]
- outpixels[x+i, y+j] = r, g, b
- outimage.save(outfilename, "PNG")
-
-
-def main():
- if sys.platform == 'win32':
- # wildcard expansion
- from glob import glob
- args = []
- for arg in sys.argv[1:]:
- args.extend(glob(arg))
- else:
- args = sys.argv[1:]
- for infilename in args:
- root, ext = os.path.splitext(infilename)
- outfilename = root + ".png"
- process(infilename, outfilename)
-
-
-if __name__ == '__main__':
- main()
diff --git a/bin/win32kprof.py b/bin/win32kprof.py
deleted file mode 100755
index c36317d..0000000
--- a/bin/win32kprof.py
+++ /dev/null
@@ -1,309 +0,0 @@
-#!/usr/bin/env python
-##########################################################################
-#
-# Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sub license, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice (including the
-# next paragraph) shall be included in all copies or substantial portions
-# of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-# IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
-# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-##########################################################################
-
-
-import sys
-import optparse
-import re
-import struct
-
-from gprof2dot import Call, Function, Profile
-from gprof2dot import CALLS, SAMPLES, TIME, TIME_RATIO, TOTAL_TIME, TOTAL_TIME_RATIO
-from gprof2dot import DotWriter, TEMPERATURE_COLORMAP
-
-
-__version__ = '0.1'
-
-
-class ParseError(Exception):
- pass
-
-
-class MsvcDemangler:
- # http://www.kegel.com/mangle.html
-
- def __init__(self, symbol):
- self._symbol = symbol
- self._pos = 0
-
- def lookahead(self):
- return self._symbol[self._pos]
-
- def consume(self):
- ret = self.lookahead()
- self._pos += 1
- return ret
-
- def match(self, c):
- if self.lookahead() != c:
- raise ParseError
- self.consume()
-
- def parse(self):
- self.match('?')
- name = self.parse_name()
- qualifications = self.parse_qualifications()
- return '::'.join(qualifications + [name])
-
- def parse_name(self):
- if self.lookahead() == '?':
- return self.consume() + self.consume()
- else:
- name = self.parse_id()
- self.match('@')
- return name
-
- def parse_qualifications(self):
- qualifications = []
- while self.lookahead() != '@':
- name = self.parse_id()
- qualifications.append(name)
- self.match('@')
- return qualifications
-
- def parse_id(self):
- s = ''
- while True:
- c = self.lookahead()
- if c.isalnum() or c in '_':
- s += c
- self.consume()
- else:
- break
- return s
-
-
-def demangle(name):
- if name.startswith('_'):
- name = name[1:]
- idx = name.rfind('@')
- if idx != -1 and name[idx+1:].isdigit():
- name = name[:idx]
- return name
- if name.startswith('?'):
- demangler = MsvcDemangler(name)
- return demangler.parse()
- return name
-
-
-class Reader:
-
- def __init__(self):
- self.symbols = []
- self.symbol_cache = {}
- self.base_addr = None
-
- def read_map(self, mapfile):
- # See http://msdn.microsoft.com/en-us/library/k7xkk3e2.aspx
- last_addr = 0
- last_name = 0
- for line in file(mapfile, "rt"):
- fields = line.split()
- try:
- section_offset, name, addr, type, lib_object = fields
- except ValueError:
- continue
- if type != 'f':
- continue
- section, offset = section_offset.split(':')
- addr = int(offset, 16)
- self.symbols.append((addr, name))
- last_addr = addr
- last_name = name
-
- # sort symbols
- self.symbols.sort(key = lambda (addr, name): addr)
-
- def lookup_addr(self, addr):
- try:
- return self.symbol_cache[addr]
- except KeyError:
- pass
-
- tolerance = 4196
- s, e = 0, len(self.symbols)
- while s != e:
- i = (s + e)//2
- start_addr, name = self.symbols[i]
- try:
- end_addr, next_name = self.symbols[i + 1]
- except IndexError:
- end_addr = start_addr + tolerance
- if addr < start_addr:
- e = i
- continue
- if addr == end_addr:
- return next_name, addr - start_addr
- if addr > end_addr:
- s = i
- continue
- return name, addr - start_addr
- raise ValueError
-
- def lookup_symbol(self, name):
- for symbol_addr, symbol_name in self.symbols:
- if name == symbol_name:
- return symbol_addr
- return 0
-
- def read_data(self, data):
- profile = Profile()
-
- fp = file(data, "rb")
- entry_format = "IIII"
- entry_size = struct.calcsize(entry_format)
- caller = None
- caller_stack = []
- while True:
- entry = fp.read(entry_size)
- if len(entry) < entry_size:
- break
- caller_addr, callee_addr, samples_lo, samples_hi = struct.unpack(entry_format, entry)
- if caller_addr == 0 and callee_addr == 0:
- continue
-
- if self.base_addr is None:
- ref_addr = self.lookup_symbol('___debug_profile_reference@0')
- if ref_addr:
- self.base_addr = (caller_addr - ref_addr) & ~(options.align - 1)
- else:
- self.base_addr = 0
- sys.stderr.write('Base addr: %08x\n' % self.base_addr)
-
- samples = (samples_hi << 32) | samples_lo
-
- try:
- caller_raddr = caller_addr - self.base_addr
- caller_sym, caller_ofs = self.lookup_addr(caller_raddr)
-
- try:
- caller = profile.functions[caller_sym]
- except KeyError:
- caller_name = demangle(caller_sym)
- caller = Function(caller_sym, caller_name)
- profile.add_function(caller)
- caller[CALLS] = 0
- caller[SAMPLES] = 0
- except ValueError:
- caller = None
-
- if not callee_addr:
- if caller:
- caller[SAMPLES] += samples
- else:
- callee_raddr = callee_addr - self.base_addr
- callee_sym, callee_ofs = self.lookup_addr(callee_raddr)
-
- try:
- callee = profile.functions[callee_sym]
- except KeyError:
- callee_name = demangle(callee_sym)
- callee = Function(callee_sym, callee_name)
- profile.add_function(callee)
- callee[CALLS] = samples
- callee[SAMPLES] = 0
- else:
- callee[CALLS] += samples
-
- if caller is not None:
- try:
- call = caller.calls[callee.id]
- except KeyError:
- call = Call(callee.id)
- call[CALLS] = samples
- caller.add_call(call)
- else:
- call[CALLS] += samples
-
- if options.verbose:
- if not callee_addr:
- sys.stderr.write('%s+%u: %u\n' % (caller_sym, caller_ofs, samples))
- else:
- sys.stderr.write('%s+%u -> %s+%u: %u\n' % (caller_sym, caller_ofs, callee_sym, callee_ofs, samples))
-
- # compute derived data
- profile.validate()
- profile.find_cycles()
- profile.aggregate(SAMPLES)
- profile.ratio(TIME_RATIO, SAMPLES)
- profile.call_ratios(CALLS)
- profile.integrate(TOTAL_TIME_RATIO, TIME_RATIO)
-
- return profile
-
-
-def main():
- parser = optparse.OptionParser(
- usage="\n\t%prog [options] [file] ...",
- version="%%prog %s" % __version__)
- parser.add_option(
- '-a', '--align', metavar='NUMBER',
- type="int", dest="align", default=16,
- help="section alignment")
- parser.add_option(
- '-m', '--map', metavar='FILE',
- type="string", dest="map",
- help="map file")
- parser.add_option(
- '-b', '--base', metavar='FILE',
- type="string", dest="base",
- help="base addr")
- parser.add_option(
- '-n', '--node-thres', metavar='PERCENTAGE',
- type="float", dest="node_thres", default=0.5,
- help="eliminate nodes below this threshold [default: %default]")
- parser.add_option(
- '-e', '--edge-thres', metavar='PERCENTAGE',
- type="float", dest="edge_thres", default=0.1,
- help="eliminate edges below this threshold [default: %default]")
- parser.add_option(
- '-v', '--verbose',
- action="count",
- dest="verbose", default=0,
- help="verbose output")
-
- global options
- (options, args) = parser.parse_args(sys.argv[1:])
-
- reader = Reader()
- if options.base is not None:
- reader.base_addr = int(options.base, 16)
- if options.map is not None:
- reader.read_map(options.map)
- for arg in args:
- profile = reader.read_data(arg)
- profile.prune(options.node_thres/100.0, options.edge_thres/100.0)
- output = sys.stdout
- dot = DotWriter(output)
- colormap = TEMPERATURE_COLORMAP
- dot.graph(profile, colormap)
-
-
-if __name__ == '__main__':
- main()
-
diff --git a/configs/.gitignore b/configs/.gitignore
deleted file mode 100644
index 5b9023a..0000000
--- a/configs/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-current
diff --git a/configs/default b/configs/default
deleted file mode 100644
index 1991aca..0000000
--- a/configs/default
+++ /dev/null
@@ -1,67 +0,0 @@
-# Default/template configuration
-
-# This is included by other config files which may override some
-# of these variables.
-# Think of this as a base class from which configs are derived.
-
-
-CONFIG_NAME = default
-
-# Version info
-MESA_MAJOR=7
-MESA_MINOR=1
-MESA_TINY=0
-
-# external projects. This should be useless now that we use libdrm.
-DRM_SOURCE_PATH=$(TOP)/../drm
-
-# Compiler and flags
-CC = cc
-CXX = CC
-HOST_CC = $(CC)
-CFLAGS = -O
-CXXFLAGS = -O
-
-# Compiler for building demos/tests/etc
-APP_CC = $(CC)
-APP_CXX = $(CXX)
-
-# Misc tools and flags
-MKLIB_OPTIONS =
-MKDEP = makedepend
-MKDEP_OPTIONS = -fdepend
-MAKE = make
-INSTALL = $(TOP)/bin/minstall
-
-# Python and flags (generally only needed by the developers)
-PYTHON2 = python
-PYTHON_FLAGS = -t -O -O
-
-# Library names (base name)
-CL_LIB = OpenCL
-
-
-# Library names (actual file names)
-CL_LIB_NAME = lib$(CL_LIB).so
-
-SYS_LIBS = -lstdc++
-# Directories to build
-LIB_DIR = lib
-SRC_DIRS = gallium mesa gallium/winsys
-DRIVER_DIRS =
-# Which subdirs under $(TOP)/progs/ to enter:
-PROGRAM_DIRS =
-
-
-# Gallium directories and
-GALLIUM_AUXILIARY_DIRS = draw translate cso_cache pipebuffer tgsi rtasm util
-GALLIUM_AUXILIARIES = $(foreach DIR,$(GALLIUM_AUXILIARY_DIRS),$(GALLIUM)/src/gallium/auxiliary/$(DIR)/lib$(DIR).a)
-GALLIUM_DRIVER_DIRS = softpipe i915simple i965simple failover
-GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVER_DIRS),$(GALLIUM)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
-GALLIUM_WINSYS_DIRS = iegd
-
-
-# Library/program dependencies
-#EXTRA_LIB_PATH ?=
-CL_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread
-APP_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(CL_LIB) -lm
diff --git a/configs/linux-dri b/configs/linux-dri
deleted file mode 100644
index 1946945..0000000
--- a/configs/linux-dri
+++ /dev/null
@@ -1,35 +0,0 @@
-# -*-makefile-*-
-# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-dri
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-
-OPT_FLAGS = -O2 -g
-PIC_FLAGS = -fPIC
-
-ARCH_FLAGS ?=
-
-DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
- -D_BSD_SOURCE -D_GNU_SOURCE \
- -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 \
- -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN
-
-CFLAGS = -Wall -Wmissing-prototypes -std=c99 -ffast-math \
- $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) $(ASM_FLAGS)
-
-CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
-
-
-LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
-LIBDRM_LIB = $(shell pkg-config --libs libdrm)
-DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
-CL_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -ldl \
- $(LIBDRM_LIB)
-
-# Directories
-SRC_DIRS := $(SRC_DIRS)
diff --git a/configs/linux-dri-debug b/configs/linux-dri-debug
deleted file mode 100644
index c3a4584..0000000
--- a/configs/linux-dri-debug
+++ /dev/null
@@ -1,16 +0,0 @@
-# -*-makefile-*-
-# Configuration for linux-dri-debug: Linux DRI hardware drivers for XFree86 & others
-
-include $(TOP)/configs/linux-dri
-
-CONFIG_NAME = linux-dri-debug
-OPT_FLAGS = -O0 -g
-ARCH_FLAGS = -DDEBUG
-
-# Helpful to reduce the amount of stuff that gets built sometimes:
-#DRI_DIRS = i915tex i915
-#DRI_DIRS = i965
-#DRI_DIRS = radeon r200 r300
-#DRI_DIRS = unichrome sis trident
-#DRI_DIRS = i810 mga r128 tdfx
-
diff --git a/configs/linux-dri-x86 b/configs/linux-dri-x86
deleted file mode 100644
index 96c42d7..0000000
--- a/configs/linux-dri-x86
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*-makefile-*-
-# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
-
-include $(TOP)/configs/linux-dri
-
-CONFIG_NAME = linux-dri-x86
-
-ARCH_FLAGS = -m32 -mmmx -msse -msse2
-
-
diff --git a/configs/linux-dri-x86-64 b/configs/linux-dri-x86-64
deleted file mode 100644
index 61cde5d..0000000
--- a/configs/linux-dri-x86-64
+++ /dev/null
@@ -1,12 +0,0 @@
-# -*-makefile-*-
-# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
-
-include $(TOP)/configs/linux-dri
-
-CONFIG_NAME = linux-dri-x86-64
-
-ARCH_FLAGS = -m64
-
-
-LIB_DIR = lib64
-
diff --git a/examples/.gitignore b/examples/.gitignore
new file mode 100644
index 0000000..f3c7a7c
--- /dev/null
+++ b/examples/.gitignore
@@ -0,0 +1 @@
+Makefile
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
new file mode 100644
index 0000000..21dc194
--- /dev/null
+++ b/examples/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(trivial)
diff --git a/examples/trivial/CMakeLists.txt b/examples/trivial/CMakeLists.txt
new file mode 100644
index 0000000..bfbe273
--- /dev/null
+++ b/examples/trivial/CMakeLists.txt
@@ -0,0 +1,8 @@
+include_directories (${Clover_SOURCE_DIR}/include)
+
+message(STATUS "source is ${Clover_SOURCE_DIR}")
+link_directories (${Clover_BINARY_DIR}/src)
+
+add_executable (basic basic.c)
+
+target_link_libraries (basic OpenCL)
diff --git a/examples/trivial/Makefile b/examples/trivial/Makefile
index 082df13..634d288 100644
--- a/examples/trivial/Makefile
+++ b/examples/trivial/Makefile
@@ -1,40 +1,161 @@
-TOP = ../..
-include $(TOP)/configs/current
+# CMAKE generated file: DO NOT EDIT!
+# Generated by "Unix Makefiles" Generator, CMake Version 2.6
+# Default target executed when no arguments are given to make.
+default_target: all
+.PHONY : default_target
-LIBS = -L$(TOP)/$(LIB_DIR) -l$(CL_LIB) $(APP_LIB_DEPS)
+#=============================================================================
+# Special targets provided by cmake.
-SOURCES = \
- basic.c
+# Disable implicit rules so canoncical targets will work.
+.SUFFIXES:
-PROGS = $(SOURCES:%.c=%)
+# Remove some rules from gmake that .SUFFIXES does not remove.
+SUFFIXES =
-INCLUDES = -I. -I$(TOP)/include -I../samples
+.SUFFIXES: .hpux_make_needs_suffix_list
+# Suppress display of executed commands.
+$(VERBOSE).SILENT:
-##### RULES #####
+# A target that is always out of date.
+cmake_force:
+.PHONY : cmake_force
-.SUFFIXES:
-.SUFFIXES: .c
+#=============================================================================
+# Set environment variables for the build.
+
+# The shell in which to execute make rules.
+SHELL = /bin/sh
+
+# The CMake executable.
+CMAKE_COMMAND = /usr/bin/cmake
+
+# The command to remove a file.
+RM = /usr/bin/cmake -E remove -f
+
+# The top-level source directory on which CMake was run.
+CMAKE_SOURCE_DIR = /home/zack/projects/clover
+
+# The top-level build directory on which CMake was run.
+CMAKE_BINARY_DIR = /home/zack/projects/clover
-.c:
- $(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
+#=============================================================================
+# Targets provided globally by CMake.
-.c.o:
- $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+# Special rule for the target edit_cache
+edit_cache:
+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..."
+ /usr/bin/cmake -i .
+.PHONY : edit_cache
-.S.o:
- $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+# Special rule for the target edit_cache
+edit_cache/fast: edit_cache
+.PHONY : edit_cache/fast
+# Special rule for the target rebuild_cache
+rebuild_cache:
+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
+ /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
+.PHONY : rebuild_cache
-##### TARGETS #####
+# Special rule for the target rebuild_cache
+rebuild_cache/fast: rebuild_cache
+.PHONY : rebuild_cache/fast
-default: $(PROGS)
+# The main all target
+all: cmake_check_build_system
+ cd /home/zack/projects/clover && $(CMAKE_COMMAND) -E cmake_progress_start /home/zack/projects/clover/CMakeFiles /home/zack/projects/clover/examples/trivial/CMakeFiles/progress.make
+ cd /home/zack/projects/clover && $(MAKE) -f CMakeFiles/Makefile2 examples/trivial/all
+ $(CMAKE_COMMAND) -E cmake_progress_start /home/zack/projects/clover/CMakeFiles 0
+.PHONY : all
+# The main clean target
clean:
- -rm -f $(PROGS)
- -rm -f *.o
+ cd /home/zack/projects/clover && $(MAKE) -f CMakeFiles/Makefile2 examples/trivial/clean
+.PHONY : clean
+
+# The main clean target
+clean/fast: clean
+.PHONY : clean/fast
+
+# Prepare targets for installation.
+preinstall: all
+ cd /home/zack/projects/clover && $(MAKE) -f CMakeFiles/Makefile2 examples/trivial/preinstall
+.PHONY : preinstall
+
+# Prepare targets for installation.
+preinstall/fast:
+ cd /home/zack/projects/clover && $(MAKE) -f CMakeFiles/Makefile2 examples/trivial/preinstall
+.PHONY : preinstall/fast
+
+# clear depends
+depend:
+ cd /home/zack/projects/clover && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
+.PHONY : depend
+
+# Convenience name for target.
+examples/trivial/CMakeFiles/basic.dir/rule:
+ cd /home/zack/projects/clover && $(MAKE) -f CMakeFiles/Makefile2 examples/trivial/CMakeFiles/basic.dir/rule
+.PHONY : examples/trivial/CMakeFiles/basic.dir/rule
+
+# Convenience name for target.
+basic: examples/trivial/CMakeFiles/basic.dir/rule
+.PHONY : basic
+
+# fast build rule for target.
+basic/fast:
+ cd /home/zack/projects/clover && $(MAKE) -f examples/trivial/CMakeFiles/basic.dir/build.make examples/trivial/CMakeFiles/basic.dir/build
+.PHONY : basic/fast
+
+basic.o: basic.c.o
+.PHONY : basic.o
+
+# target to build an object file
+basic.c.o:
+ cd /home/zack/projects/clover && $(MAKE) -f examples/trivial/CMakeFiles/basic.dir/build.make examples/trivial/CMakeFiles/basic.dir/basic.c.o
+.PHONY : basic.c.o
+
+basic.i: basic.c.i
+.PHONY : basic.i
+
+# target to preprocess a source file
+basic.c.i:
+ cd /home/zack/projects/clover && $(MAKE) -f examples/trivial/CMakeFiles/basic.dir/build.make examples/trivial/CMakeFiles/basic.dir/basic.c.i
+.PHONY : basic.c.i
+
+basic.s: basic.c.s
+.PHONY : basic.s
+
+# target to generate assembly for a file
+basic.c.s:
+ cd /home/zack/projects/clover && $(MAKE) -f examples/trivial/CMakeFiles/basic.dir/build.make examples/trivial/CMakeFiles/basic.dir/basic.c.s
+.PHONY : basic.c.s
+
+# Help Target
+help:
+ @echo "The following are some of the valid targets for this Makefile:"
+ @echo "... all (the default if no target is provided)"
+ @echo "... clean"
+ @echo "... depend"
+ @echo "... basic"
+ @echo "... edit_cache"
+ @echo "... rebuild_cache"
+ @echo "... basic.o"
+ @echo "... basic.i"
+ @echo "... basic.s"
+.PHONY : help
+
+
+
+#=============================================================================
+# Special targets to cleanup operation of make.
+
+# Special rule to run CMake to check the build system integrity.
+# No rule that depends on this can have commands that come from listfiles
+# because they might be regenerated.
+cmake_check_build_system:
+ cd /home/zack/projects/clover && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
+.PHONY : cmake_check_build_system
-# Emacs tags
-tags:
- etags `find . -name \*.[ch]` `find ../include`
diff --git a/src/.gitignore b/src/.gitignore
index 5761abc..ec5d309 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -1 +1,3 @@
*.o
+CMakeFiles/
+cmake_install.cmake
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..9591170
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,28 @@
+include_directories (${Clover_SOURCE_DIR}/include
+ ${Clover_SOURCE_DIR}
+ ${GALLIUM}/include
+ ${GALLIUM}/src/gallium/include
+ ${GALLIUM}/src/gallium/auxiliary
+ ${GALLIUM}/src/gallium/drivers
+ )
+
+add_library(OpenCL SHARED
+ api_command.cpp api_device.cpp
+ api_event.cpp api_kernel.cpp
+ api_platform.cpp api_program.cpp
+ device.cpp api_context.cpp
+ api_enqueue.cpp api_flush.cpp
+ api_memory.cpp api_profiling.cpp
+ api_sampler.cpp ../cpuwinsys/cpuwinsys.c)
+
+TARGET_LINK_LIBRARIES(OpenCL
+ ${GALLIUM}/src/gallium/auxiliary/pipebuffer/libpipebuffer.a
+ ${GALLIUM}/src/gallium/auxiliary/sct/libsct.a
+ ${GALLIUM}/src/gallium/auxiliary/draw/libdraw.a
+ ${GALLIUM}/src/gallium/auxiliary/rtasm/librtasm.a
+ ${GALLIUM}/src/gallium/auxiliary/translate/libtranslate.a
+ ${GALLIUM}/src/gallium/auxiliary/cso_cache/libcso_cache.a
+ ${GALLIUM}/src/gallium/auxiliary/tgsi/libtgsi.a
+ ${GALLIUM}/src/gallium/auxiliary/util/libutil.a
+ ${GALLIUM}/src/gallium/drivers/softpipe/libsoftpipe.a
+ )
diff --git a/src/Makefile b/src/Makefile
index e69de29..94c2e8b 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -0,0 +1,512 @@
+# CMAKE generated file: DO NOT EDIT!
+# Generated by "Unix Makefiles" Generator, CMake Version 2.6
+
+# Default target executed when no arguments are given to make.
+default_target: all
+.PHONY : default_target
+
+#=============================================================================
+# Special targets provided by cmake.
+
+# Disable implicit rules so canoncical targets will work.
+.SUFFIXES:
+
+# Remove some rules from gmake that .SUFFIXES does not remove.
+SUFFIXES =
+
+.SUFFIXES: .hpux_make_needs_suffix_list
+
+# Suppress display of executed commands.
+$(VERBOSE).SILENT:
+
+# A target that is always out of date.
+cmake_force:
+.PHONY : cmake_force
+
+#=============================================================================
+# Set environment variables for the build.
+
+# The shell in which to execute make rules.
+SHELL = /bin/sh
+
+# The CMake executable.
+CMAKE_COMMAND = /usr/bin/cmake
+
+# The command to remove a file.
+RM = /usr/bin/cmake -E remove -f
+
+# The top-level source directory on which CMake was run.
+CMAKE_SOURCE_DIR = /home/zack/projects/clover
+
+# The top-level build directory on which CMake was run.
+CMAKE_BINARY_DIR = /home/zack/projects/clover
+
+#=============================================================================
+# Targets provided globally by CMake.
+
+# Special rule for the target edit_cache
+edit_cache:
+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..."
+ /usr/bin/cmake -i .
+.PHONY : edit_cache
+
+# Special rule for the target edit_cache
+edit_cache/fast: edit_cache
+.PHONY : edit_cache/fast
+
+# Special rule for the target rebuild_cache
+rebuild_cache:
+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
+ /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
+.PHONY : rebuild_cache
+
+# Special rule for the target rebuild_cache
+rebuild_cache/fast: rebuild_cache
+.PHONY : rebuild_cache/fast
+
+# The main all target
+all: cmake_check_build_system
+ cd /home/zack/projects/clover && $(CMAKE_COMMAND) -E cmake_progress_start /home/zack/projects/clover/CMakeFiles /home/zack/projects/clover/src/CMakeFiles/progress.make
+ cd /home/zack/projects/clover && $(MAKE) -f CMakeFiles/Makefile2 src/all
+ $(CMAKE_COMMAND) -E cmake_progress_start /home/zack/projects/clover/CMakeFiles 0
+.PHONY : all
+
+# The main clean target
+clean:
+ cd /home/zack/projects/clover && $(MAKE) -f CMakeFiles/Makefile2 src/clean
+.PHONY : clean
+
+# The main clean target
+clean/fast: clean
+.PHONY : clean/fast
+
+# Prepare targets for installation.
+preinstall: all
+ cd /home/zack/projects/clover && $(MAKE) -f CMakeFiles/Makefile2 src/preinstall
+.PHONY : preinstall
+
+# Prepare targets for installation.
+preinstall/fast:
+ cd /home/zack/projects/clover && $(MAKE) -f CMakeFiles/Makefile2 src/preinstall
+.PHONY : preinstall/fast
+
+# clear depends
+depend:
+ cd /home/zack/projects/clover && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
+.PHONY : depend
+
+# Convenience name for target.
+src/CMakeFiles/OpenCL.dir/rule:
+ cd /home/zack/projects/clover && $(MAKE) -f CMakeFiles/Makefile2 src/CMakeFiles/OpenCL.dir/rule
+.PHONY : src/CMakeFiles/OpenCL.dir/rule
+
+# Convenience name for target.
+OpenCL: src/CMakeFiles/OpenCL.dir/rule
+.PHONY : OpenCL
+
+# fast build rule for target.
+OpenCL/fast:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/build
+.PHONY : OpenCL/fast
+
+__/cpuwinsys/cpuwinsys.o: __/cpuwinsys/cpuwinsys.c.o
+.PHONY : __/cpuwinsys/cpuwinsys.o
+
+# target to build an object file
+__/cpuwinsys/cpuwinsys.c.o:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/__/cpuwinsys/cpuwinsys.c.o
+.PHONY : __/cpuwinsys/cpuwinsys.c.o
+
+__/cpuwinsys/cpuwinsys.i: __/cpuwinsys/cpuwinsys.c.i
+.PHONY : __/cpuwinsys/cpuwinsys.i
+
+# target to preprocess a source file
+__/cpuwinsys/cpuwinsys.c.i:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/__/cpuwinsys/cpuwinsys.c.i
+.PHONY : __/cpuwinsys/cpuwinsys.c.i
+
+__/cpuwinsys/cpuwinsys.s: __/cpuwinsys/cpuwinsys.c.s
+.PHONY : __/cpuwinsys/cpuwinsys.s
+
+# target to generate assembly for a file
+__/cpuwinsys/cpuwinsys.c.s:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/__/cpuwinsys/cpuwinsys.c.s
+.PHONY : __/cpuwinsys/cpuwinsys.c.s
+
+api_command.o: api_command.cpp.o
+.PHONY : api_command.o
+
+# target to build an object file
+api_command.cpp.o:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_command.cpp.o
+.PHONY : api_command.cpp.o
+
+api_command.i: api_command.cpp.i
+.PHONY : api_command.i
+
+# target to preprocess a source file
+api_command.cpp.i:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_command.cpp.i
+.PHONY : api_command.cpp.i
+
+api_command.s: api_command.cpp.s
+.PHONY : api_command.s
+
+# target to generate assembly for a file
+api_command.cpp.s:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_command.cpp.s
+.PHONY : api_command.cpp.s
+
+api_context.o: api_context.cpp.o
+.PHONY : api_context.o
+
+# target to build an object file
+api_context.cpp.o:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_context.cpp.o
+.PHONY : api_context.cpp.o
+
+api_context.i: api_context.cpp.i
+.PHONY : api_context.i
+
+# target to preprocess a source file
+api_context.cpp.i:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_context.cpp.i
+.PHONY : api_context.cpp.i
+
+api_context.s: api_context.cpp.s
+.PHONY : api_context.s
+
+# target to generate assembly for a file
+api_context.cpp.s:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_context.cpp.s
+.PHONY : api_context.cpp.s
+
+api_device.o: api_device.cpp.o
+.PHONY : api_device.o
+
+# target to build an object file
+api_device.cpp.o:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_device.cpp.o
+.PHONY : api_device.cpp.o
+
+api_device.i: api_device.cpp.i
+.PHONY : api_device.i
+
+# target to preprocess a source file
+api_device.cpp.i:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_device.cpp.i
+.PHONY : api_device.cpp.i
+
+api_device.s: api_device.cpp.s
+.PHONY : api_device.s
+
+# target to generate assembly for a file
+api_device.cpp.s:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_device.cpp.s
+.PHONY : api_device.cpp.s
+
+api_enqueue.o: api_enqueue.cpp.o
+.PHONY : api_enqueue.o
+
+# target to build an object file
+api_enqueue.cpp.o:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_enqueue.cpp.o
+.PHONY : api_enqueue.cpp.o
+
+api_enqueue.i: api_enqueue.cpp.i
+.PHONY : api_enqueue.i
+
+# target to preprocess a source file
+api_enqueue.cpp.i:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_enqueue.cpp.i
+.PHONY : api_enqueue.cpp.i
+
+api_enqueue.s: api_enqueue.cpp.s
+.PHONY : api_enqueue.s
+
+# target to generate assembly for a file
+api_enqueue.cpp.s:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_enqueue.cpp.s
+.PHONY : api_enqueue.cpp.s
+
+api_event.o: api_event.cpp.o
+.PHONY : api_event.o
+
+# target to build an object file
+api_event.cpp.o:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_event.cpp.o
+.PHONY : api_event.cpp.o
+
+api_event.i: api_event.cpp.i
+.PHONY : api_event.i
+
+# target to preprocess a source file
+api_event.cpp.i:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_event.cpp.i
+.PHONY : api_event.cpp.i
+
+api_event.s: api_event.cpp.s
+.PHONY : api_event.s
+
+# target to generate assembly for a file
+api_event.cpp.s:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_event.cpp.s
+.PHONY : api_event.cpp.s
+
+api_flush.o: api_flush.cpp.o
+.PHONY : api_flush.o
+
+# target to build an object file
+api_flush.cpp.o:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_flush.cpp.o
+.PHONY : api_flush.cpp.o
+
+api_flush.i: api_flush.cpp.i
+.PHONY : api_flush.i
+
+# target to preprocess a source file
+api_flush.cpp.i:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_flush.cpp.i
+.PHONY : api_flush.cpp.i
+
+api_flush.s: api_flush.cpp.s
+.PHONY : api_flush.s
+
+# target to generate assembly for a file
+api_flush.cpp.s:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_flush.cpp.s
+.PHONY : api_flush.cpp.s
+
+api_kernel.o: api_kernel.cpp.o
+.PHONY : api_kernel.o
+
+# target to build an object file
+api_kernel.cpp.o:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_kernel.cpp.o
+.PHONY : api_kernel.cpp.o
+
+api_kernel.i: api_kernel.cpp.i
+.PHONY : api_kernel.i
+
+# target to preprocess a source file
+api_kernel.cpp.i:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_kernel.cpp.i
+.PHONY : api_kernel.cpp.i
+
+api_kernel.s: api_kernel.cpp.s
+.PHONY : api_kernel.s
+
+# target to generate assembly for a file
+api_kernel.cpp.s:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_kernel.cpp.s
+.PHONY : api_kernel.cpp.s
+
+api_memory.o: api_memory.cpp.o
+.PHONY : api_memory.o
+
+# target to build an object file
+api_memory.cpp.o:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_memory.cpp.o
+.PHONY : api_memory.cpp.o
+
+api_memory.i: api_memory.cpp.i
+.PHONY : api_memory.i
+
+# target to preprocess a source file
+api_memory.cpp.i:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_memory.cpp.i
+.PHONY : api_memory.cpp.i
+
+api_memory.s: api_memory.cpp.s
+.PHONY : api_memory.s
+
+# target to generate assembly for a file
+api_memory.cpp.s:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_memory.cpp.s
+.PHONY : api_memory.cpp.s
+
+api_platform.o: api_platform.cpp.o
+.PHONY : api_platform.o
+
+# target to build an object file
+api_platform.cpp.o:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_platform.cpp.o
+.PHONY : api_platform.cpp.o
+
+api_platform.i: api_platform.cpp.i
+.PHONY : api_platform.i
+
+# target to preprocess a source file
+api_platform.cpp.i:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_platform.cpp.i
+.PHONY : api_platform.cpp.i
+
+api_platform.s: api_platform.cpp.s
+.PHONY : api_platform.s
+
+# target to generate assembly for a file
+api_platform.cpp.s:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_platform.cpp.s
+.PHONY : api_platform.cpp.s
+
+api_profiling.o: api_profiling.cpp.o
+.PHONY : api_profiling.o
+
+# target to build an object file
+api_profiling.cpp.o:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_profiling.cpp.o
+.PHONY : api_profiling.cpp.o
+
+api_profiling.i: api_profiling.cpp.i
+.PHONY : api_profiling.i
+
+# target to preprocess a source file
+api_profiling.cpp.i:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_profiling.cpp.i
+.PHONY : api_profiling.cpp.i
+
+api_profiling.s: api_profiling.cpp.s
+.PHONY : api_profiling.s
+
+# target to generate assembly for a file
+api_profiling.cpp.s:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_profiling.cpp.s
+.PHONY : api_profiling.cpp.s
+
+api_program.o: api_program.cpp.o
+.PHONY : api_program.o
+
+# target to build an object file
+api_program.cpp.o:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_program.cpp.o
+.PHONY : api_program.cpp.o
+
+api_program.i: api_program.cpp.i
+.PHONY : api_program.i
+
+# target to preprocess a source file
+api_program.cpp.i:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_program.cpp.i
+.PHONY : api_program.cpp.i
+
+api_program.s: api_program.cpp.s
+.PHONY : api_program.s
+
+# target to generate assembly for a file
+api_program.cpp.s:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_program.cpp.s
+.PHONY : api_program.cpp.s
+
+api_sampler.o: api_sampler.cpp.o
+.PHONY : api_sampler.o
+
+# target to build an object file
+api_sampler.cpp.o:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_sampler.cpp.o
+.PHONY : api_sampler.cpp.o
+
+api_sampler.i: api_sampler.cpp.i
+.PHONY : api_sampler.i
+
+# target to preprocess a source file
+api_sampler.cpp.i:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_sampler.cpp.i
+.PHONY : api_sampler.cpp.i
+
+api_sampler.s: api_sampler.cpp.s
+.PHONY : api_sampler.s
+
+# target to generate assembly for a file
+api_sampler.cpp.s:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/api_sampler.cpp.s
+.PHONY : api_sampler.cpp.s
+
+device.o: device.cpp.o
+.PHONY : device.o
+
+# target to build an object file
+device.cpp.o:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/device.cpp.o
+.PHONY : device.cpp.o
+
+device.i: device.cpp.i
+.PHONY : device.i
+
+# target to preprocess a source file
+device.cpp.i:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/device.cpp.i
+.PHONY : device.cpp.i
+
+device.s: device.cpp.s
+.PHONY : device.s
+
+# target to generate assembly for a file
+device.cpp.s:
+ cd /home/zack/projects/clover && $(MAKE) -f src/CMakeFiles/OpenCL.dir/build.make src/CMakeFiles/OpenCL.dir/device.cpp.s
+.PHONY : device.cpp.s
+
+# Help Target
+help:
+ @echo "The following are some of the valid targets for this Makefile:"
+ @echo "... all (the default if no target is provided)"
+ @echo "... clean"
+ @echo "... depend"
+ @echo "... OpenCL"
+ @echo "... edit_cache"
+ @echo "... rebuild_cache"
+ @echo "... __/cpuwinsys/cpuwinsys.o"
+ @echo "... __/cpuwinsys/cpuwinsys.i"
+ @echo "... __/cpuwinsys/cpuwinsys.s"
+ @echo "... api_command.o"
+ @echo "... api_command.i"
+ @echo "... api_command.s"
+ @echo "... api_context.o"
+ @echo "... api_context.i"
+ @echo "... api_context.s"
+ @echo "... api_device.o"
+ @echo "... api_device.i"
+ @echo "... api_device.s"
+ @echo "... api_enqueue.o"
+ @echo "... api_enqueue.i"
+ @echo "... api_enqueue.s"
+ @echo "... api_event.o"
+ @echo "... api_event.i"
+ @echo "... api_event.s"
+ @echo "... api_flush.o"
+ @echo "... api_flush.i"
+ @echo "... api_flush.s"
+ @echo "... api_kernel.o"
+ @echo "... api_kernel.i"
+ @echo "... api_kernel.s"
+ @echo "... api_memory.o"
+ @echo "... api_memory.i"
+ @echo "... api_memory.s"
+ @echo "... api_platform.o"
+ @echo "... api_platform.i"
+ @echo "... api_platform.s"
+ @echo "... api_profiling.o"
+ @echo "... api_profiling.i"
+ @echo "... api_profiling.s"
+ @echo "... api_program.o"
+ @echo "... api_program.i"
+ @echo "... api_program.s"
+ @echo "... api_sampler.o"
+ @echo "... api_sampler.i"
+ @echo "... api_sampler.s"
+ @echo "... device.o"
+ @echo "... device.i"
+ @echo "... device.s"
+.PHONY : help
+
+
+
+#=============================================================================
+# Special targets to cleanup operation of make.
+
+# Special rule to run CMake to check the build system integrity.
+# No rule that depends on this can have commands that come from listfiles
+# because they might be regenerated.
+cmake_check_build_system:
+ cd /home/zack/projects/clover && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
+.PHONY : cmake_check_build_system
+