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

include ../../../Mkinclude

LIBNAME	= cwrap
LIBFSRCS	= cdclf90.f90 cdclf90n.f90
LIBCSRCS	= cmsgdmp.c
LIBSRCS	= $(LIBFSRCS) $(LIBCSRCS)
LIBFOBJS	= cdclf90.o cdclf90n.o
LIBCOBJS	= cmsgdmp.o
LIBOBJS	= $(LIBFOBJS) $(LIBCOBJS)

object: $(LIBFOBJS) $(LIBCOBJS)

cdclf90.f90: cdcl.h c2f90.rb
	ruby c2f90.rb cdcl.h > cdclf90.f90

library: archive ranlib

archive:
	$(AR) $(ARFLAGS) $(LDCLLIBFILE) $(LIBOBJS)
	$(CP) cdcl.h   ../../../include
	cat cdcln.h >> ../../../include/cdcl.h

ranlib:
	$(RANLIB) $(LDCLLIBFILE)

clean:
	$(RM) *.o *~ cdclf90.f90
