#--------------------------------------------------------------------- # Copyright (C) GFD Dennou Club, 2007. All rights reserved. #--------------------------------------------------------------------- #= Export source codes from cvsroot, and compress them. # # * Yasuhiro MORIKAWA, Masaki ISHIWATARI # * 2007/07/31 (Yasuhiro MORIKAWA) Copy from dcpam3/Makefile.export # ###################################################################### # #== Settings # # [JAPANESE] 各種設定項目 INCLUDEFILE = ../Current_CVS_Tag.mk include $(INCLUDEFILE) # Include file (optional) # [JA] インクルードファイル (任意) CVS_ROOT = /GFD_Dennou_Club/ftp/arch/dcpam/cvsroot # cvsroot (necessary) # [JA] cvsroot のディレクトリ (必須) MAKEDOC = cd $(DIR) ; \ ./configure \ --with-netcdf=/usr/lib/libnetcdf-ffc5.a \ --with-gt4f90io=/usr/lib/gt4f90io-ffc5/lib/libgt4f90io.a \ --with-ispack=/usr/lib/libisp-ffc5.a \ --with-spml=/usr/lib/spml-ssl2-ffc5/lib/libspml-ssl2.a ; \ make -C src/shared depend ; \ make -C src/prepare_data depend ; \ make -C src/dynamics depend ; \ make -C src/physics depend ; \ make -C src/main depend ; \ make doc distclean ; \ echo -n 'Time stamping *.f90 (excluding *.rb2f90) ... ' ; \ sleep 1 ; touch src/*/*.f90 ; echo 'done.' # Commands excuted after exported (optional) # [JA] export 後, tar によるアーカイブ # 前に実行するコマンド群 (任意) PROJECT = $(DCPAM4PROJ) # Project name in cvs (necessary) # [JA] cvs のプロジェクト名 (必須) TAG = -r $(DCPAM4TAG) #TAG = -D "2030-12-31" # Tag (-r) or date (-D) in cvs (necessary) # [JA] タグ (-r) または日付 (-d) (必須) DIR = $(DCPAM4TAG) # Directory name for archive (necessary) # [JA] 展開するディレクトリ名 (必須) CURNAME = $(PROJECT)_current # Latest symbolic link (optional) # [JA] 最新版につけるシンボリック # リンク名. 空の場合, シンボ # リックリンクは作成しない (任意) TGZ = tgz # Suffix of archive (necessary) # [JA] アーカイブの拡張子 (必須) TGZLIST = /GFD_Dennou_Club/ftp/arch/dcmodel/bin/tgzlist-html.rb # "tgzlist-html.rb" command that create # archive list HTML (optional) # [JA] HTML のアーカイブリストを作成する # "tgzlist-html.rb" へのパス. # 空の場合, リストは作成されない. (任意) OVERWRITE = 0 # Overwrite mode (optional) # [JA] 1 にすると, 既に DIR が # 存在しても上書きする (任意) CLEANARCH = 0 # Clean directory and tar archive (optional) # [JA] 1 にすると, 展開したディレク # トリを削除し, tgz アーカイブ # を作成しない. (任意) RUBY = ruby1.8 # Path to Ruby (optional) # [JA] Ruby へのパス (任意) CVS = cvs # cvs command (necessary) # [JA] cvs へのパス (必須) GATE = /usr/local/bin/gate-user-show # Path to "gate-user-show" (optional) # [JA] "gate-user-show" へのパス (任意) # 空の場合, SIGEN ファイルを作成しない # End Settings [JA] 設定項目ここまで ###################################################################### #== SIGEN file # SIGENDIR = $(DIR).SIGEN SIGENTGZ = $(DIR).$(TGZ).SIGEN ###################################################################### #== Get Japanese name from gate-toroku-system # GATEJPNAME=`$(GATE) $(USER) | grep kname | cut -d":" -f 2` ###################################################################### #== Generate archive list by "tgzlist-html.rb" # TGZLIST_CMD = $(RUBY) $(TGZLIST) \ -o index --exclude $(CURNAME).$(TGZ),$(CURNAME) ###################################################################### #== Rules # all: export help: @echo "" @echo " make [export] :" @echo " Export $(PROJECT) source from cvsroot. " @echo " Expand source in" $(PROJECT) "." @echo " Generate documentations from them." @if [ "$(CURNAME)" != "" ] && [ "$(CLEANARCH)" != "1" ]; then \ echo " Compress them into" $(PROJECT)/$(CURNAME).$(TGZ) "." ;\ fi @if [ "$(GATE)" != "" ] && [ "$(CLEANARCH)" != "1" ]; then \ echo " Create SIGEN file" $(SIGENDIR) $(SIGENTGZ) ;\ fi @if [ "$(TGZLIST)" != "" ] && [ "$(RUBY)" != "" ]; then \ echo " Update Archive List. " ;\ fi @echo "" @echo " make tgzlist :" @echo " Only Update Archive List. " @echo "" clean: rm -f *~ clean.all: clean export: varcheck tagcheck expand makedoc mktgz sigen tgzlist varcheck: @if [ "$(PROJECT)" = "" ]; then \ echo -e "\n Specify \"PROJECT\" in Makefile.export \n" ;\ exit 1 ;\ fi @if [ "$(TAG)" = "" ]; then \ echo -e "\n Specify \"TAG\" in Makefile.export \n" ;\ exit 1 ;\ fi @if [ "$(DIR)" = "" ]; then \ echo -e "\n Specify \"DIR\" in Makefile.export \n" ;\ exit 1 ;\ fi @if [ "$(CVS)" = "" ]; then \ echo -e "\n Specify \"CVS\" in Makefile.export \n" ;\ exit 1 ;\ fi @if [ "$(TGZ)" = "" ]; then \ echo -e "\n Specify \"TGZ\" in Makefile.export \n" ;\ exit 1 ;\ fi @if [ "$(CVS_ROOT)" = "" ]; then \ echo -e "\n Specify \"CVS_ROOT\" in Makefile.export \n" ;\ exit 1 ;\ fi tagcheck: @if [ -d "$(DIR)" ] && [ "$(OVERWRITE)" != "1" ]; then \ echo -e \ "\n " $(DIR) "is already exported .\n" \ " Please change \"DIR\" in \"Makefile.export\" to latest tag.\n" \ " or remove \"" $(DIR) "\".\n" \ " And do \"make export\" again.\n" ;\ exit 1 ;\ fi @if [ -d "$(DIR)" ] && [ "$(OVERWRITE)" = "1" ]; then \ echo rm -rf $(DIR) ;\ rm -rf $(DIR) ;\ fi expand: $(CVS) -d $(CVS_ROOT) export $(TAG) \ -d $(DIR) $(PROJECT) \ || \ eval " rm $(DIR)/CVS/* ; \ rmdir $(DIR)/CVS ; \ rmdir $(DIR) ; exit 1 " makedoc: @if [ "$(MAKEDOC)" != "" ]; then \ echo "$(MAKEDOC)" ;\ eval "$(MAKEDOC)" ;\ fi mktgz: @if [ "$(CLEANARCH)" != "1" ] ; then \ echo tar cvfz $(DIR).$(TGZ) $(DIR) ;\ tar cvfz $(DIR).$(TGZ) $(DIR) ;\ elif [ "$(CLEANARCH)" = "1" ] ; then \ echo rm -rf $(DIR) ;\ rm -rf $(DIR) ;\ fi @if [ "$(CURNAME)" != "" ] && [ "$(CLEANARCH)" != "1" ]; then \ echo rm -f $(CURNAME) $(CURNAME).$(TGZ) ;\ rm -f $(CURNAME) $(CURNAME).$(TGZ) ;\ \ echo ln -s $(DIR) $(CURNAME) ;\ ln -s $(DIR) $(CURNAME) ;\ \ echo ln -s $(DIR).$(TGZ) $(CURNAME).$(TGZ) ;\ ln -s $(DIR).$(TGZ) $(CURNAME).$(TGZ) ;\ fi sigen: sigendir sigentgz sigendir: @if [ "$(GATE)" != "" ] && [ "$(CLEANARCH)" != "1" ]; then \ echo -n "Generating $(SIGENDIR) ... " ;\ \ echo "Subject: " $(DIR) "Source code directory" > $(SIGENDIR) ;\ echo "Maintainer: " $(GATEJPNAME) >> $(SIGENDIR) ;\ echo "Description: This file is auto-generated form \"make export -f Makefile.export\"" >> $(SIGENDIR) ;\ echo "Note: " >> $(SIGENDIR) ;\ echo "Update: `date +%Y/%m/%d`" >> $(SIGENDIR) ;\ \ echo "done" ;\ fi sigentgz: @if [ "$(GATE)" != "" ] && [ "$(CLEANARCH)" != "1" ]; then \ echo -n "Generating $(SIGENTGZ) ... " ;\ \ echo "Subject: " $(DIR) "tar.gz Package" > $(SIGENTGZ) ;\ echo "Maintainer: " $(GATEJPNAME) >> $(SIGENTGZ) ;\ echo "Description: This file is auto-generated form \"make export -f Makefile.export\"" >> $(SIGENTGZ) ;\ echo "Note: " >> $(SIGENTGZ) ;\ echo "Update: `date +%Y/%m/%d`" >> $(SIGENTGZ) ;\ \ echo "done" ;\ fi tgzlist: @if [ "$(TGZLIST)" != "" ] && [ "$(RUBY)" != "" ]; then \ echo $(TGZLIST_CMD) ;\ $(TGZLIST_CMD) ;\ fi ###################################################################### #== Mode setting for Emacs #Local Variables: #mode: makefile #End: #