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

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

CSRC        = cfnchr.c zgpack.c
FSRC        = swcget.f swcmll.f swcqnp.f swiget.f swiqnp.f swlget.f \
                    swlqnp.f swpack.f swpget.f swpqnp.f swqfnm.f swrget.f \
                    swrqnp.f
F90SRC      = 

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

!include $(ROOTDIR)\MkInclude.win

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

build-exec: $(COBJ) $(F90OBJ) $(FOBJ)

swiqnp.f: swiqnp.g
	@echo "Substituting system constants (swiqnp.g -> swiqnp.f)"
	@sed -e "s!@DCLNWS!$(DCLNWS)!" \
	     -e "s!@IWIDTH!$(IWIDTH)!" \
	     -e "s!@IHEIGHT!$(IHEIGHT)!" \
	     swiqnp.g > swiqnp.f

zgpack.c:
        copy zgpack.$(DRV_EXT) zgpack.c

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:
