OSDN Git Service

SamplingUnitChange -R option were added.
[eos/base.git] / Makefile
index 4d8ba64..e0e4a80 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,26 @@
+SHELL=/bin/bash
+
 EOS_GIT_BACKUPSITE=/net/fs08/fs08/DataBase/EosBackup.git
-EOS_GIT_REPOSITRY= git.sourceforge.jp:/gitroot/eos/base.git 
-EOS_GIT_REPOSITRY_NOUSER=git://git.sourceforge.jp/gitroot/eos/base.git
-EOS_GIT_REPOSITRY_OPTIONAL= git.sourceforge.jp:/gitroot/eos/optional.git 
-EOS_GIT_REPOSITRY_OPTIONAL_NOUSER=git://git.sourceforge.jp/gitroot/eos/optional.git
-EOS_GIT_REPOSITRY_TUTORIAL= git.sourceforge.jp:/gitroot/eos/tutorial.git 
-EOS_GIT_REPOSITRY_TUTORIAL_NOUSER=git://git.sourceforge.jp/gitroot/eos/tutorial.git
-EOS_GIT_REPOSITRY_DATA= git.sourceforge.jp:/gitroot/eos/data.git 
-EOS_GIT_REPOSITRY_DATA_NOUSER=git://git.sourceforge.jp/gitroot/eos/data.git
-EOS_GIT_REPOSITRY_OTHERS= git.sourceforge.jp:/gitroot/eos/others.git 
-EOS_GIT_REPOSITRY_OTHERS_NOUSER=git://git.sourceforge.jp/gitroot/eos/others.git
-
-EOS_GIT_REPOSITRY_HOSTDEPEND=git.sourceforge.jp:/gitroot/eos/hostdepend
+EOS_GIT_REPOSITRY= git.osdn.jp:/gitroot/eos/base.git 
+EOS_GIT_REPOSITRY_NOUSER=git://git.osdn.jp/gitroot/eos/base.git
+EOS_GIT_REPOSITRY_OPTIONAL= git.osdn.jp:/gitroot/eos/optional.git 
+EOS_GIT_REPOSITRY_OPTIONAL_NOUSER=git://git.osdn.jp/gitroot/eos/optional.git
+EOS_GIT_REPOSITRY_TUTORIAL= git.osdn.jp:/gitroot/eos/tutorial.git 
+EOS_GIT_REPOSITRY_TUTORIAL_NOUSER=git://git.osdn.jp/gitroot/eos/tutorial.git
+EOS_GIT_REPOSITRY_DATA= git.osdn.jp:/gitroot/eos/data.git 
+EOS_GIT_REPOSITRY_DATA_NOUSER=git://git.osdn.jp/gitroot/eos/data.git
+EOS_GIT_REPOSITRY_OTHERS= git.osdn.jp:/gitroot/eos/others.git 
+EOS_GIT_REPOSITRY_OTHERS_NOUSER=git://git.osdn.jp/gitroot/eos/others.git
+
+
+EOS_GIT_REPOSITRY_HOSTDEPEND=git.osdn.jp:/gitroot/eos/hostdepend
+EOS_GIT_REPOSITRY_HOSTDEPEND_NOUSER=git://git.osdn.jp/gitroot/eos/hostdepend
+
+EOS_GIT_REPOSITRY_ZEPHYR= git.osdn.jp:/gitroot/eos/zephyr.git 
+EOS_GIT_REPOSITRY_ZEPHYR_NOUSER=git://git.osdn.jp/gitroot/eos/zephyr.git
+
+EOS_GIT_REPOSITRY_PIONE=https://github.com/pione/pione.git
+EOS_GIT_REPOSITRY_PIONE_NOUSER=https://github.com/pione/pione.git
 
 help::
        @echo ">> Help"
@@ -26,11 +36,13 @@ help::
        @echo " $$ make git-merge       or git-merge[-all|-data|-tutorial|-optional|-others]" 
        @echo " $$ make setting"
        @echo "---- To init git repository ----"
-       @echo " $$ make git-init        or git-init[-all|-data|-tutorial|-optional|-others]" 
+       @echo " $$ make git-init        or git-init[-all|-zephyr|-data|-tutorial|-optional|-others]" 
        @echo "---- To clonse git repository ----"
-       @echo " $$ make git-clone or git-clone[-all|-data|-tutorial|-optional|-others]" 
+       @echo " $$ make git-clone or git-clone[-all|-zephyr|-data|-tutorial|-optional|-others]" 
        @echo "---- option ----"
        @echo "     [] : base only"
