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

ROOTDIR     = ..\..\..
OBJDIR      = ..
CSRC        = g2qgrd.c
FSRC        = g2fbli.f g2fbl2.f g2ibl2.f lg2inq.f g2fctr.f

FOBJ = $(FSRC:.f=.obj)
COBJ = $(CSRC:.c=.obj)

!include $(ROOTDIR)\MkInclude.win

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

g2fctr.f: g2fctr.g
	@echo "Substituting system constants (g2fctr.g -> g2fctr.f)"
	@sed -e "s!@MAXNGRID!$(MAXNGRID)!" g2fctr.g > g2fctr.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 g2fctr.f $(RM) g2fctr.f

