#---------------------------------------------------------------------
#     Copyright (C) GFD Dennou Club, 2006. All rights reserved.
#---------------------------------------------------------------------
#= Makefile for fdml library source tree.
#
# Authors::   Masatsugu ODAKA
# Version::   $Id: Makefile,v 1.6 2006/09/14 14:08:04 odakker Exp $
# Tag Name::  $Name: arare4-20060914 $
# Copyright:: Copyright (C) GFD Dennou Club, 2006. All rights reserved.
# License::   See COPYRIGHT[link:COPYRIGHT]
#
#== History
#
# * 2006/09/13 (ODAKA Masatsugu): Update
# * 2006/09/12 (ODAKA Masatsugu): Update
# * 2006-03-19 ̰ϯ
# * 2005-04-26 
# * 2005-04-22 ̰ϯ
# * 2005-01-27 
# * 2003-02-05 ̰ϯ
########################################################################
#== Settings
#
# [JAPANESE] Ƽ

INCLUDEFILE = Mkinclude
include $(INCLUDEFILE)  # Include file
                        # 󥯥롼ɥե

GuideFiles = INSTALL
                      # Documentation located in top directory       (optional)
                      # ȥåץǥ쥯ȥ֤ɥȥե (Ǥ)

# End Settings  [JA] ܤޤ
########################################################################

######################################################################
#== Set GuideRDFiles
GuideRDFiles = $(GuideFiles:=.rd)
GuideJA      = $(GuideFiles:=.htm)
GuideEN      = $(GuideFiles:=.htm.en)

#== Set subdirectories
#DOCSUBDIR = $(SRCDIR) $(DOCDIR) 

######################################################################
#== Rules
#


all: 
	cd $(SRCDIR) ; $(MAKE) all

install:
	install -d $(INSTMODDIR)
	install -d $(INSTLIBDIR)
	install -d $(INSTBINDIR)
	install $(MODDIR)/*.mod $(INSTMODDIR)
	install $(LIBDIR)/lib$(LIBNAME).a $(INSTLIBDIR)
	install $(BINDIR)/* $(INSTBINDIR)

doc: guide
	@for dir in $(DOCDIR) ; do \
	  cd $$dir ; \
	  $(MAKE) doc ; \
	  cd ../ ; \
	done


guide: $(GuideFiles)
	@for file in $^ ; do \
	  echo $(CP) $${file} $${file}.rd ;\
	  $(CP) $${file} $${file}.rd ;\
	done
	$(MAKE) -f Makefile.rd2html
	$(RM) $(GuideRDFiles)


latex2html: 
	@for dir in $(DOCDIR) ; do \
	  cd $$dir ; \
	  $(MAKE) latex2html ; \
	  cd ../ ; \
	done


clean.all: clean.doc clean.latex2html clean


clean.doc: clean.guide
	cd $(DOCDIR) ; $(MAKE) clean ; cd ../

clean.guide:
	-rm -f $(GuideJA) $(GuideEN)


clean.latex2html:
	cd $(DOCDIR) ; $(MAKE) clean.latex2html ; cd ../

clean:
	cd $(SRCDIR); $(MAKE) clean ; cd ../
	-$(RM) -r $(LIBDIR)
	-$(RM) -r $(MODDIR)
	-$(RM) -r $(BINDIR)
