#-------------------------------------------------------------------------
# Makefile for the SHIPS/LGEM/RII intensity guidance programs
#
# History:     06/24/2019  Created by M. DeMaria and S. Stevenson for new nnic model
#              08/21/2021  Updated for WCOSS2 Cray transition
#              01/10/2024  R. Zelinsky    - Added DEBUG target
#-------------------------------------------------------------------------

SRCM	= nnic.f90

OBJM	= nnic_module.o

LIBS    = -L../../lib -lshipsutils

INCS    = -I../../include

FC	= ftn

ifeq ($(FC), ftn)
    FFLAGS = -g -align all -w -O1
    DEBUG = -ftrapuv -check_all -traceback -g
else
    FFLAGS =
    DEBUG = 
endif

CMD	= nnic.x

$(CMD): $(SRCM) $(OBJM)
	$(FC) $(FFLAGS) $(SRCM) $(OBJM) $(LIBS) $(INCS) -o $(CMD)

nnic_module.o: nnic_module.f90
	$(FC) $(FFLAGS) $(LIBS) $(INCS) -c nnic_module.f90

debug    : FFLAGS += $(DEBUG)
debug    : $(CMD)

clean:

	rm -f $(CMD) $(OBJM)

install:
	cp -f $(CMD) ../../exec