################################################################################
#
# Copyright (c) 2017, NVIDIA Corporation.  All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
#
################################################################################

FC ?= nvfortran
OBJ = o
EXE = out
UNAME := $(shell uname -a)
ifeq ($(findstring CYGWIN_NT, $(UNAME)), CYGWIN_NT)
OBJ = obj
EXE = exe
endif

FCFLAGS ?= -fast -Minfo=mp -mp=gpu

all: build run verify

build: omploop_f3m.f90
	$(FC) $(FCFLAGS) -o omploop_f3m.$(EXE) $<

run: omploop_f3m.$(EXE)
	$(RUN) ./omploop_f3m.$(EXE) 1000 1000 10 1
	$(RUN) ./omploop_f3m.$(EXE) 1000 1000 10 0

verify:

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