# SPDX-FileCopyrightText: Copyright (c) 2017 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.

#
# just typing 'make' prints out this help message
#

help:
	@echo "To build and run the examples of a specific chapter, do the following:"
	@echo "    "
	@echo "Part I - CUDA Fortran Programming"
	@echo "    "
	@echo "make ch01                     : Introduction"
	@echo "make ch02                     : Correctness, Accuracy and Debugging"
	@echo "make ch03                     : Performance Measurement and Metrics"
	@echo "make ch04                     : Synchronization"
	@echo "make ch05                     : Optimization"
	@echo "make ch06                     : Porting Tips and Techniques"
	@echo "make ch07                     : Interfacing with CUDA C Code and CUDA Libraries"
	@echo "make ch08                     : Multi-GPU Programming"
	@echo "    "
	@echo "Part II - Case Studies"
	@echo "    "
	@echo "make ch09                     : Monte Carlo Method"
	@echo "make ch10                     : Finite Difference Method"
	@echo "make ch11                     : Applications of Fast Fourier Transform"
	@echo "make ch12                     : Ray Tracing"
	@echo "    "
	@echo "make all                      : all of the above chapters"
	@echo "make clean                    : remove the executables and build artifacts"
	@echo ""
	@echo "Each chapter target builds its examples and then runs them; use"
	@echo "'cd <chapter>; make build' to compile them without running."

CHAPTERS = ch01 ch02 ch03 ch04 ch05 ch06 ch07 ch08 ch09 ch10 ch11 ch12

$(CHAPTERS):
	cd $@; $(MAKE) all

all: $(CHAPTERS)

clean:
	for d in $(CHAPTERS); do cd $$d; $(MAKE) clean; cd ..; done

.PHONY: help all clean $(CHAPTERS)
