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

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

F90SRC      = osgarg.f90 osqarn.f90 osexec.f90
CSRC        =  osabrt.c osgenv.c

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) $(F90SRC) $(F90OBJ)

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 osgarg.f90 $(RM) osgarg.f90
	IF EXIST osqarn.f90 $(RM) osqarn.f90
	IF EXIST osexec.f90 $(RM) osexec.f90
	IF EXIST osgenv.f90 $(RM) osgenv.f90
	IF EXIST osabrt.c      $(RM) osabrt.c
	IF EXIST osgenv.c     $(RM) osgenv.c

osgarg.f90:
	$(CP) osgarg.f2003 osgarg.f90

osqarn.f90:
	$(CP) osqarn.f2003 osqarn.f90

osexec.f90:
	$(CP) osexec.win osexec.f90

osgenv.c: osgenv.c.default
	$(CP) osgenv.c.default osgenv.c
osabrt.c: osabrt.c.default
	$(CP) osabrt.c.default osabrt.c