+       @echo "     [-zephyr]   : zephyr (for GUI/browser)"
+       @echo "     [-pione]    : pione  (for process control with GUI/browser)"
        @echo "     [-data]     : data (for test)"
        @echo "     [-tutorial] : tutorial"
        @echo "     [-optional] : optional(for documents)"
@@ -62,13 +74,20 @@ help::
 
 rebuild-all: rebuild-src rebuild-Objects rebuild-all-Tools
 rebuild: rebuild-src rebuild-Objects rebuild-Tools
-install: install-src install-Objects install-Tools
+install: 
+       make install-src 
+       make install-Objects 
+       make install-Tools
 
 rebuild-src:
        echo "rebuild-src"
        cd src; rm -f Makefile; cp -f Config/Template/Makefile Makefile 
-       cd src; rm -f Objects/Makefile; cp -f Config/Template/ObjectsHomeTemplate.Dir/Makefile Objects/Makefile; rm -f Objects/Config/Target.inc; cp -f Config/Template/ObjectsHomeTemplate.Dir/Config/Target.inc Objects/Config/Target.inc
-       cd src; rm -f Tools/Makefile; cp -f Config/Template/ToolsHomeTemplate.Dir/Makefile Tools/Makefile; rm -f Tools/Config/Target.inc ; cp -f Config/Template/ToolsHomeTemplate.Dir/Config/Target.inc Tools/Config/Target.inc
+       cd src; rm -f Objects/Makefile; cp -f Config/Template/ObjectsHomeTemplate.Dir/Makefile Objects/Makefile; \
+               rm -f Objects/Config/Target.inc; cp -f Config/Template/ObjectsHomeTemplate.Dir/Config/Target.inc Objects/Config/Target.inc ;  \
+               rm -f Objects/Config/Define.inc; sed -e s/worldname/Objects/ Config/Template/ObjectsHomeTemplate.Dir/Config/Define.inc > Objects/Config/Define.inc 
+       cd src; rm -f Tools/Makefile; cp -f Config/Template/ToolsHomeTemplate.Dir/Makefile Tools/Makefile; \
+               rm -f Tools/Config/Target.inc ; cp -f Config/Template/ToolsHomeTemplate.Dir/Config/Target.inc Tools/Config/Target.inc ; \
+               rm -f Tools/Config/Define.inc ; sed  -e s/worldname/Tools/ Config/Template/ToolsHomeTemplate.Dir/Config/Define.inc > Tools/Config/Define.inc 
 
 rebuild-Objects:
        cd src/Objects;  make clean; make check; make depend; make ; make install
@@ -80,22 +99,27 @@ rebuild-all-Tools:
        cd src/Tools;    make clean; make update; make check; make depend; make ; make install
 
 install-src:
-       echo "rebuild-src"
+       @echo "install-src"
        cd src; rm -f Objects/Makefile; cp -f Config/Template/ObjectsHomeTemplate.Dir/Makefile Objects/Makefile
        cd src; rm -f Tools/Makefile; cp -f Config/Template/ToolsHomeTemplate.Dir/Makefile Tools/Makefile
 
 install-Objects:
+       @echo "install-Objects"
        cd src/Objects;  make check; make depend; make ; make install
 
 install-Tools:
+       @echo "install-Tools"
        cd src/Tools;    make check; make depend; make ; make install
 
 setting:relink
+       if [ ! -d hostdepend ] ; then \
+               mkdir hostdepend; \
+       fi
 
 relink:
-       ln -sf optional/doc .
-       ln -sf optional/objects .
-       ln -sf data/example .
+       rm doc; ln -sf optional/doc .
+       rm objects;  ln -sf optional/objects .
+       rm example; ln -sf data/SampleData example
 
 #
 # Add
@@ -109,7 +133,19 @@ git-add:: git-add-hostdepend
 
 git-add-hostdepend::
        @echo "hostdepend directory"
-       @cd hostdepend/$${EOS_HOSTDIR}/ ; git remote add hostdepend$${EOS_HOSTDIR} $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_HOSTDEPEND)$${EOS_HOSTDIR}.git || echo "Already exist"
+       @cd hostdepend/$${EOS_HOSTDIR}/ ; FLAG=N; \
+       for name in `git remote`; do if [ $$name = hostdepend$${EOS_HOSTDIR} ] ; then FLAG=Y; fi; done; \
+       if [ $$FLAG = 'N' ] ; then \
+       git remote add hostdepend$${EOS_HOSTDIR} $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_HOSTDEPEND)$${EOS_HOSTDIR}.git || echo "Already exist"; \
+       fi 
+       @cd hostdepend/$${EOS_HOSTDIR}/ ; FLAG=N; \
+       for name in `git remote`; do if [ $$name = origin ] ; then FLAG=Y; fi; done; \
+       if [ $$FLAG = 'N' ] ; then \
+       git remote add origin $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_HOSTDEPEND)$${EOS_HOSTDIR}.git || echo "Already exist"; \
+       elif [ ! -z $${EOS_GITUSER} ] ; then \
+       git remote remove origin || echo "No exist"; \
+       git remote add origin $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_HOSTDEPEND)$${EOS_HOSTDIR}.git || echo "Already exist"; \
+       fi 
        @cd hostdepend/$${EOS_HOSTDIR}/ ; git add -v --all . || echo "No files to be added\n" 
 
 git-add-optional::
