# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NvidiaProprietary
#
# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
# property and proprietary rights in and to this material, related
# documentation and any modifications thereto. Any use, reproduction,
# disclosure or distribution of this material and related documentation
# without an express license agreement from NVIDIA CORPORATION or
# its affiliates is strictly prohibited.

TEST = lu_oacc
FC = nvfortran
EXE = exe

FCFLAGS ?= -acc=gpu -gpu=nvlamath -cudalib=nvlamath -O2

all: build run verify

ifneq (,$(findstring lu_,$(TEST)))
UTILS = ../common/lu_utils.F90
else
UTILS = ../common/eigen_utils.F90
endif

build: $(UTILS) $(TEST).F90
	$(FC) $(FCFLAGS) -o $(TEST).$(EXE) $(UTILS) $(TEST).F90

run: $(TEST).$(EXE)
	$(RUN) ./$(TEST).$(EXE)

verify:

clean:
	@echo 'Cleaning up...'
	@rm -rf *.$(EXE) *.dwf *.pdb *.mod prof
