#
#       Makefile for uwpack
#
#       Copyright (C) 2000-2022 GFD Dennou Club. All rights reserved.
#
include ../../../Mkinclude

.SUFFIXES: $(SUFFIXES) .g

LIBNAME		= uwpack
LIBFSRCS1	= uwsgxa.f uwsgya.f uwqgxi.f uwqgyi.f ruwgx.f  ruwgy.f
LIBFSRCS2	= iuwgx.f  iuwgy.f  uwdflt.f uwinit.f
LIBCSRCS	=
LIBSRCS		= $(LIBFSRCS) $(LIBCSRCS)
LIBFOBJS	= uwsgxa.o uwsgya.o uwqgxi.o uwqgyi.o ruwgx.o  ruwgy.o  \
		  iuwgx.o  iuwgy.o  uwdflt.o uwinit.o
LIBCOBJS	=
LIBOBJS		= $(LIBFOBJS) $(LIBCOBJS)

all: source object

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

source: $(LIBFSRCS1)

object: $(LIBOBJS)

library: archive ranlib

archive:
	@$(AR) $(ARFLAGS) $(LDCLLIBFILE) $(LIBOBJS)

ranlib:
	$(RANLIB) $(LDCLLIBFILE)

clean:
	$(RM) *.o *~ $(LIBFSRCS1)
