OSDN Git Service

Merge branch 'master' of git.sourceforge.jp:/gitroot/eos/base
[eos/hostdependX86LINUX64.git] / Makefile
1 EOS_GIT_BACKUPSITE=/net/fs08/fs08/DataBase/EosBackup.git
2 EOS_GIT_REPOSITRY= git.sourceforge.jp:/gitroot/eos/base.git 
3 EOS_GIT_REPOSITRY_NOUSER=git://git.sourceforge.jp/gitroot/eos/base.git
4 EOS_GIT_REPOSITRY_OPTIONAL= git.sourceforge.jp:/gitroot/eos/optional.git 
5 EOS_GIT_REPOSITRY_OPTIONAL_NOUSER=git://git.sourceforge.jp/gitroot/eos/optional.git
6 EOS_GIT_REPOSITRY_TUTORIAL= git.sourceforge.jp:/gitroot/eos/tutorial.git 
7 EOS_GIT_REPOSITRY_TUTORILA_NOUSER=git://git.sourceforge.jp/gitroot/eos/tutorial.git
8 EOS_GIT_REPOSITRY_DATA= git.sourceforge.jp:/gitroot/eos/data.git 
9 EOS_GIT_REPOSITRY_DATA_NOUSER=git://git.sourceforge.jp/gitroot/eos/data.git
10 EOS_GIT_REPOSITRY_OTHERS= git.sourceforge.jp:/gitroot/eos/others.git 
11 EOS_GIT_REPOSITRY_OTHRES_NOUSER=git://git.sourceforge.jp/gitroot/eos/others.git
12
13
14 help::
15         @echo ">> Help"
16         @echo ">>>> Download"
17         @echo "---- To register new/Modified source codes. ----"
18         @echo " $$ make git-add         or git-add[-all|-data|-tutorial|-optional|-others|-others2]" 
19         @echo " $$ make git-commit      or git-commit[-all|-data|-tutorial|-optional|-others|-others2]" 
20         @echo " $$ git tag " 
21         @echo " $$ git tag newtag "
22         @echo " $$ make git-push        or git-push[-all|-data|-tutorial|-optional|-others]" 
23         @echo ""
24         @echo "---- To fetch and merge new/modified source codes. ----" 
25         @echo " $$ make git-fetch       or git-fetch[-all|-data|-tutorial|-optional|-others]" 
26         @echo " $$ make git-merge       or git-merge[-all|-data|-tutorial|-optional|-others]" 
27         @echo " $$ make setting"
28         @echo "---- To init git repository ----"
29         @echo " $$ make git-init        or git-init[-all|-data|-tutorial|-optional|-others]" 
30         @echo "---- To clonse git repository ----"
31         @echo " $$ make git-clone or git-clone[-all|-data|-tutorial|-optional|-others]" 
32         @echo "---- option ----"
33         @echo "     [] : base only"
34         @echo "     [-data]     : data (for test)"
35         @echo "     [-tutorial] : tutorial"
36         @echo "     [-optional] : optional(for documents)"
37         @echo "     [-others] : other source codes for utils"
38         @echo "     [-others2] : other source codes for utils"
39         @echo "     [-all] : all"
40         @echo ""
41         @echo ">>>> Setting"
42         @echo "---- To set Eos ----"
43         @echo " $$ make setting ; # Create links."
44         @echo " $$ make install ; # No clean, just install."
45         @echo " $$ make rebuild ; # Clean and install."
46         @echo " $$ make rebuild-all ; # Update(prototype), clean and install."
47         @echo ""
48         @echo ">>>> Rebuild"
49         @echo "---- To rebuild source codes of Eos ----"
50         @echo " $$ make rebuild"
51         @echo "---- To update prototype source codes and rebuild source codes of Eos ----"
52         @echo " $$ make rebuild-all"
53         @echo "---- To set Eos ----"
54         @echo " $$ make setting"
55         @echo ""
56         @echo ">>>> Setting for Eos utils using other softwares "
57         @echo "---- To set Eos ----"
58         @echo " $$ cd util; make setting"
59         @echo " $$ cd util; make rebuild"
60
61
62
63 rebuild-all: rebuild-src rebuild-Objects rebuild-all-Tools
64 rebuild: rebuild-src rebuild-Objects rebuild-Tools
65 install: install-src install-Objects install-Tools
66
67 rebuild-src:
68         echo "rebuild-src"
69         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
70         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
71
72 rebuild-Objects:
73         cd src/Objects;  make clean; make check; make depend; make ; make install
74
75 rebuild-Tools:
76         cd src/Tools;    make clean; make check; make depend; make ; make install
77
78 rebuild-all-Tools:
79         cd src/Tools;    make clean; make update; make check; make depend; make ; make install
80
81 install-src:
82         echo "rebuild-src"
83         cd src; rm -f Objects/Makefile; cp -f Config/Template/ObjectsHomeTemplate.Dir/Makefile Objects/Makefile
84         cd src; rm -f Tools/Makefile; cp -f Config/Template/ToolsHomeTemplate.Dir/Makefile Tools/Makefile
85
86 install-Objects:
87         cd src/Objects;  make check; make depend; make ; make install
88
89 install-Tools:
90         cd src/Tools;    make check; make depend; make ; make install
91
92 setting:relink
93
94 relink:
95         ln -sf optional/doc .
96         ln -sf optional/objects .
97         ln -sf data/example .
98
99 git-add-all:: git-add git-add-data git-add-optional git-add-tutorial git-add-others
100
101 git-add::
102         git add -v --all .
103
104 git-add-optional::
105         cd optional; git add -v --all . 
106
107 git-add-data::
108         cd data; git add -v --all . 
109
110 git-add-tutorial::
111         cd tutorial; git add -v --all . 
112
113 git-add-others::
114         cd others; git add -v --all . 
115
116 git-add-others2::
117         cd others2; git add --all . 
118
119 git-commit-all:: git-commit git-commit-data git-commit-optional git-commit-tutorial git-commit-others
120
121 git-commit::
122         git commit 
123
124 git-commit-optional::
125         cd optional; git commit  
126
127 git-commit-data::
128         cd data; git commit 
129
130 git-commit-tutorial::
131         cd tutorial; git commit 
132
133 git-commit-others::
134         cd others; git commit 
135
136 git-commit-others2::
137         cd others2; git commit 
138
139 git-backup::
140         git push $(EOS_GIT_BACKUPSITE) master  --tags
141
142 git-tag::
143         @export DIRECTORYNAME=./; \
144         make git-tag-common;
145
146 git-tag-optional::
147         @export DIRECTORYNAME=optional; \
148         make git-tag-common;
149
150 git-tag-data::
151         @export DIRECTORYNAME=data; \
152         make git-tag-common;
153
154 git-tag-tutorial::
155         @export DIRECTORYNAME=tutorial; \
156         make git-tag-common;
157
158 git-tag-others::
159         @export DIRECTORYNAME=others; \
160         make git-tag-common;
161
162 git-tag-common::
163         @if [ ! -z "$$DIRECTORYNAME" ]; then \
164                 cd $$DIRECTORYNAME; \
165                 echo; \
166                 git tag | sort -k 2,2 -n -t p ; \
167                 echo "Version No. (e.g. vXX.YY.ZZpSSSS)"; \
168                 read TTT; \
169                 if [ ! -z "$$TTT" ]; then \
170                         git tag $$TTT; \
171                 else \
172                         echo "Incorrect."; \
173                 fi; \
174         fi;
175
176 git-push-all:: git-push git-push-data git-push-optional git-push-tutorial git-push-others
177
178 git-push::
179 #       git push origin master  --tags
180         @export DIRECTORYNAME=./; \
181         export ORIGINNAME=origin; \
182         make git-push-with-check;
183
184 git-push-optional::
185 #       cd optional; git push optional master --tags
186         @export DIRECTORYNAME=optional; \
187         export ORIGINNAME=optional; \
188         make git-push-with-check;
189
190 git-push-data::
191 #       cd data; git push data master --tags
192         @export DIRECTORYNAME=data; \
193         export ORIGINNAME=data; \
194         make git-push-with-check;
195
196 git-push-tutorial::
197 #       cd tutorial; git push tutorial master --tags
198         @export DIRECTORYNAME=tutorial; \
199         export ORIGINNAME=tutorial; \
200         make git-push-with-check;
201
202 git-push-others::
203 #       cd others; git push others master --tags
204         @export DIRECTORYNAME=others; \
205         export ORIGINNAME=others; \
206         make git-push-with-check;
207
208 git-push-with-check::
209         @if [ ! -z "$$DIRECTORYNAME" -a ! -z "$$ORIGINNAME" ]; then \
210                 cd $$DIRECTORYNAME; \
211                 echo; \
212                 SSS=`git tag | sort -k 2,2 -n -t p | tail -1`; \
213                 if [ ! -z "$$SSS" ]; then \
214                         echo "$$SSS is Current Tags in $$ORIGINNAME."; \
215                         echo "Did Tag update? Y(: push) | N(or Otherwords : not push)"; \
216                         read TTT; \
217                         if [ "$$TTT" = Y ]; then \
218                                 git push $$ORIGINNAME master --tags; \
219                         else \
220                                 echo "not push."; \
221                         fi; \
222                 else \
223                         echo "Tags do not exist in $$ORIGINNAME."; \
224                         echo "Before push please add tag at current repositry."; \
225                 fi; \
226         fi;
227
228 git-fetch-all:: git-fetch git-fetch-data git-fetch-optional git-fetch-tutorial git-fetch-others
229
230 git-fetch::
231         cd .       ; git fetch origin master --tags     ; git log -1
232
233 git-fetch-data::
234         cd data    ; git fetch data master --tags               ; git log -1
235
236 git-fetch-optional::
237         cd optional; git fetch optional master --tags   ; git log -1
238
239 git-fetch-tutorial::
240         cd tutorial; git fetch tutorial master --tags   ; git log -1
241
242 git-fetch-others::
243         cd others  ; git fetch others master --tags             ; git log -1
244
245 git-merge-all:: git-merge git-merge-data git-merge-optional git-merge-tutorial git-merge-others
246
247 git-merge::
248         cd .       ; git log -1; git merge FETCH_HEAD 
249
250 git-merge-data::
251         cd data    ; git log -1; git merge FETCH_HEAD 
252
253 git-merge-optional::
254         cd optional; git log -1; git merge FETCH_HEAD
255
256 git-merge-tutorial::
257         cd tutorial; git log -1; git merge FETCH_HEAD 
258
259 git-merge-others::
260         cd others  ; git log -1; git merge FETCH_HEAD 
261
262 #
263 # Nickname 
264 #
265
266 git-init-all:: git-init git-init-data git-init-optional git-init-tutorial git-init-others
267
268 git-init::
269         if [ ! -d .git ] ; then git init        ; fi
270         SSS=`git remote -v | grep origin`; if [ ! -z "$$SSS" ] ; then git remote rm origin ; fi ; \
271         git remote add origin    $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY)
272
273 git-init-data::
274         if [ ! -d data ] ; then mkdir data; fi
275         cd data; SSS=`git remote -v | grep data`; if [ ! -z "$$SSS" ] ; then git remote rm data ; fi ; \
276         git remote add data      $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_DATA)
277
278 git-init-optional::
279         if [ ! -d optional ] ; then mkdir optional; fi
280         if [ ! -L doc      ] ; then ln -sf optional/doc . ; fi
281         if [ ! -L objects  ] ; then ln -sf optional/objects . ; fi
282         cd optional; SSS=`git remote -v | grep optional`; if [ ! -z "$$SSS" ] ; then git remote rm optional ; fi ; \
283         git remote add optional  $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OPTIONAL)
284
285 git-init-tutorial::
286         if [ ! -d tutorial ] ; then mkdir tutorial ; fi
287         cd tutorial; SSS=`git remote -v | grep tutorial`; if [ ! -z "$$SSS" ] ; then git remote rm tutorial ; fi ; \
288         git remote add tutorial  $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_TUTORIAL)
289
290 git-init-others::
291         if [ ! -d others ] ; then mkdir others; fi
292         cd others ; SSS=`git remote -v | grep others`; if [ ! -z "$$SSS" ] ; then git remote rm others ; fi ; \
293         git remote add others $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OTHERS)
294
295 git-init-others2::
296         if [ ! -d others2 ] ; then mkdir others2; fi
297         cd others2 ; git remote add others2 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OTHERS)
298
299 git-clone-all:: git-clone git-clone-data git-clone-optional git-clone-tutorial git-clone-others
300
301 git-clone:git-init
302         if [ ! -d  .git ] ; \
303         then \
304                 if [ -z $${EOS_GITUSER} ] ; then \
305                         git clone --depth 1 $(EOS_GIT_REPOSITRY_NOUSER) ./ ; \
306                 else \
307                         git clone --depth 1 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY) ./ ; \
308                 fi ; \
309         fi
310
311 git-clone-data: git-init-data
312         cd data;  if [ ! -d .git ] ; \
313         then \
314                 if [ -z $${EOS_GITUSER} ] ; then \
315                         git clone --depth 1 $(EOS_GIT_REPOSITRY_DATA_NOUSER) ./ ; \
316                 else \
317                         git clone --depth 1 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_DATA) ./; \
318                 fi ; \
319         fi
320
321 git-clone-optional: git-init-optional 
322         cd optional; if [ ! -d .git ] ; \
323         then \
324                 if [ -z $${EOS_GITUSER} ] ; then \
325                         git clone --depth 1 $(EOS_GIT_REPOSITRY_OPTIONAL_NOUSER) ./ ; \
326                 else \
327                         git clone --depth 1 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OPTIONAL) ./ ; \
328                 fi ; \
329         fi
330
331 git-clone-tutorial: git-init-tutorial
332         cd tutorial; if [ ! -d .git ] ; \
333         then \
334                 if [ -z $${EOS_GITUSER} ] ; then \
335                         git clone --depth 1 $(EOS_GIT_REPOSITRY_TUTORIAL_NOUSER) ./ ; \
336                 else \
337                         git clone --depth 1 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_TUTORIAL) ./ ; \
338                 fi; \
339         fi
340
341 git-clone-others: git-init-others
342         cd others ; if [ ! -d .git ] ; \
343         then \
344                 if [ -z $${EOS_GITUSER} ] ; then \
345                         git clone --depth 1 $(EOS_GIT_REPOSITRY_OTHERS_NOUSER) ./ ; \
346                 else \
347                         git clone --depth 1 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OTHERS) ./ ; \
348                 fi; \
349         fi
350
351