From 02f9c99e4b4a452ded20978c5ee1e27b775b9224 Mon Sep 17 00:00:00 2001 From: Anup Mahindre Date: Fri, 3 Aug 2018 16:20:04 +0530 Subject: userspace: Enable nvgpu-next build Added targets in corresponding makefiles/sources to enable building nvgpu-next from userspace. JIRA NVGPU-1015 Change-Id: Ia358162e14205035e4552bfb7f32825c7de48fc2 Signed-off-by: Anup Mahindre Reviewed-on: https://git-master.nvidia.com/r/1792003 GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- userspace/Makefile | 14 +++++++++++++- userspace/Makefile.sources | 5 +++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/userspace/Makefile b/userspace/Makefile index 1483aa24..7ce5179d 100644 --- a/userspace/Makefile +++ b/userspace/Makefile @@ -39,14 +39,18 @@ CORE_OUT=$(OUT)/nvgpu_unit_core # Nvgpu driver code. NVGPU_SRC=$(TWD)/../drivers/gpu/nvgpu NVGPU_OUT=$(OUT)/libnvgpu +# Nvgpu_next driver code. +NVGPU_NEXT_SRC=$(TWD)/../../nvgpu-next/drivers/gpu/nvgpu # Unit tests themselves. UNIT_SRC=$(TWD)/units UNIT_OUT=$(OUT)/units -INCLUDES= \ +INCLUDES= \ -I$(NVGPU_SRC) \ -I$(NVGPU_SRC)/include \ + -I$(NVGPU_NEXT_SRC) \ + -I$(NVGPU_NEXT_SRC)/include \ -I$(TWD)/../include \ -I$(TWD)/../include/uapi \ -I$(TWD)/include @@ -107,6 +111,14 @@ $(NVGPU_OUT)/%.o : $(NVGPU_SRC)/%.c $(HEADERS) fi $(CC) --coverage $(CFLAGS) $(configs) -c -o $@ $< +# Default build target for all the nvgpu-next driver object files we want to +# build in userspace. These too get bundled into libnvgpu-drv.so. +$(NVGPU_OUT)/%.o : $(NVGPU_NEXT_SRC)/%.c $(HEADERS) $(HEADERS_NEXT) + @if [ ! -d $(dir $@) ] ; then \ + mkdir -p $(dir $@) ; \ + fi + $(CC) --coverage $(CFLAGS) $(configs) -c -o $@ $< + # Build target for unit test files. These are not part of the libnvgpu-drv.so. # These comprise the unit test framework. $(CORE_OUT)/%.o : $(CORE_SRC)/%.c $(CORE_HEADERS) diff --git a/userspace/Makefile.sources b/userspace/Makefile.sources index 329871f8..cbb88319 100644 --- a/userspace/Makefile.sources +++ b/userspace/Makefile.sources @@ -20,9 +20,10 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. -include ../drivers/gpu/nvgpu/Makefile.sources +include $(NVGPU_SRC)/Makefile.sources +-include $(NVGPU_NEXT_SRC)/Makefile.sources -OBJS := $(srcs:%.c=$(NVGPU_OUT)/%.o) +OBJS := $(srcs:%.c=$(NVGPU_OUT)/%.o) $(srcs_next:%.c=$(NVGPU_OUT)/%.o) HEADERS := \ $(NVGPU_SRC)/include/nvgpu/*.h \ -- cgit v1.2.2