diff --git a/userspace/Makefile b/userspace/Makefile index 1483aa242..7ce5179da 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 329871f8e..cbb883190 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 \