#= Makefile for deepconv/arare source tree.
#
# Authors::   Masatsugu ODAKA
# Version::   $Id: Makefile,v 1.9 2006/09/28 11:53:47 odakker Exp $
# Tag Name::  $Name: arare4-20060928a $
# Copyright:: Copyright (C) GFD Dennou Club, 2006. All rights reserved.
# License::   See COPYRIGHT[link:COPYRIGHT]
#
#
#== History
#
# * 2006/09/28 (ODAKA Masatsugu): Update
# * 2006/09/20 (ODAKA Masatsugu): Update
# * 2006/09/13 (ODAKA Masatsugu): Update
# * 2006/09/12 (ODAKA Masatsugu): Update
# * 2006/03/19 (SUGIYAMA Ko-ichiro):
# * 2005/04/26 (ODAKA Masatsugu): 
# * 2005/04/22 (SUGIYAMA Ko-ichiro):
# * 2005/01/27 (ODAKA Masatsugu): Update
# * 2003/02/05 (SUGIYAMA Ko-ichiro):
#
########################################################################
#== 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 $(DEST_INC)
	install -d $(DEST_BIN)
	install -d $(DEST_LIB)
	install $(MODDIR)/*.mod $(DEST_INC)
	install $(LIBDIR)/lib$(LIBNAME).a $(DEST_LIB)
	install $(BINDIR)/* $(DEST_BIN)

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)
