summaryrefslogtreecommitdiffstats
path: root/userspace
diff options
context:
space:
mode:
authorPhilip Elcan <pelcan@nvidia.com>2018-09-13 16:21:38 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-09-24 18:54:13 -0400
commit9ac1e34312021ecc80d1b8db8fbff2f3e60e1a54 (patch)
tree7e9a618fb2f748f82c29881caf92a211b91260d0 /userspace
parentc47eab005ad9a26a36d2c7ca1595c790ff1bc40d (diff)
gpu: nvgpu: unit: build in tmake
This builds the nvgpu userspace in the tmake build system. The shared library and the unit test binary are built for target. The output goes to the systemimage in nvgpu_unit/build. JIRA NVGPU-1042 Change-Id: I70a118bc02789caf838b2b8e9d6778e94239c56f Signed-off-by: Philip Elcan <pelcan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1822287 Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'userspace')
-rw-r--r--userspace/Makefile.interface.tmk27
-rw-r--r--userspace/Makefile.tmk97
-rw-r--r--userspace/libnvgpu-unit.export5
3 files changed, 129 insertions, 0 deletions
diff --git a/userspace/Makefile.interface.tmk b/userspace/Makefile.interface.tmk
new file mode 100644
index 00000000..e947439a
--- /dev/null
+++ b/userspace/Makefile.interface.tmk
@@ -0,0 +1,27 @@
1################################### tell Emacs this is a -*- makefile-gmake -*-
2#
3# Copyright (c) 2018, NVIDIA CORPORATION. All Rights Reserved.
4#
5# NVIDIA CORPORATION and its licensors retain all intellectual property
6# and proprietary rights in and to this software, related documentation
7# and any modifications thereto. Any use, reproduction, disclosure or
8# distribution of this software and related documentation without an express
9# license agreement from NVIDIA CORPORATION is strictly prohibited.
10#
11# tmake for SW Mobile component makefile
12#
13# libnvgpu-drv interface makefile fragment
14#
15###############################################################################
16
17ifdef NV_INTERFACE_FLAG_SHARED_LIBRARY_SECTION
18NV_INTERFACE_NAME := nvgpu-unit
19NV_INTERFACE_EXPORTS := libnvgpu-unit
20NV_INTERFACE_PUBLIC_INCLUDES := include
21endif
22
23# Local Variables:
24# indent-tabs-mode: t
25# tab-width: 8
26# End:
27# vi: set tabstop=8 noexpandtab:
diff --git a/userspace/Makefile.tmk b/userspace/Makefile.tmk
new file mode 100644
index 00000000..ba2ad728
--- /dev/null
+++ b/userspace/Makefile.tmk
@@ -0,0 +1,97 @@
1################################### tell Emacs this is a -*- makefile-gmake -*-
2#
3# Copyright (c) 2018 NVIDIA CORPORATION. All Rights Reserved.
4#
5# NVIDIA CORPORATION and its licensors retain all intellectual property
6# and proprietary rights in and to this software, related documentation
7# and any modifications thereto. Any use, reproduction, disclosure or
8# distribution of this software and related documentation without an express
9# license agreement from NVIDIA CORPORATION is strictly prohibited.
10#
11# tmake for SW Mobile component makefile
12#
13###############################################################################
14
15NVGPU_UNIT_COMMON_SRCS := \
16 src/nvgpu.c \
17 src/args.c \
18 src/io.c \
19 src/module.c \
20 src/results.c \
21 src/exec.c
22NVGPU_UNIT_COMMON_INCLUDES := \
23 include \
24 ../drivers/gpu/nvgpu \
25 ../drivers/gpu/nvgpu/include
26
27
28ifdef NV_COMPONENT_FLAG_NVTEST_EXECUTABLE_SECTION
29include $(NV_BUILD_START_COMPONENT)
30
31NV_COMPONENT_NAME := nvgpu_unit
32NV_COMPONENT_SOURCES := \
33 src/unit_main.c \
34 $(NVGPU_UNIT_COMMON_SRCS)
35
36NV_COMPONENT_INCLUDES := \
37 $(NVGPU_UNIT_COMMON_INCLUDES)
38
39ifneq ($(NV_BUILD_CONFIGURATION_OS_IS_QNX),1)
40NV_COMPONENT_SYSTEM_SHARED_LIBRARIES += pthread
41NV_COMPONENT_SYSTEM_SHARED_LIBRARIES += dl
42NV_COMPONENT_SYSTEM_SHARED_LIBRARIES += gcov
43endif
44
45NV_COMPONENT_CFLAGS += -D__NVGPU_POSIX__
46
47NV_UNIT_SH=unit.sh
48NV_COMPONENT_SYSTEMIMAGE_DIR := $(NV_SYSTEMIMAGE_TEST_EXECUTABLE_DIR)/nvgpu_unit
49systemimage:: $(NV_COMPONENT_SYSTEMIMAGE_DIR) $(NV_COMPONENT_SYSTEMIMAGE_DIR)/$(NV_UNIT_SH)
50
51#make the output directory
52$(NV_COMPONENT_SYSTEMIMAGE_DIR) : $(NV_SYSTEMIMAGE_TEST_EXECUTABLE_DIR)
53 $(MKDIR_P) $@
54
55#copy the test script
56$(NV_COMPONENT_SYSTEMIMAGE_DIR)/$(NV_UNIT_SH) : $(NV_COMPONENT_DIR)/$(NV_UNIT_SH) $(NV_COMPONENT_SYSTEMIMAGE_DIR)
57 $(CP) $< $@
58
59include $(NV_BUILD_NVTEST_EXECUTABLE)
60
61endif
62
63ifdef NV_COMPONENT_FLAG_SHARED_LIBRARY_SECTION
64include $(NV_BUILD_START_COMPONENT)
65
66NV_COMPONENT_NAME := nvgpu_unit-lib
67NV_COMPONENT_OWN_INTERFACE_DIR := .
68
69NV_COMPONENT_SOURCES := \
70 $(NVGPU_UNIT_COMMON_SRCS)
71
72NV_COMPONENT_INCLUDES := \
73 $(NVGPU_UNIT_COMMON_INCLUDES)
74
75
76ifneq ($(NV_BUILD_CONFIGURATION_OS_IS_QNX),1)
77NV_COMPONENT_SYSTEM_SHARED_LIBRARIES += pthread
78NV_COMPONENT_SYSTEM_SHARED_LIBRARIES += dl
79endif
80
81NV_COMPONENT_CFLAGS += -D__NVGPU_POSIX__
82
83NV_COMPONENT_SYSTEMIMAGE_DIR := $(NV_SYSTEMIMAGE_TEST_EXECUTABLE_DIR)/nvgpu_unit/
84systemimage:: $(NV_COMPONENT_SYSTEMIMAGE_DIR)
85$(NV_COMPONENT_SYSTEMIMAGE_DIR) : $(NV_SYSTEMIMAGE_TEST_EXECUTABLE_DIR)
86 $(MKDIR_P) $@
87NV_COMPONENT_SYSTEMIMAGE_NAME := libnvgpu-unit.so
88
89include $(NV_BUILD_SHARED_LIBRARY)
90
91endif
92
93# Local Variables:
94# indent-tabs-mode: t
95# tab-width: 8
96# End:
97# vi: set tabstop=8 noexpandtab:
diff --git a/userspace/libnvgpu-unit.export b/userspace/libnvgpu-unit.export
new file mode 100644
index 00000000..4238b30c
--- /dev/null
+++ b/userspace/libnvgpu-unit.export
@@ -0,0 +1,5 @@
1# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
2
3__core_print_stdout
4__core_print_stderr
5__unit_info_color