summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2012-05-19 08:33:54 -0700
committerAaron Plattner <aplattner@nvidia.com>2012-05-19 08:33:54 -0700
commitfe90e74e46e2d677af9120578d69d8a130db47a3 (patch)
treec337648e7bb058899f360d5cdbbf6ddcedc0e4c8
parent3560826abb61124e8f3187a819bf70d0dc7dbcaf (diff)
173.14.34173.14.34
-rw-r--r--DRIVER_VERSION2
-rw-r--r--dist-files.mk104
-rw-r--r--makefile.nvmk186
-rw-r--r--misc.c3
-rw-r--r--public.mk312
5 files changed, 604 insertions, 3 deletions
diff --git a/DRIVER_VERSION b/DRIVER_VERSION
index 0d13da7..ff22cf2 100644
--- a/DRIVER_VERSION
+++ b/DRIVER_VERSION
@@ -1 +1 @@
-173.14.31
+173.14.34
diff --git a/dist-files.mk b/dist-files.mk
new file mode 100644
index 0000000..062affa
--- /dev/null
+++ b/dist-files.mk
@@ -0,0 +1,104 @@
+#
+# nvidia-installer: A tool for installing NVIDIA software packages on
+# Unix and Linux systems.
+#
+# Copyright (C) 2008 NVIDIA Corporation.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of Version 2 of the GNU General Public
+# License as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2
+# of the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the:
+#
+# Free Software Foundation, Inc.
+# 59 Temple Place - Suite 330
+# Boston, MA 02111-1307, USA
+#
+
+##############################################################################
+# define the list of files that should be distributed in the
+# nvidia-installer tarball; this is used by the NVIDIA driver build
+# when packaging the tarball, and by the nvidia-installer makefile when
+# building nvidia-installer.
+#
+# Defines SRC and DIST_FILES
+##############################################################################
+
+SRC := backup.c
+SRC += command-list.c
+SRC += crc.c
+SRC += files.c
+SRC += format.c
+SRC += install-from-cwd.c
+SRC += kernel.c
+SRC += log.c
+SRC += misc.c
+SRC += nvgetopt.c
+SRC += nvidia-installer.c
+SRC += precompiled.c
+SRC += snarf-ftp.c
+SRC += snarf-http.c
+SRC += snarf.c
+SRC += stream-ui.c
+SRC += update.c
+SRC += user-interface.c
+SRC += sanity.c
+# SRC += help-args.c
+# SRC += string-utils.c
+# SRC += alloc-utils.c
+
+DIST_FILES := $(SRC)
+
+DIST_FILES += backup.h
+DIST_FILES += command-list.h
+DIST_FILES += crc.h
+DIST_FILES += files.h
+DIST_FILES += format.h
+DIST_FILES += kernel.h
+DIST_FILES += misc.h
+DIST_FILES += nvgetopt.h
+DIST_FILES += nvidia-installer-ui.h
+DIST_FILES += nvidia-installer.h
+DIST_FILES += option_table.h
+DIST_FILES += precompiled.h
+DIST_FILES += sanity.h
+DIST_FILES += snarf-internal.h
+DIST_FILES += snarf.h
+DIST_FILES += update.h
+DIST_FILES += user-interface.h
+# DIST_FILES += help-args.h
+# DIST_FILES += string-utils.h
+# DIST_FILES += alloc-utils.h
+
+DIST_FILES += COPYING
+DIST_FILES += README
+DIST_FILES += dist-files.mk
+
+DIST_FILES += rtld_test_Linux-x86
+DIST_FILES += rtld_test_Linux-x86_64
+
+DIST_FILES += tls_test_Linux-ia64
+DIST_FILES += tls_test_Linux-x86
+DIST_FILES += tls_test_Linux-x86_64
+
+DIST_FILES += tls_test_dso_Linux-ia64.so
+DIST_FILES += tls_test_dso_Linux-x86.so
+DIST_FILES += tls_test_dso_Linux-x86_64.so
+
+DIST_FILES += tls_test.c
+DIST_FILES += tls_test_dso.c
+DIST_FILES += rtld_test.c
+
+DIST_FILES += nvidia-installer.1.m4
+DIST_FILES += gen-manpage-opts.c
+# DIST_FILES += makeself-help-script.c
+
+DIST_FILES += gen-ui-array.c
+DIST_FILES += ncurses-ui.c
+DIST_FILES += mkprecompiled.c
diff --git a/makefile.nvmk b/makefile.nvmk
new file mode 100644
index 0000000..97e5004
--- /dev/null
+++ b/makefile.nvmk
@@ -0,0 +1,186 @@
+##############################################################################
+# drivers/setup/linux/nvidia-installer/makefile.nvmk
+##############################################################################
+
+##############################################################################
+# Identify this module to nvCommon.nvmk so it can decide the build type
+##############################################################################
+
+NV_MODULE_BUILD_TYPE_ALIASES = utils
+
+include $(NV_SOURCE)/drivers/common/build/nvCommon.nvmk
+
+
+##############################################################################
+# string to prepend in unix builds when executing rules in this gmake instance
+##############################################################################
+
+export NV_MODULE_LOGGING_NAME = "nvidia-installer"
+
+
+##############################################################################
+# export the appropriate variables from nvmake to the gmake that we're
+# going to invoke
+##############################################################################
+
+$(eval $(EXPORT_VARIABLES_TO_PUBLIC_MAKEFILE))
+
+# Warn about variable declarations after statements.
+NV_DECLARATION_AFTER_STATEMENT_WARNINGS = 1
+
+_ncurses_dir = $(NV_TOOLS)/unix/targets/$(NV_TARGET_OS)-$(NV_TARGET_ARCH_UNIX_TOOLS)/ncurses-5.5
+
+NCURSES_INCLUDE_DIR = $(_ncurses_dir)/include
+NCURSES_LIB_DIR = $(_ncurses_dir)/lib
+
+export NCURSES_CFLAGS = -I$(NCURSES_INCLUDE_DIR)
+export NCURSES_LDFLAGS = -L$(NCURSES_LIB_DIR)
+
+_pci_dir = $(NV_TOOLS)/unix/targets/$(NV_TARGET_OS)-$(NV_TARGET_ARCH_UNIX_TOOLS)/pciutils-2.2.1
+
+PCI_INCLUDE_DIR = $(_pci_dir)/include
+PCI_LIB_DIR = $(_pci_dir)/lib
+
+export PCI_CFLAGS = -I$(PCI_INCLUDE_DIR)
+export PCI_LDFLAGS = -L$(PCI_LIB_DIR)
+
+export OUTPUTDIR
+
+export NV_AUTO_DEPEND
+export NV_VERBOSE
+
+# for utils.mk
+NV_MAKE_ARGS = -I $(NV_SOURCE)/drivers/setup/linux/common
+
+
+##############################################################################
+# check that all the directories that we exported above actually
+# exist; trigger a warning if any of them don't exist
+##############################################################################
+
+_extra_dirs += $(NCURSES_INCLUDE_DIR)
+_extra_dirs += $(NCURSES_LIB_DIR)
+_extra_dirs += $(PCI_INCLUDE_DIR)
+_extra_dirs += $(PCI_LIB_DIR)
+
+build :: $(_extra_dirs)
+
+$(sort $(_extra_dirs)) :
+ @$(ECHO) WARNING: nvidia-installer extra directory does not exist: $@
+
+
+##############################################################################
+# generate the legacy GPU header file
+##############################################################################
+
+_nv_common_inc = $(NV_SOURCE)/drivers/common/inc
+_nv_sdk_inc = $(NV_SOURCE)/sdk/nvidia/inc
+
+NV_NAME_H = $(_nv_common_inc)/nv_name.h
+NV_CHIPFLAGS_H = $(_nv_common_inc)/nvChipFlags.h
+NV_CHIPUTILS_H = $(_nv_common_inc)/nvChipUtils.h
+NV_MISC_H = $(_nv_sdk_inc)/nvmisc.h
+
+NV_LEGACY_H = $(OUTPUTDIR)/nvLegacy.h
+
+NV_LEGACY_GENERATOR = $(OUTPUTDIR)/nvLegacyGenerator
+
+NV_LEGACY_GENERATOR_HEADER_DEPS = \
+ $(NV_NAME_H) $(NV_CHIPFLAGS_H) $(NV_CHIPUTILS_H) $(NV_MISC_H)
+
+NV_LEGACY_GENERATOR_INCLUDE_CFLAGS = \
+ $(addprefix -I,$(sort $(dir $(NV_LEGACY_GENERATOR_HEADER_DEPS))))
+
+$(NV_LEGACY_GENERATOR): ../nvLegacy.c $(NV_LEGACY_GENERATOR_HEADER_DEPS)
+ $(call quiet_cmd,HOST_CC) $< -o $@ \
+ $(NV_LEGACY_GENERATOR_INCLUDE_CFLAGS) $(HOST_LDFLAGS) $(HOST_BIN_LDFLAGS)
+
+$(NV_LEGACY_H): $(NV_LEGACY_GENERATOR)
+ ./$(NV_LEGACY_GENERATOR) > $@
+
+OTHER_FILES_TO_REMOVE += $(NV_LEGACY_H) $(NV_LEGACY_GENERATOR)
+
+
+##############################################################################
+# define how to package the nvidia-installer source tarball
+##############################################################################
+
+.PHONY: dist-tarball
+
+# include the list of nvidia-installer source files; defines DIST_FILES
+include dist-files.mk
+
+NVIDIA_INSTALLER_DISTDIR_NO_OUTPUTDIR = nvidia-installer-$(NV_PACKAGE_FILENAME_VERSION_STRING)
+NVIDIA_INSTALLER_DISTDIR = $(OUTPUTDIR)/$(NVIDIA_INSTALLER_DISTDIR_NO_OUTPUTDIR)
+NVIDIA_INSTALLER_TARBALL_NO_OUTPUTDIR = $(NVIDIA_INSTALLER_DISTDIR_NO_OUTPUTDIR).tar.bz2
+NVIDIA_INSTALLER_TARBALL = $(NVIDIA_INSTALLER_DISTDIR).tar.bz2
+
+ifeq ($(NV_VERBOSE),1)
+ _tar_verbose_arg = -v
+else
+ _tar_verbose_arg =
+endif
+
+# define rules to copy files from the source tree to
+# $(NVIDIA_INSTALLER_DISTDIR)
+
+$(eval $(call ADD_FILE_TO_TARBALL_RULE, \
+ public.mk, \
+ $(NVIDIA_INSTALLER_DISTDIR)/Makefile, \
+ $(NVIDIA_INSTALLER_TARBALL)))
+
+$(eval $(call ADD_FILE_TO_TARBALL_RULE, \
+ $(OUTPUTDIR)/version.mk, \
+ $(NVIDIA_INSTALLER_DISTDIR)/version.mk, \
+ $(NVIDIA_INSTALLER_TARBALL)))
+
+$(eval $(call ADD_FILE_TO_TARBALL_RULE, \
+ $(NV_SOURCE)/drivers/setup/linux/common/utils.mk, \
+ $(NVIDIA_INSTALLER_DISTDIR)/utils.mk, \
+ $(NVIDIA_INSTALLER_TARBALL)))
+
+$(eval $(call ADD_FILE_TO_TARBALL_RULE, \
+ $(NV_LEGACY_H), \
+ $(NVIDIA_INSTALLER_DISTDIR)/$(notdir $(NV_LEGACY_H)), \
+ $(NVIDIA_INSTALLER_TARBALL)))
+
+$(foreach src, $(DIST_FILES), \
+ $(eval $(call ADD_FILE_TO_TARBALL_RULE, \
+ $(src), \
+ $(NVIDIA_INSTALLER_DISTDIR)/$(src), \
+ $(NVIDIA_INSTALLER_TARBALL))))
+
+$(NVIDIA_INSTALLER_TARBALL):
+ @$(ECHO) "Generating $(OUTPUTDIR)/$(NVIDIA_INSTALLER_TARBALL)"
+ $(RM) $(OUTPUTDIR)/tar-file-list.txt
+ for i in $(patsubst $(OUTPUTDIR)/%,%,$(TARBALL_FILE_LIST_$@)); do \
+ $(ECHO) $${i} >> $(OUTPUTDIR)/tar-file-list.txt; \
+ done
+ cd $(OUTPUTDIR) && \
+ PATH=/bin $(TAR) -c -j $(_tar_verbose_arg) -f \
+ $(NVIDIA_INSTALLER_TARBALL_NO_OUTPUTDIR) \
+ --files-from=tar-file-list.txt
+ $(RM) $(OUTPUTDIR)/tar-file-list.txt
+
+dist-tarball: $(NVIDIA_INSTALLER_TARBALL)
+
+OTHER_FILES_TO_REMOVE += $(NVIDIA_INSTALLER_DISTDIR)
+OTHER_FILES_TO_REMOVE += $(NVIDIA_INSTALLER_TARBALL)
+
+
+##############################################################################
+# to actually build nvidia-settings, hand off control to the public makefile
+##############################################################################
+
+$(eval $(DEFINE_VERSION_MK_RULE))
+
+build:: $(OUTPUTDIR)/version.mk $(NV_LEGACY_H)
+ $(MAKE) $(NV_MAKE_ARGS) -f public.mk $@
+
+
+##############################################################################
+# define the compiler and include the common rules
+##############################################################################
+
+include $(NV_SOURCE)/drivers/common/build/gcc-4.1.1as2.nvmk
+include $(NV_SOURCE)/drivers/common/build/nvCommonRules.nvmk
diff --git a/misc.c b/misc.c
index 71750d5..0028827 100644
--- a/misc.c
+++ b/misc.c
@@ -1870,8 +1870,7 @@ static int rtld_test_internal(Options *op, Package *p,
if (!name) continue;
s = strstr(name, ".so.1");
- if (!s) goto next;
- *(s + strlen(".so.1")) = '\0';
+ if (!s || s[strlen(".so.1")] != '\0') goto next;
cmd = nvstrcat(op->utils[LDD], " ", tmpfile, " > ", tmpfile1, NULL);
diff --git a/public.mk b/public.mk
new file mode 100644
index 0000000..13eb485
--- /dev/null
+++ b/public.mk
@@ -0,0 +1,312 @@
+#
+# nvidia-installer: A tool for installing NVIDIA software packages on
+# Unix and Linux systems.
+#
+# Copyright (C) 2008 NVIDIA Corporation
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the:
+#
+# Free Software Foundation, Inc.
+# 59 Temple Place - Suite 330
+# Boston, MA 02111-1307, USA
+#
+#
+# Makefile
+#
+
+
+##############################################################################
+# include common variables and functions
+##############################################################################
+
+include utils.mk
+
+
+##############################################################################
+# The calling Makefile may export any of the following variables; we
+# assign default values if they are not exported by the caller
+##############################################################################
+
+
+NCURSES_CFLAGS ?=
+NCURSES_LDFLAGS ?=
+PCI_CFLAGS ?=
+PCI_LDFLAGS ?=
+
+
+##############################################################################
+# assign variables
+##############################################################################
+
+NVIDIA_INSTALLER = $(OUTPUTDIR)/nvidia-installer
+MKPRECOMPILED = $(OUTPUTDIR)/mkprecompiled
+MAKESELF_HELP_SCRIPT = $(OUTPUTDIR)/makeself-help-script
+
+NVIDIA_INSTALLER_PROGRAM_NAME = "nvidia-installer"
+
+NVIDIA_INSTALLER_VERSION := $(NVIDIA_VERSION)
+
+NCURSES_UI_C = ncurses-ui.c
+NCURSES_UI_SO = $(OUTPUTDIR)/nvidia-installer-ncurses-ui.so
+NCURSES_UI_SO_C = $(OUTPUTDIR)/g_$(notdir $(NCURSES_UI_SO:.so=.c))
+
+TLS_TEST_C = $(OUTPUTDIR)/g_tls_test.c
+TLS_TEST_DSO_C = $(OUTPUTDIR)/g_tls_test_dso.c
+TLS_TEST = tls_test_$(TARGET_OS)-$(TARGET_ARCH)
+TLS_TEST_DSO_SO = tls_test_dso_$(TARGET_OS)-$(TARGET_ARCH).so
+
+TLS_TEST_32_C = $(OUTPUTDIR)/g_tls_test_32.c
+TLS_TEST_DSO_32_C = $(OUTPUTDIR)/g_tls_test_dso_32.c
+TLS_TEST_32 = tls_test_$(TARGET_OS)-x86
+TLS_TEST_DSO_SO_32 = tls_test_dso_$(TARGET_OS)-x86.so
+
+RTLD_TEST_C = $(OUTPUTDIR)/g_rtld_test.c
+RTLD_TEST = rtld_test_$(TARGET_OS)-$(TARGET_ARCH)
+
+RTLD_TEST_32_C = $(OUTPUTDIR)/g_rtld_test_32.c
+RTLD_TEST_32 = rtld_test_$(TARGET_OS)-x86
+
+GEN_UI_ARRAY = $(OUTPUTDIR)/gen-ui-array
+CONFIG_H = $(OUTPUTDIR)/config.h
+
+MANPAGE = $(OUTPUTDIR)/nvidia-installer.1.gz
+GEN_MANPAGE_OPTS = $(OUTPUTDIR)/gen-manpage-opts
+OPTIONS_1_INC = $(OUTPUTDIR)/options.1.inc
+
+# Setup some architecture specific build options
+ifeq ($(TARGET_OS)-$(TARGET_ARCH), Linux-x86_64)
+ TLS_MODEL = initial-exec
+ PIC = -fPIC
+ CFLAGS += -DNV_X86_64
+ # Only Linux-x86_64 needs the tls_test_32 files
+ COMPAT_32_SRC = $(TLS_TEST_32_C) $(TLS_TEST_DSO_32_C) \
+ $(RTLD_TEST_32_C)
+else
+ # So far all other platforms use local-exec
+ TLS_MODEL = local-exec
+ PIC =
+ # Non-Linux-x86_64 platforms do not include the tls_test_32 files
+ COMPAT_32_SRC =
+endif
+
+# include the list of source files; defines SRC
+include dist-files.mk
+
+INSTALLER_SRC = $(SRC) $(NCURSES_UI_SO_C) $(TLS_TEST_C) $(TLS_TEST_DSO_C) \
+ $(RTLD_TEST_C) $(COMPAT_32_SRC) $(STAMP_C)
+
+INSTALLER_OBJS = $(call BUILD_OBJECT_LIST,$(INSTALLER_SRC))
+
+CFLAGS += -I. -imacros $(CONFIG_H) -I $(OUTPUTDIR)
+HOST_CFLAGS += -I. -imacros $(CONFIG_H) -I $(OUTPUTDIR)
+LDFLAGS += -L. -ldl
+
+MKPRECOMPILED_SRC = crc.c mkprecompiled.c
+MKPRECOMPILED_OBJS = $(call BUILD_OBJECT_LIST,$(MKPRECOMPILED_SRC))
+
+MAKESELF_HELP_SCRIPT_SRC = makeself-help-script.c \
+ help-args.c \
+ format.c \
+ string-utils.c \
+ alloc-utils.c
+
+BUILD_MAKESELF_OBJECT_LIST = \
+ $(patsubst %.o,%.makeself.o,$(call BUILD_OBJECT_LIST,$(1)))
+
+MAKESELF_HELP_SCRIPT_OBJS = \
+ $(call BUILD_MAKESELF_OBJECT_LIST,$(MAKESELF_HELP_SCRIPT_SRC))
+
+ALL_SRC = $(sort $(INSTALLER_SRC) $(NCURSES_UI_C) $(MKPRECOMPILED_SRC))
+
+# define a quiet rule for GEN-UI-ARRAY
+quiet_GEN_UI_ARRAY = GEN-UI-ARRAY $@
+
+
+##############################################################################
+# build rules
+##############################################################################
+
+.PNONY: all install NVIDIA_INSTALLER_install MKPRECOMPILED_install \
+ MANPAGE_install MAKESELF_HELP_SCRIPT_install clean clobber
+
+# XXX[agp]: $(MAKESELF_HELP_SCRIPT) dependency disabled for now
+all: $(NVIDIA_INSTALLER) $(MKPRECOMPILED) $(MANPAGE)
+
+install: NVIDIA_INSTALLER_install MKPRECOMPILED_install MANPAGE_install \
+ MAKESELF_HELP_SCRIPT_install
+
+NVIDIA_INSTALLER_install: $(NVIDIA_INSTALLER)
+ $(MKDIR) $(bindir)
+ $(INSTALL) $(INSTALL_BIN_ARGS) $< $(bindir)/$(notdir $<)
+
+MKPRECOMPILED_install: $(MKPRECOMPILED)
+ $(MKDIR) $(bindir)
+ $(INSTALL) $(INSTALL_BIN_ARGS) $< $(bindir)/$(notdir $<)
+
+MAKESELF_HELP_SCRIPT_install: $(MAKESELF_HELP_SCRIPT)
+ $(MKDIR) $(bindir)
+ $(INSTALL) $(INSTALL_BIN_ARGS) $< $(bindir)/$(notdir $<)
+
+MANPAGE_install: $(MANPAGE)
+ $(MKDIR) $(mandir)
+ $(INSTALL) $(INSTALL_DOC_ARGS) $< $(mandir)/$(notdir $<)
+
+$(MKPRECOMPILED): $(MKPRECOMPILED_OBJS)
+ $(call quiet_cmd,LINK) -o $@ \
+ $(MKPRECOMPILED_OBJS) $(CFLAGS) $(LDFLAGS) $(BIN_LDFLAGS)
+ $(call quiet_cmd,STRIP_CMD) $@
+
+$(MAKESELF_HELP_SCRIPT): $(MAKESELF_HELP_SCRIPT_OBJS)
+ $(call quiet_cmd,HOST_LINK) -o $@ \
+ $(MAKESELF_HELP_SCRIPT_OBJS) $(HOST_CFLAGS) $(HOST_LDFLAGS) \
+ $(HOST_BIN_LDFLAGS)
+ $(call quiet_cmd,STRIP_CMD) $@
+
+$(NVIDIA_INSTALLER): $(INSTALLER_OBJS)
+ $(call quiet_cmd,LINK) -o $@ $(INSTALLER_OBJS) $(CFLAGS) $(LDFLAGS) \
+ -Bstatic $(PCI_LDFLAGS) -lpci -Bdynamic $(BIN_LDFLAGS)
+ $(call quiet_cmd,STRIP_CMD) $@
+
+$(GEN_UI_ARRAY): gen-ui-array.c $(CONFIG_H)
+ $(call quiet_cmd,HOST_CC) -o $@ $< $(HOST_CFLAGS) $(HOST_LDFLAGS) \
+ $(HOST_BIN_LDFLAGS)
+
+$(NCURSES_UI_SO): $(call BUILD_OBJECT_LIST,ncurses-ui.c)
+ $(call quiet_cmd,LINK) -o $@ -shared $< \
+ $(NCURSES_LDFLAGS) -lncurses \
+ $(CFLAGS) $(LDFLAGS) $(BIN_LDFLAGS)
+
+$(NCURSES_UI_SO_C): $(GEN_UI_ARRAY) $(NCURSES_UI_SO)
+ $(call quiet_cmd,GEN_UI_ARRAY) $(NCURSES_UI_SO) ncurses_ui_array > $@
+
+$(TLS_TEST_C): $(GEN_UI_ARRAY) $(TLS_TEST)
+ $(call quiet_cmd,GEN_UI_ARRAY) $(TLS_TEST) tls_test_array > $@
+
+$(TLS_TEST_DSO_C): $(GEN_UI_ARRAY) $(TLS_TEST_DSO_SO)
+ $(call quiet_cmd,GEN_UI_ARRAY) \
+ $(TLS_TEST_DSO_SO) tls_test_dso_array > $@
+
+$(TLS_TEST_32_C): $(GEN_UI_ARRAY) $(TLS_TEST_32)
+ $(call quiet_cmd,GEN_UI_ARRAY) $(TLS_TEST_32) tls_test_array_32 > $@
+
+$(TLS_TEST_DSO_32_C): $(GEN_UI_ARRAY) $(TLS_TEST_DSO_SO_32)
+ $(call quiet_cmd,GEN_UI_ARRAY) \
+ $(TLS_TEST_DSO_SO_32) tls_test_dso_array_32 > $@
+
+$(RTLD_TEST_C): $(GEN_UI_ARRAY) $(RTLD_TEST)
+ $(call quiet_cmd,GEN_UI_ARRAY) $(RTLD_TEST) rtld_test_array > $@
+
+$(RTLD_TEST_32_C): $(GEN_UI_ARRAY) $(RTLD_TEST_32)
+ $(call quiet_cmd,GEN_UI_ARRAY) $(RTLD_TEST_32) rtld_test_array_32 > $@
+
+# misc.c includes pci.h
+$(call BUILD_OBJECT_LIST,misc.c): CFLAGS += $(PCI_CFLAGS)
+
+# ncurses-ui.c includes ncurses.h
+$(call BUILD_OBJECT_LIST,ncurses-ui.c): CFLAGS += $(NCURSES_CFLAGS) -fPIC
+
+# define the rule to build each object file
+$(foreach src,$(ALL_SRC),$(eval $(call DEFINE_OBJECT_RULE,CC,$(src))))
+
+# define a rule to build each makeself-help-script object file
+$(foreach src,$(MAKESELF_HELP_SCRIPT_SRC),\
+ $(eval $(call DEFINE_OBJECT_RULE_WITH_OBJECT_NAME,HOST_CC,$(src),\
+ $(call BUILD_MAKESELF_OBJECT_LIST,$(src)))))
+
+# define the rule to generate $(STAMP_C)
+$(eval $(call DEFINE_STAMP_C_RULE, $(INSTALLER_OBJS),$(NVIDIA_INSTALLER_PROGRAM_NAME)))
+
+$(CONFIG_H):
+ @ $(RM) -f $@
+ @ $(MKDIR) $(OUTPUTDIR)
+ @ $(ECHO) "#define INSTALLER_OS \"$(TARGET_OS)\"" >> $@
+ @ $(ECHO) "#define INSTALLER_ARCH \"$(TARGET_ARCH)\"" >> $@
+ @ $(ECHO) -n "#define NVIDIA_INSTALLER_VERSION " >> $@
+ @ $(ECHO) "\"$(NVIDIA_INSTALLER_VERSION)\"" >> $@
+ @ $(ECHO) -n "#define PROGRAM_NAME " >> $@
+ @ $(ECHO) "\"$(NVIDIA_INSTALLER_PROGRAM_NAME)\"" >> $@
+
+$(call BUILD_OBJECT_LIST,$(ALL_SRC)): $(CONFIG_H)
+$(call BUILD_MAKESELF_OBJECT_LIST,$(MAKESELF_HELP_SCRIPT_SRC)): $(CONFIG_H)
+
+clean clobber:
+ rm -rf $(OUTPUTDIR)
+
+
+##############################################################################
+# rule to rebuild tls_test and tls_test_dso; a precompiled tls_test
+# and tls_test_dso is distributed with nvidia_installer because they
+# require a recent toolchain to build.
+##############################################################################
+
+rebuild_tls_test: tls_test.c
+ gcc -Wall -O2 -fomit-frame-pointer -o $(TLS_TEST) -ldl $<
+ strip $(TLS_TEST)
+
+rebuild_tls_test_dso: tls_test_dso.c
+ gcc -Wall -O2 $(PIC) -fomit-frame-pointer -c $< \
+ -ftls-model=$(TLS_MODEL)
+ gcc -o $(TLS_TEST_DSO_SO) -shared tls_test_dso.o
+ strip $(TLS_TEST_DSO_SO)
+
+# dummy rule to override implicit rule that builds tls_test from
+# tls_test.c
+
+tls_test: tls_test.c
+ touch $@
+
+# rule to rebuild rtld_test; a precompiled rtld_test is distributed with
+# nvidia-installer to simplify x86-64 builds.
+
+rebuild_rtld_test: rtld_test.c
+ gcc -Wall -O2 -fomit-frame-pointer -o $(RTLD_TEST) -lGL $<
+ strip $(RTLD_TEST)
+
+# dummy rule to override implicit rule that builds dls_test from
+# rtld_test.c
+
+rtld_test: rtld_test.c
+ touch $@
+
+
+##############################################################################
+# Documentation
+##############################################################################
+
+AUTO_TEXT = ".\\\" WARNING: THIS FILE IS AUTO-GENERATED! Edit $< instead."
+
+doc: $(MANPAGE)
+
+$(eval $(call DEFINE_OBJECT_RULE,HOST_CC,gen-manpage-opts.c))
+
+$(call BUILD_OBJECT_LIST,gen-manpage-opts.c): $(CONFIG_H)
+
+$(GEN_MANPAGE_OPTS): $(call BUILD_OBJECT_LIST,gen-manpage-opts.c)
+ $(call quiet_cmd,HOST_LINK) $< -o $@ \
+ $(HOST_CFLAGS) $(HOST_LDFLAGS) $(HOST_BIN_LDFLAGS)
+
+$(OPTIONS_1_INC): $(GEN_MANPAGE_OPTS)
+ @./$< > $@
+
+$(MANPAGE): nvidia-installer.1.m4 $(OPTIONS_1_INC)
+ $(call quiet_cmd,M4) \
+ -D__HEADER__=$(AUTO_TEXT) \
+ -D__VERSION__=$(NVIDIA_INSTALLER_VERSION) \
+ -D__DATE__="`$(DATE) +%F`" \
+ -D__INSTALLER_OS__="$(TARGET_OS)" \
+ -D__INSTALLER_ARCH__="$(TARGET_ARCH)" \
+ -D__DRIVER_VERSION__="$(NVIDIA_VERSION)" \
+ -D__OUTPUTDIR__=$(OUTPUTDIR) \
+ -I $(OUTPUTDIR) \
+ $< | $(GZIP_CMD) -9f > $@