@@ -186,7 +222,7 @@ git-tag-common::
                cd $$DIRECTORYNAME; \
                echo; \
                git tag | sort -k 2,2 -n -t p ; \
-               echo "Version No. (e.g. vXX.YY.ZZpSSSS)"; \
+               echo -n "Version No. (e.g. vXX.YY.ZZpSSSS) : "; \
                read TTT; \
                if [ ! -z "$$TTT" ]; then \
                        git tag $$TTT; \
@@ -209,9 +245,10 @@ git-push::git-push-hostdepend
        make git-push-with-check;
 
 git-push-hostdepend::
-       #git subtree push --prefix=hostdepend/$${EOS_HOSTDIR}/ --squash hostdepend$${EOS_HOSTDIR} master 
+       @#git subtree push --prefix=hostdepend/$${EOS_HOSTDIR}/ --squash hostdepend$${EOS_HOSTDIR} master 
        @echo "hostdepend"
-       @cd hostdepend/$${EOS_HOSTDIR}/;  git push hostdepend$${EOS_HOSTDIR} master 
+       @#cd hostdepend/$${EOS_HOSTDIR}/;  git push hostdepend$${EOS_HOSTDIR} master 
+       @cd hostdepend/$${EOS_HOSTDIR}/;  git push || git push --set-upstream origin master || git push hostdepend$${EOS_HOSTDIR} master 
 
 git-push-optional::
 #      cd optional; git push optional master --tags
@@ -244,9 +281,9 @@ git-push-with-check::
                SSS=`git tag | sort -k 2,2 -n -t p | tail -1`; \
                if [ ! -z "$$SSS" ]; then \
                        echo "$$SSS is Current Tags in $$ORIGINNAME."; \
-                       echo "Did Tag update? Y(: push) | N(or Otherwords : not push)"; \
+                       echo -n "Was the current tag updated? [ Y|y | N|n ]: "; \
                        read TTT; \
-                       if [ "$$TTT" = Y ]; then \
+                       if [ "$$TTT" = Y -o "$$TTT" = y ]; then \
                                git push $$ORIGINNAME master --tags; \
                        else \
                                echo "not push."; \
@@ -257,7 +294,10 @@ git-push-with-check::
                fi; \
        fi;
 
-git-fetch-all:: git-fetch git-fetch-data git-fetch-optional git-fetch-tutorial git-fetch-others
+#
+# fetch
+#
+git-fetch-all:: git-fetch fit-fetch-zephyr git-fetch-data git-fetch-optional git-fetch-tutorial git-fetch-others
 
 git-fetch::git-pull-hostdepend
        @echo "fetch: base directory" 
@@ -266,8 +306,12 @@ git-fetch::git-pull-hostdepend
 git-pull-hostdepend::
        @#git subtree pull --prefix=hostdepend/$${EOS_HOSTDIR}/ --squash hostdepend$${EOS_HOSTDIR} master 
        @echo "pull: hostdepend directory"
+       @#cd hostdepend/$${EOS_HOSTDIR}/; git pull --unshallow hostdepend$${EOS_HOSTDIR} master || echo "No files to be fetched" 
        @cd hostdepend/$${EOS_HOSTDIR}/; git pull hostdepend$${EOS_HOSTDIR} master || echo "No files to be fetched" 
 
+git-fetch-zephyr::
+       cd zephyr; git fetch zephyr master --tags               ; git log -1
+
 git-fetch-data::
        cd data    ; git fetch data master --tags               ; git log -1
 
@@ -280,28 +324,41 @@ git-fetch-tutorial::
 git-fetch-others::
        cd others  ; git fetch others master --tags             ; git log -1
 
-git-merge-all:: git-merge git-merge-data git-merge-optional git-merge-tutorial git-merge-others
+#
+# merge
+#
+git-merge-all:: git-merge git-merge-zephyr git-merge-data git-merge-optional git-merge-tutorial git-merge-others
 
 git-merge::
