Files
cuda/Makefile.build
Ronan Desplanques 3709f14617 Fix Makefile dependencies
Device-side build artifacts need to be generated before compilation
of the host side starts. Before the patch, the Makefile rules failed
to meet that requirement, and things only worked when running make
with a single job, i.e. with -j1.

This patch tweaks the Makefile rules so that make is aware of the
fact that the host side should only be compiled after the device
side.
2023-02-22 14:09:58 +01:00

17 lines
559 B
Makefile

mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
SELF_DIR := $(dir $(mkfile_path))
include $(SELF_DIR)Makefile.env
CUDA_HOST=x86_64-linux
gnatcuda: host
host: device
# gprbuild currently doesn't pass ADA_INCLUDE_PATH to gnatbind. We need to
# set that manually so that cuda.ads can be found
export ADA_INCLUDE_PATH="$(SELF_DIR)api/host/cuda_raw_binding:$(SELF_DIR)/api/host/cuda_api:$(SELF_DIR)api/cuda_internal" ; \
gprbuild -Xcuda_host=$(CUDA_HOST) -P host -largs $(CURDIR)/lib/*.fatbin.o
device:
gprbuild -Xcuda_host=$(CUDA_HOST) -P device