#
#       Makefile for gt2dlib
#
#       Copyright (C) 2000-2022 GFD Dennou Club. All rights reserved.
#

include ../../../Mkinclude

LIBNAME		= gt2dlib
LIBFSRCS	= g2fctr.f g2fbli.f g2fbl2.f g2ibl2.f lg2inq.f
LIBCSRCS	= g2qgrd.c
LIBSRCS		= $(LIBFSRCS) $(LIBCSRCS)
LIBFOBJS	= g2fctr.o g2fbli.o g2fbl2.o g2ibl2.o lg2inq.o
LIBCOBJS	= g2qgrd.o
LIBOBJS		= $(LIBFOBJS) $(LIBCOBJS)

object: $(LIBOBJS)

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

library: archive ranlib

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

ranlib:
	$(RANLIB) $(LDCLLIBFILE)

clean:
	$(RM) *.o *~ g2fctr.f
