summaryrefslogtreecommitdiff
path: root/src/libXNVCtrl
diff options
context:
space:
mode:
authorLiam Middlebrook <lmiddlebrook@nvidia.com>2019-06-10 12:27:35 -0700
committerLiam Middlebrook <lmiddlebrook@nvidia.com>2019-06-10 12:27:35 -0700
commit9254543e7021d7fb7abe53cb886ba96ee60e1c1b (patch)
tree90bd80d27fe2fbdc4454e17c6a55ec074d4aa8d8 /src/libXNVCtrl
parente240d4eee95796fd68c1f2b05f6d9e301c8c18cf (diff)
430.26
Diffstat (limited to 'src/libXNVCtrl')
-rw-r--r--src/libXNVCtrl/Makefile30
-rw-r--r--src/libXNVCtrl/utils.mk2
-rw-r--r--src/libXNVCtrl/version.mk2
-rw-r--r--src/libXNVCtrl/xnvctrl.mk49
4 files changed, 61 insertions, 22 deletions
diff --git a/src/libXNVCtrl/Makefile b/src/libXNVCtrl/Makefile
index 6942c3e..1e84ecb 100644
--- a/src/libXNVCtrl/Makefile
+++ b/src/libXNVCtrl/Makefile
@@ -24,31 +24,25 @@
# include common variables and functions
##############################################################################
-include utils.mk
+UTILS_MK_DIR ?= .
+
+include $(UTILS_MK_DIR)/utils.mk
+
+XNVCTRL_DIR ?= .
+include $(XNVCTRL_DIR)/xnvctrl.mk
##############################################################################
# assign variables
##############################################################################
-LIBXNVCTRL = libXNVCtrl.a
-
-LIBXNVCTRL_PROGRAM_NAME = "libXNVCtrl"
-
-LIBXNVCTRL_VERSION := $(NVIDIA_VERSION)
-
-X_CFLAGS ?=
-
-CFLAGS += $(X_CFLAGS)
+CFLAGS += $(XNVCTRL_CFLAGS)
CFLAGS += -I .
CFLAGS += -fPIC
CFLAGS += -I $(OUTPUTDIR)
-CFLAGS += -DPROGRAM_NAME=\"$(LIBXNVCTRL_PROGRAM_NAME)\"
-
-SRC += NVCtrl.c
-
-OBJS = $(call BUILD_OBJECT_LIST,$(SRC))
+CFLAGS += -I $(XNVCTRL_DIR)
+LDFLAGS += $(XNVCTRL_LDFLAGS)
##############################################################################
# build rules
@@ -58,12 +52,6 @@ OBJS = $(call BUILD_OBJECT_LIST,$(SRC))
all: $(LIBXNVCTRL)
-$(LIBXNVCTRL) : $(OBJS)
- $(AR) ru $@ $(OBJS)
-
-# define the rule to build each object file
-$(foreach src,$(SRC),$(eval $(call DEFINE_OBJECT_RULE,TARGET,$(src))))
-
clean:
rm -rf $(LIBXNVCTRL) *~ \
$(OUTPUTDIR)/*.o $(OUTPUTDIR)/*.d
diff --git a/src/libXNVCtrl/utils.mk b/src/libXNVCtrl/utils.mk
index 8218e0c..95d4b31 100644
--- a/src/libXNVCtrl/utils.mk
+++ b/src/libXNVCtrl/utils.mk
@@ -34,6 +34,7 @@
CC ?= gcc
LD ?= ld
+AR ?= ar
# only set these warnings and optimizations if CFLAGS is unset
CFLAGS ?= -Wall -O2
# always set these -f CFLAGS
@@ -302,6 +303,7 @@ quiet_STRIP_CMD = $(call define_quiet_cmd,STRIP ,$@)
quiet_HARDLINK = $(call define_quiet_cmd,HARDLINK ,$@)
quiet_LD = $(call define_quiet_cmd,LD ,$@)
quiet_OBJCOPY = $(call define_quiet_cmd,OBJCOPY ,$@)
+quiet_AR = $(call define_quiet_cmd,AR ,$@)
##############################################################################
# Tell gmake to delete the target of a rule if it has changed and its
diff --git a/src/libXNVCtrl/version.mk b/src/libXNVCtrl/version.mk
index 496d309..35e5362 100644
--- a/src/libXNVCtrl/version.mk
+++ b/src/libXNVCtrl/version.mk
@@ -1 +1 @@
-NVIDIA_VERSION = 430.14
+NVIDIA_VERSION = 430.26
diff --git a/src/libXNVCtrl/xnvctrl.mk b/src/libXNVCtrl/xnvctrl.mk
new file mode 100644
index 0000000..e6be2ef
--- /dev/null
+++ b/src/libXNVCtrl/xnvctrl.mk
@@ -0,0 +1,49 @@
+# Copyright (c) 2008-2019 NVIDIA, Corporation
+#
+# 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 (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 NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS 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.
+
+##############################################################################
+# makefile fragment to define how to build LIBXNVCTRL
+##############################################################################
+
+# The calling Makefile may export any of the following variables; we
+# assign default values if they are not exported by the caller
+
+ifndef XNVCTRL_LDFLAGS
+ ifeq ($(TARGET_OS)-$(TARGET_ARCH),Linux-x86_64)
+ XNVCTRL_LDFLAGS = -L/usr/X11R6/lib64
+ else
+ XNVCTRL_LDFLAGS = -L/usr/X11R6/lib
+ endif
+endif
+
+XNVCTRL_CFLAGS ?=
+
+
+LIBXNVCTRL = $(OUTPUTDIR)/libXNVCtrl.a
+
+LIBXNVCTRL_SRC = $(XNVCTRL_DIR)/NVCtrl.c
+
+LIBXNVCTRL_OBJ = $(call BUILD_OBJECT_LIST,$(LIBXNVCTRL_SRC))
+
+$(eval $(call DEFINE_OBJECT_RULE,TARGET,$(LIBXNVCTRL_SRC)))
+
+$(LIBXNVCTRL) : $(LIBXNVCTRL_OBJ)
+ $(call quiet_cmd,AR) ru $@ $(LIBXNVCTRL_OBJ)