-       cd .       ; git log -1; git merge FETCH_HEAD 
+       #cd .       ; git log -1; git merge FETCH_HEAD 
+       cd .       ; git log -1; git merge 
+
+git-merge-zephyr::
+       #cd zephyr  ; git log -1; git merge FETCH_HEAD 
+       cd zephyr  ; git log -1; git merge 
 
 git-merge-data::
-       cd data    ; git log -1; git merge FETCH_HEAD 
+       #cd data    ; git log -1; git merge FETCH_HEAD 
+       cd data    ; git log -1; git merge 
 
 git-merge-optional::
-       cd optional; git log -1; git merge FETCH_HEAD
+       #cd optional; git log -1; git merge FETCH_HEAD
+       cd optional; git log -1; git merge 
 
 git-merge-tutorial::
-       cd tutorial; git log -1; git merge FETCH_HEAD 
+       #cd tutorial; git log -1; git merge FETCH_HEAD 
+       cd tutorial; git log -1; git merge 
 
 git-merge-others::
-       cd others  ; git log -1; git merge FETCH_HEAD 
+       #cd others  ; git log -1; git merge FETCH_HEAD 
+       cd others  ; git log -1; git merge 
 
 #
 # Nickname 
 #
 
-git-init-all:: git-init git-init-data git-init-optional git-init-tutorial git-init-others
+# init
+git-init-all:: git-init git-init-zephyr git-init-data git-init-optional git-init-tutorial git-init-others
 
 git-init:: git-add-hostdepend
        if [ ! -d .git ] ; then git init        ; fi
@@ -315,6 +372,20 @@ git-init-data::
        @export ORIGINNAME=data; \
        make git-remote-add-data;
 
+git-init-zephyr::
+       if [ ! -d zephyr ] ; then mkdir zephyr ; fi
+       cd zephyr; \
+       if [ ! -d .git ] ; then git init        ; fi ;
+       @export ORIGINNAME=zephyr; \
+       make git-remote-add-zephyr;
+
+git-init-pione::
+       if [ ! -d pione ] ; then mkdir pione; fi
+       cd pione; \
+       if [ ! -d .git ] ; then git init        ; fi ;
+       @export ORIGINNAME=pione; \
+       make git-remote-add-pione;
+
 git-init-optional::
        if [ ! -d optional ] ; then mkdir optional; fi
        if [ ! -L doc      ] ; then ln -sf optional/doc . ; fi
@@ -342,6 +413,8 @@ git-init-others2::
        if [ ! -d others2 ] ; then mkdir others2; fi
        cd others2 ; git remote add others2 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OTHERS)
 
+# clone
+
 git-clone-all:: git-clone
        @if [ ! -z "$${EOS_HOME}" -a -d "$${EOS_HOME}" ] ; then \
                cd $${EOS_HOME} ; \
@@ -365,6 +438,20 @@ git-clone::
                fi; \
        fi;
 
+git-clone-zephyr::
+       if [ ! -d zephyr] ; then mkdir zephyr; fi
+       @cd zephyr;  if [ ! -d .git ] ; \
+       then \
+               if [ -z $${EOS_GITUSER} ] ; then \
+                       git clone --depth 1 $(EOS_GIT_REPOSITRY_ZEPHYR_NOUSER) ./ ; \
+               else \
+                       git clone --depth 1 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_ZEPHYR) ./; \
+               fi ; \
+               cd ../ ; \
+               export ORIGINNAME=zephyr; \
+               make git-remote-add-zephyr; \
+       fi
+
 git-clone-data::
        if [ ! -d data ] ; then mkdir data; fi
        @cd data;  if [ ! -d .git ] ; \
@@ -422,7 +509,9 @@ git-clone-others::
                export ORIGINNAME=others; \
                make git-remote-add-others; \
        fi
-
+#
+# add
+#
 git-remote-add::
        @if [ ! -z "$$ORIGINNAME" -a ! -z "$${EOS_HOME}" -a -d "$${EOS_HOME}"  ]; then \
                cd $${EOS_HOME}; \
@@ -434,6 +523,17 @@ git-remote-add::
                fi ; \
        fi;
 
+git-remote-add-zephyr::
+       @if [ ! -z "$$ORIGINNAME" ]; then \
+               cd $$ORIGINNAME; \
+               SSS=`git remote -v | awk '{print $$1}' | grep data`; if [ ! -z "$$SSS" ] ; then git remote rm zephyr; fi ; \
+               if [ -z $${EOS_GITUSER} ] ; then \
+                       git remote add zephyr $(EOS_GIT_REPOSITRY_ZEPHYR_NOUSER); \
+               else \
+                       git remote add zephyr $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_ZEPHYR); \
+               fi ; \
+       fi;
+
 git-remote-add-data::
        @if [ ! -z "$$ORIGINNAME" ]; then \
                cd $$ORIGINNAME; \