#= Makefile for dcpam top directory # # Authors:: Yasuhiro MORIKAWA # Version:: $Id: Makefile,v 1.7 2007/07/31 08:02:13 morikawa Exp $ # Tag Name:: $Name: dcpam4-20070802 $ # Copyright:: Copyright (C) GFD Dennou Club, 2004-2007. All rights reserved. # License:: See COPYRIGHT[link:COPYRIGHT] # ###################################################################### # #== Settings INCLUDEFILE = Config.mk include $(INCLUDEFILE) # Include file (optional) # インクルードファイル (任意) GuideFiles = INSTALL CREDITS HISTORY # Documentation located in top directory (optional) # トップディレクトリに置くドキュメントファイル (任意) # End Settings ###################################################################### ###################################################################### #== Set GuideRDFiles GuideRDFiles = $(GuideFiles:%=%.rd) GuideJA = $(GuideFiles:%=%.htm) GuideEN = $(GuideFiles:%=%.htm.en) ###################################################################### #== Commands for TeX files # RUBYLIB = script RDFORM2TEX = $(RD2) -r rd/rd2latex-lib.rb --documentclass="jreport" RDFORM2TEXJA= $(RDFORM2TEX) --with-part=JA:rd --out-code=euc TEX2BODY = $(RUBY) $(RUBYLIB)/rd/latex2body.rb TexSrcFiles = CREDITS TexFiles = $(TexSrcFiles:%=doc/%.tex) History = HISTORY HistoryTex = $(History:%=doc/%.tex) DverGen = $(RUBY) -e '$$stdin.each{|line| ; \ if /^\$$Name: (\S+)/ =~ line then ;\ $$tag = $$1 ;\ elsif /^\$$Date: (\S+) (\S+)/ =~ line then ;\ $$day = $$1 ; \ end } ;\ $$tag = $$day.gsub(/\//, "") unless $$tag ;\ y, m, d = $$day.split("/") ;\ if /dcpam\d-(\S+)/i =~ $$tag then ;\ $$tag = $$1 ;\ end ;\ $$stdout.print "\\Dver{\#{$$tag}} " ;\ $$stdout.print "\\Dmodify{\#{y}}{\#{m}}{\#{d}}\n"' ###################################################################### #== Rules # all: cd src; $(MAKE) doc: guide tex cd doc; $(MAKE) # cd src; $(MAKE) $@ install: all cd src; $(MAKE) $@ install-doc: cd doc ; $(MAKE) install clean: clean.lib cd src; $(MAKE) $@ #cd practice; $(MAKE) $@ clean.all: clean.lib cd src; $(MAKE) $@ #cd practice; $(MAKE) $@ -$(RMDIR) bin lib include clean.lib: -$(RM) $(LIBDIR)/$(DCPAMLIB) -$(RM) $(MODDIR)/$(CLEAN_MODS) #clean.bin: # -cd $(BINDIR) ; $(RM) $(TARGETS) clean-doc: clean-guide clean-tex cd doc; $(MAKE) clean distclean: clean.all clean-configure clean-configure: -$(RM) -f config.status chkfort.cfg chkgmake.cfg -$(RM) -f config.cache config.log Config.mk -$(RM) -f autom4te.cache/* -$(RMDIR) autom4te.cache @echo "" @echo " Removing Config.mk," @echo " you should rerun ./configure to build dcpam." @echo "" test-f: all cd test; $(MAKE) $@ test: all cd src; $(MAKE) $@ tags: cd src; $(MAKE) $@ guide: @for file in $(GuideFiles) ; do \ echo $(CP) $${file} $${file}.rd ;\ $(CP) $${file} $${file}.rd ;\ done $(MAKE) -f Makefile.rd2html $(RM) $(GuideRDFiles) cd doc ; $(MAKE) -f Makefile.rd2html clean-guide: @if [ ! X"$(wildcard $(GuideJA) $(GuideEN) $(GuideRDFiles))" = X"" ]; then \ echo $(RM) $(wildcard $(GuideJA) $(GuideEN) $(GuideRDFiles)) ;\ $(RM) $(wildcard $(GuideJA) $(GuideEN) $(GuideRDFiles)) ;\ fi tex: $(TexFiles) -$(RM) $(HistoryTex) @echo -n "Generating" $(HistoryTex) "from" $(History) "... " @echo "%" > $(HistoryTex) @echo "% This file is generated from" $(History) \ "automatically." >> $(HistoryTex) @echo "% So do not edit this file directly." >> $(HistoryTex) @echo "%" >> $(HistoryTex) @$(DverGen) < $(History) >> $(HistoryTex) echo "done." clean-tex: -$(RM) $(TexFiles) $(HistoryTex) cl: @cvs2cl --help > /dev/null 2>&1 || \ echo -e \ "\n" \ " cvs2cl is not found.\n" \ " Please get from http://www.red-bean.com/cvs2cl/\n" @cvs2cl --help > /dev/null 2>&1 && \ echo -e \ "This file is generated automatically by\n" \ "\n" \ " cvs2cl -r -b -t --fsf -w --header \n" \ "\n" \ `cvs2cl --version` "\n" \ "This script is available from " \ "http://www.red-bean.com/cvs2cl/\n\n" \ | cvs2cl -r -b -t --fsf -w --header - rm -f ChangeLog.bak @echo -e "\n" "ChangeLog is Updated." "\n" doc/%.tex: % -$(RM) $@ echo "%" > $@ echo "% This file is generated from" $< "automatically." >> $@ echo "% So do not edit this file directly." >> $@ echo "%" >> $@ $(RDFORM2TEXJA) $< > /dev/null || eval "$(RM) $@ ; exit 1" $(RDFORM2TEXJA) $< | $(TEX2BODY) >> $@ || $(RM) $@ create-configure: @if [ ! -x /usr/bin/autoconf ]; then \ echo -n "autoconf(1) is not valid. "; \ echo "This is \"configure\" Generater."; \ exit 1; \ fi @if [ ! -r configure.in ]; then \ echo -n "configure.in is not exists or not readable. "; \ echo "This file needed for creating \"configure\"."; \ exit 1; \ fi @if [ ! -r aclocal.m4 ]; then \ echo -n "aclocal.m4 is not exists or not readable. "; \ echo "This file needed for creating \"configure\"."; \ exit 1; \ fi /usr/bin/autoconf @echo "\"configure\" Generated."