#
#       Makefile for uwpack
#
#       Copyright (C) 2000 GFD Dennou Club. All rights reserved.
#

ROOTDIR     = ..\..\..
OBJDIR      = ..

FSRC        = uwsgxa.f uwsgya.f uwqgxi.f uwqgyi.f ruwgx.f  ruwgy.f  \
              iuwgx.f  iuwgy.f  uwdflt.f uwinit.f

FOBJ = $(FSRC:.f=.obj)

!include $(ROOTDIR)\MkInclude.win

build:
    $(MAKE) /$(MAKEFLAGS) /NOLOGO /S /f makefile.win subdirs \
            SUBDIRS_PRETARGET=build-exec

build-exec: $(FSRC) $(FOBJ)

#g2fctr.f: g2fctr.g
#	@echo "Substituting system constants (g2fctr.g -> g2fctr.f)"
#	@sed -e "s!@MAXNGRID!$(MAXNGRID)!" g2fctr.g > g2fctr.f

uwsgxa.f: uwsgxa.g
	@echo "Substituting maximum number of grid points" uwsgxa.g "->" uwsgxa.f
	@sed -e "s!@MAXNGRID!$(MAXNGRID)!" uwsgxa.g > uwsgxa.f

uwsgya.f: uwsgya.g
	@echo "Substituting maximum number of grid points" uwsgya.g "->" uwsgya.f
	@sed -e "s!@MAXNGRID!$(MAXNGRID)!" uwsgya.g > uwsgya.f

uwqgxi.f: uwqgxi.g
	@echo "Substituting maximum number of grid points" uwqgxi.g "->" uwqgxi.f
	@sed -e "s!@MAXNGRID!$(MAXNGRID)!" uwqgxi.g > uwqgxi.f

uwqgyi.f: uwqgyi.g
	@echo "Substituting maximum number of grid points" uwqgyi.g "->" uwqgyi.f
	@sed -e "s!@MAXNGRID!$(MAXNGRID)!" uwqgyi.g > uwqgyi.f

ruwgx.f:  ruwgx.g
	@echo "Substituting maximum number of grid points" ruwgx.g "->" ruwgx.f
	@sed -e "s!@MAXNGRID!$(MAXNGRID)!" ruwgx.g > ruwgx.f

ruwgy.f:  ruwgy.g
	@echo "Substituting maximum number of grid points" ruwgy.g "->" ruwgy.f
	@sed -e "s!@MAXNGRID!$(MAXNGRID)!" ruwgy.g > ruwgy.f

install:
    $(MAKE) /$(MAKEFLAGS) /NOLOGO /S /f makefile.win subdirs \
            SUBDIRS_PRETARGET=install-exec

install-exec-unique:

clean:
    $(MAKE) /$(MAKEFLAGS) /NOLOGO /S /f makefile.win subdirs \
            SUBDIRS_PRETARGET=clean-exec
clean-exec-unique:
    IF EXIST uwsgxa.f $(RM) uwsgxa.f
    IF EXIST uwsgya.f $(RM) uwsgya.f
    IF EXIST uwqgxi.f $(RM) uwqgxi.f
    IF EXIST uwqgyi.f $(RM) uwqgyi.f
    IF EXIST ruwgx.f  $(RM) ruwgx.f
    IF EXIST ruwgy.f  $(RM) ruwgy.f
