mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
nvgpu: arch: Add YAML compilation check
Add makefile targets to the tmake nvgpu-drv build to execute the arch.py script before compiling the driver. This ensures that our source matches our YAML at all times. Also add one YAML fix to make sure the arch check actually passes! JIRA NVGPU-3075 Change-Id: Ic893a26889732ce55ce16b0188da337629921e6b Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2119821 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Philip Elcan <pelcan@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
646b08a032
commit
e4c63e7b36
@@ -13,7 +13,8 @@ nvgpu:
|
||||
safe: yes
|
||||
owner: Alex W
|
||||
sources: [ include/nvgpu/gk20a.h,
|
||||
include/nvgpu/nvgpu_common.h ]
|
||||
include/nvgpu/nvgpu_common.h,
|
||||
include/nvgpu/secure_ops.h ]
|
||||
|
||||
bios:
|
||||
safe: yes
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
ifdef NV_COMPONENT_FLAG_SHARED_LIBRARY_SECTION
|
||||
include $(NV_BUILD_START_COMPONENT)
|
||||
|
||||
# Architecture script. This validates our YAML architecture against the
|
||||
# source code we have.
|
||||
ARCH_PY := $(NV_SOURCE)/core-private/tools/arch/arch.py
|
||||
|
||||
#
|
||||
# Include the nvgpu-next repo, if it's present. It's expected to be
|
||||
# located in the same directory as nvgpu, like so:
|
||||
@@ -32,6 +36,8 @@ NVGPU_NEXT_SOURCE := \
|
||||
$(NV_COMPONENT_DIR)/../../../../nvgpu-next/drivers/gpu/nvgpu
|
||||
|
||||
NVGPU_POSIX := -D__NVGPU_POSIX__
|
||||
NVGPU_ARCH := $(NV_COMPONENT_DIR)/../../../arch
|
||||
NVGPU_ARCH_YAML := $(NVGPU_ARCH)/*.yaml
|
||||
|
||||
NV_COMPONENT_NAME := nvgpu-drv
|
||||
NV_COMPONENT_OWN_INTERFACE_DIR := .
|
||||
@@ -74,6 +80,34 @@ NV_COMPONENT_SOURCES := \
|
||||
$(srcs) \
|
||||
$(addprefix $(NVGPU_NEXT_SOURCE)/,$(srcs_next))
|
||||
|
||||
# $(srcs_next) already has the NV_COMPONENT_DIR prefix so we already have the
|
||||
# absolute path to those files. srcs are all relative, so we have to prefix
|
||||
# those with the absolute path.
|
||||
SRC_DEPS := srcs_next
|
||||
SRC_DEPS += \
|
||||
$(addprefix $(NV_COMPONENT_DIR)/,$(srcs))
|
||||
|
||||
#
|
||||
# A little bit of magic to get tmake to execute the arch.py python script
|
||||
# before we build the driver. Currently it ensures that the source code matches
|
||||
# the arch.
|
||||
#
|
||||
# The way this works is we define a special target $(SRC_DEPS) which contains
|
||||
# each .c file in the driver. Then when each .o target requires the
|
||||
# corresponding .c file, this target is triggered. It in turn depends on the
|
||||
# YAML files. Those files, then depend on a phony target (nvgpu-arch) that
|
||||
# actually executes the check.
|
||||
#
|
||||
$(SRC_DEPS): $(NVGPU_ARCH_YAML)
|
||||
$(NVGPU_ARCH_YAML): nvgpu-arch
|
||||
nvgpu-arch: $(ARCH_PY)
|
||||
$(PYTHON2) $(ARCH_PY) \
|
||||
--arch-file $(NVGPU_ARCH)/nvgpu.yaml \
|
||||
--source $(NV_COMPONENT_DIR) \
|
||||
sources --check
|
||||
|
||||
.PHONY: nvgpu-arch
|
||||
|
||||
NV_COMPONENT_SYSTEMIMAGE_DIR := $(NV_SYSTEMIMAGE_TEST_EXECUTABLE_DIR)/nvgpu_unit
|
||||
systemimage:: $(NV_COMPONENT_SYSTEMIMAGE_DIR)
|
||||
$(NV_COMPONENT_SYSTEMIMAGE_DIR) : $(NV_SYSTEMIMAGE_TEST_EXECUTABLE_DIR)
|
||||
|
||||
Reference in New Issue
Block a user