diff options
author | Philip Elcan <pelcan@nvidia.com> | 2018-09-13 16:21:38 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-24 18:54:13 -0400 |
commit | 9ac1e34312021ecc80d1b8db8fbff2f3e60e1a54 (patch) | |
tree | 7e9a618fb2f748f82c29881caf92a211b91260d0 /userspace | |
parent | c47eab005ad9a26a36d2c7ca1595c790ff1bc40d (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.tmk | 27 | ||||
-rw-r--r-- | userspace/Makefile.tmk | 97 | ||||
-rw-r--r-- | userspace/libnvgpu-unit.export | 5 |
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 | |||
17 | ifdef NV_INTERFACE_FLAG_SHARED_LIBRARY_SECTION | ||
18 | NV_INTERFACE_NAME := nvgpu-unit | ||
19 | NV_INTERFACE_EXPORTS := libnvgpu-unit | ||
20 | NV_INTERFACE_PUBLIC_INCLUDES := include | ||
21 | endif | ||
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 | |||
15 | NVGPU_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 | ||
22 | NVGPU_UNIT_COMMON_INCLUDES := \ | ||
23 | include \ | ||
24 | ../drivers/gpu/nvgpu \ | ||
25 | ../drivers/gpu/nvgpu/include | ||
26 | |||
27 | |||
28 | ifdef NV_COMPONENT_FLAG_NVTEST_EXECUTABLE_SECTION | ||
29 | include $(NV_BUILD_START_COMPONENT) | ||
30 | |||
31 | NV_COMPONENT_NAME := nvgpu_unit | ||
32 | NV_COMPONENT_SOURCES := \ | ||
33 | src/unit_main.c \ | ||
34 | $(NVGPU_UNIT_COMMON_SRCS) | ||
35 | |||
36 | NV_COMPONENT_INCLUDES := \ | ||
37 | $(NVGPU_UNIT_COMMON_INCLUDES) | ||
38 | |||
39 | ifneq ($(NV_BUILD_CONFIGURATION_OS_IS_QNX),1) | ||
40 | NV_COMPONENT_SYSTEM_SHARED_LIBRARIES += pthread | ||
41 | NV_COMPONENT_SYSTEM_SHARED_LIBRARIES += dl | ||
42 | NV_COMPONENT_SYSTEM_SHARED_LIBRARIES += gcov | ||
43 | endif | ||
44 | |||
45 | NV_COMPONENT_CFLAGS += -D__NVGPU_POSIX__ | ||
46 | |||
47 | NV_UNIT_SH=unit.sh | ||
48 | NV_COMPONENT_SYSTEMIMAGE_DIR := $(NV_SYSTEMIMAGE_TEST_EXECUTABLE_DIR)/nvgpu_unit | ||
49 | systemimage:: $(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 | |||
59 | include $(NV_BUILD_NVTEST_EXECUTABLE) | ||
60 | |||
61 | endif | ||
62 | |||
63 | ifdef NV_COMPONENT_FLAG_SHARED_LIBRARY_SECTION | ||
64 | include $(NV_BUILD_START_COMPONENT) | ||
65 | |||
66 | NV_COMPONENT_NAME := nvgpu_unit-lib | ||
67 | NV_COMPONENT_OWN_INTERFACE_DIR := . | ||
68 | |||
69 | NV_COMPONENT_SOURCES := \ | ||
70 | $(NVGPU_UNIT_COMMON_SRCS) | ||
71 | |||
72 | NV_COMPONENT_INCLUDES := \ | ||
73 | $(NVGPU_UNIT_COMMON_INCLUDES) | ||
74 | |||
75 | |||
76 | ifneq ($(NV_BUILD_CONFIGURATION_OS_IS_QNX),1) | ||
77 | NV_COMPONENT_SYSTEM_SHARED_LIBRARIES += pthread | ||
78 | NV_COMPONENT_SYSTEM_SHARED_LIBRARIES += dl | ||
79 | endif | ||
80 | |||
81 | NV_COMPONENT_CFLAGS += -D__NVGPU_POSIX__ | ||
82 | |||
83 | NV_COMPONENT_SYSTEMIMAGE_DIR := $(NV_SYSTEMIMAGE_TEST_EXECUTABLE_DIR)/nvgpu_unit/ | ||
84 | systemimage:: $(NV_COMPONENT_SYSTEMIMAGE_DIR) | ||
85 | $(NV_COMPONENT_SYSTEMIMAGE_DIR) : $(NV_SYSTEMIMAGE_TEST_EXECUTABLE_DIR) | ||
86 | $(MKDIR_P) $@ | ||
87 | NV_COMPONENT_SYSTEMIMAGE_NAME := libnvgpu-unit.so | ||
88 | |||
89 | include $(NV_BUILD_SHARED_LIBRARY) | ||
90 | |||
91 | endif | ||
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 | ||