OSDN Git Service

merge
[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_TUTORIAL_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_OTHERS_NOUSER=git://git.sourceforge.jp/gitroot/eos/others.git
12
13 EOS_GIT_REPOSITRY_HOSTDEPEND=git.sourceforge.jp:/gitroot/eos/hostdepend
14
15 help::
16         @echo ">> Help"
17         @echo ">>>> Download"
18         @echo "---- To register new/Modified source codes. ----"
19         @echo " $$ make git-add         or git-add[-all|-data|-tutorial|-optional|-others|-others2]" 
20         @echo " $$ make git-commit      or git-commit[-all|-data|-tutorial|-optional|-others|-others2]" 
21         @echo " $$ git tag " 
22         @echo " $$ git tag newtag "
23         @echo " $$ make git-push        or git-push[-all|-data|-tutorial|-optional|-others]" 
24         @echo ""
25         @echo "---- To fetch and merge new/modified source codes. ----" 
26         @echo " $$ make git-fetch       or git-fetch[-all|-data|-tutorial|-optional|-others]" 
27         @echo " $$ make git-merge       or git-merge[-all|-data|-tutorial|-optional|-others]" 
28         @echo " $$ make setting"
29         @echo "---- To init git repository ----"
30         @echo " $$ make git-init        or git-init[-all|-data|-tutorial|-optional|-others]" 
31         @echo "---- To clonse git repository ----"
32         @echo " $$ make git-clone or git-clone[-all|-data|-tutorial|-optional|-others]" 
33         @echo "---- option ----"
34         @echo "     [] : base only"
35         @echo "     [-data]     : data (for test)"
36         @echo "     [-tutorial] : tutorial"
37         @echo "     [-optional] : optional(for documents)"
38         @echo "     [-others] : other source codes for utils"
39         @echo "     [-others2] : other source codes for utils"
40         @echo "     [-all] : all"
41         @echo ""
42         @echo ">>>> Setting"
43         @echo "---- To set Eos ----"
44         @echo " $$ make setting ; # Create links."
45         @echo " $$ make install ; # No clean, just install."
46         @echo " $$ make rebuild ; # Clean and install."
47         @echo " $$ make rebuild-all ; # Update(prototype), clean and install."
48         @echo ""
49         @echo ">>>> Rebuild"
50         @echo "---- To rebuild source codes of Eos ----"
51         @echo " $$ make rebuild"
52         @echo "---- To update prototype source codes and rebuild source codes of Eos ----"
53         @echo " $$ make rebuild-all"
54         @echo "---- To set Eos ----"
55         @echo " $$ make setting"
56         @echo ""
57         @echo ">>>> Setting for Eos utils using other softwares "
58         @echo "---- To set Eos ----"
59         @echo " $$ cd util; make setting"
60         @echo " $$ cd util; make rebuild"
61
62
63
64 rebuild-all: rebuild-src rebuild-Objects rebuild-all-Tools
65 rebuild: rebuild-src rebuild-Objects rebuild-Tools
66 install: install-src install-Objects install-Tools
67
68 rebuild-src:
69         echo "rebuild-src"
70         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
71         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
72
73 rebuild-Objects:
74         cd src/Objects;  make clean; make check; make depend; make ; make install
75
76 rebuild-Tools:
77         cd src/Tools;    make clean; make check; make depend; make ; make install
78
79 rebuild-all-Tools:
80         cd src/Tools;    make clean; make update; make check; make depend; make ; make install
81
82 install-src:
83         echo "rebuild-src"
84         cd src; rm -f Objects/Makefile; cp -f Config/Template/ObjectsHomeTemplate.Dir/Makefile Objects/Makefile
85         cd src; rm -f Tools/Makefile; cp -f Config/Template/ToolsHomeTemplate.Dir/Makefile Tools/Makefile
86
87 install-Objects:
88         cd src/Objects;  make check; make depend; make ; make install
89
90 install-Tools:
91         cd src/Tools;    make check; make depend; make ; make install
92
93 setting:relink
94
95 relink:
96         ln -sf optional/doc .
97         ln -sf optional/objects .
98         ln -sf data/example .
99
100 git-add-all:: git-add git-add-data git-add-optional git-add-tutorial git-add-others
101
102 git-add:: 
103         git add -v --all .
104
105 git-add-hostdepend::
106         git remote add -f hostdepend$${EOS_HOSTDIER} $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_HOSTDEPEND)$${EOS_HOSTDIR}.git 
107         git subtree add --prefix=hostdepend/$${EOS_HOSTDIR} --squash hostdepend$${EOS_HOSTDIER} master 
108
109 git-add-optional::
110         cd optional; git add -v --all . 
111
112 git-add-data::
113         cd data; git add -v --all . 
114
115 git-add-tutorial::
116         cd tutorial; git add -v --all . 
117
118 git-add-others::
119         cd others; git add -v --all . 
120
121 git-add-others2::
122         cd others2; git add --all . 
123
124 git-commit-all:: git-commit git-commit-data git-commit-optional git-commit-tutorial git-commit-others
125
126 git-commit::
127         git commit 
128
129 git-commit-optional::
130         cd optional; git commit  
131
132 git-commit-data::
133         cd data; git commit 
134
135 git-commit-tutorial::
136         cd tutorial; git commit 
137
138 git-commit-others::
139         cd others; git commit 
140
141 git-commit-others2::
142         cd others2; git commit 
143
144 git-backup::
145         git push $(EOS_GIT_BACKUPSITE) master  --tags
146
147 git-tag::
148         @export DIRECTORYNAME=./; \
149         make git-tag-common;
150
151 git-tag-optional::
152         @export DIRECTORYNAME=optional; \
153         make git-tag-common;
154
155 git-tag-data::
156         @export DIRECTORYNAME=data; \
157         make git-tag-common;
158
159 git-tag-tutorial::
160         @export DIRECTORYNAME=tutorial; \
161         make git-tag-common;
162
163 git-tag-others::
164         @export DIRECTORYNAME=others; \
165         make git-tag-common;
166
167 git-tag-common::
168         @if [ ! -z "$$DIRECTORYNAME" ]; then \
169                 cd $$DIRECTORYNAME; \
170                 echo; \
171                 git tag | sort -k 2,2 -n -t p ; \
172                 echo "Version No. (e.g. vXX.YY.ZZpSSSS)"; \
173                 read TTT; \
174                 if [ ! -z "$$TTT" ]; then \
175                         git tag $$TTT; \
176                 else \
177                         echo "Incorrect."; \
178                 fi; \
179         fi;
180
181 git-push-all:: git-push git-push-data git-push-optional git-push-tutorial git-push-others
182
183 git-push::git-push-hostdepend
184 #       git push origin master  --tags
185         @export DIRECTORYNAME=./; \
186         export ORIGINNAME=origin; \
187         make git-push-with-check;
188
189 git-push-hostdepend::
190         git subtree push --prefix=hostdepend/$${EOS_HOSTDIR} --squash hostdepend$${EOS_HOSTDIR} master 
191
192 git-push-optional::
193 #       cd optional; git push optional master --tags
194         @export DIRECTORYNAME=optional; \
195         export ORIGINNAME=optional; \
196         make git-push-with-check;
197
198 git-push-data::
199 #       cd data; git push data master --tags
200         @export DIRECTORYNAME=data; \
201         export ORIGINNAME=data; \
202         make git-push-with-check;
203
204 git-push-tutorial::
205 #       cd tutorial; git push tutorial master --tags
206         @export DIRECTORYNAME=tutorial; \
207         export ORIGINNAME=tutorial; \
208         make git-push-with-check;
209
210 git-push-others::
211 #       cd others; git push others master --tags
212         @export DIRECTORYNAME=others; \
213         export ORIGINNAME=others; \
214         make git-push-with-check;
215
216 git-push-with-check::
217         @if [ ! -z "$$DIRECTORYNAME" -a ! -z "$$ORIGINNAME" ]; then \
218                 cd $$DIRECTORYNAME; \
219                 echo; \
220                 SSS=`git tag | sort -k 2,2 -n -t p | tail -1`; \
221                 if [ ! -z "$$SSS" ]; then \
222                         echo "$$SSS is Current Tags in $$ORIGINNAME."; \
223                         echo "Did Tag update? Y(: push) | N(or Otherwords : not push)"; \
224                         read TTT; \
225                         if [ "$$TTT" = Y ]; then \
226                                 git push $$ORIGINNAME master --tags; \
227                         else \
228                                 echo "not push."; \
229                         fi; \
230                 else \
231                         echo "Tags do not exist in $$ORIGINNAME."; \
232                         echo "Before push please add tag at current repositry."; \
233                 fi; \
234         fi;
235
236 git-fetch-all:: git-fetch git-fetch-data git-fetch-optional git-fetch-tutorial git-fetch-others
237
238 git-fetch::git-pull-hostdepend
239         cd .       ; git fetch origin master --tags     ; git log -1
240
241 git-pull-hostdepend::
242         git subtree pull --prefix=hostdepend/$${EOS_HOSTDIR} hostdpend$${EOS_HOSTDIR}.git master 
243
244 git-fetch-data::
245         cd data    ; git fetch data master --tags               ; git log -1
246
247 git-fetch-optional::
248         cd optional; git fetch optional master --tags   ; git log -1
249
250 git-fetch-tutorial::
251         cd tutorial; git fetch tutorial master --tags   ; git log -1
252
253 git-fetch-others::
254         cd others  ; git fetch others master --tags             ; git log -1
255
256 git-merge-all:: git-merge git-merge-data git-merge-optional git-merge-tutorial git-merge-others
257
258 git-merge::
259         cd .       ; git log -1; git merge FETCH_HEAD 
260
261 git-merge-data::
262         cd data    ; git log -1; git merge FETCH_HEAD 
263
264 git-merge-optional::
265         cd optional; git log -1; git merge FETCH_HEAD
266
267 git-merge-tutorial::
268         cd tutorial; git log -1; git merge FETCH_HEAD 
269
270 git-merge-others::
271         cd others  ; git log -1; git merge FETCH_HEAD 
272
273 #
274 # Nickname 
275 #
276
277 git-init-all:: git-init git-init-data git-init-optional git-init-tutorial git-init-others
278
279 git-init:: git-add-hostdepend
280         if [ ! -d .git ] ; then git init        ; fi
281         @export ORIGINNAME=origin; \
282         make git-remote-add;
283
284 git-init-data::
285         if [ ! -d data ] ; then mkdir data; fi
286         cd data; \
287         if [ ! -d .git ] ; then git init        ; fi ;
288         @export ORIGINNAME=data; \
289         make git-remote-add-data;
290
291 git-init-optional::
292         if [ ! -d optional ] ; then mkdir optional; fi
293         if [ ! -L doc      ] ; then ln -sf optional/doc . ; fi
294         if [ ! -L objects  ] ; then ln -sf optional/objects . ; fi
295         cd optional; \
296         if [ ! -d .git ] ; then git init        ; fi ;
297         @export ORIGINNAME=optional; \
298         make git-remote-add-optional;
299
300 git-init-tutorial::
301         if [ ! -d tutorial ] ; then mkdir tutorial ; fi
302         cd tutorial; \
303         if [ ! -d .git ] ; then git init        ; fi ;
304         @export ORIGINNAME=tutorial; \
305         make git-remote-add-tutorial;
306
307 git-init-others::
308         if [ ! -d others ] ; then mkdir others; fi
309         cd others ; \
310         if [ ! -d .git ] ; then git init        ; fi ;
311         @export ORIGINNAME=others; \
312         make git-remote-add-others;
313
314 git-init-others2::
315         if [ ! -d others2 ] ; then mkdir others2; fi
316         cd others2 ; git remote add others2 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OTHERS)
317
318 git-clone-all:: git-clone
319         @if [ ! -z "$${EOS_HOME}" -a -d "$${EOS_HOME}" ] ; then \
320                 cd $${EOS_HOME} ; \
321                 make git-clone-data git-clone-optional git-clone-tutorial git-clone-others; \
322         fi;
323
324 git-clone::
325         @if [ ! -z "$${EOS_HOME}" -a -d "$${EOS_HOME}" ] ; then \
326                 TMPDIRECTORY=$$(pwd) ; \
327                 cd $${EOS_HOME} ; \
328                 if [ ! -d  .git ] ; \
329                 then \
330                         if [ -z $${EOS_GITUSER} ] ; then \
331                                 git clone --depth 1 $(EOS_GIT_REPOSITRY_NOUSER) ./ ; \
332                         else \
333                                 git clone --depth 1 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY) ./ ; \
334                         fi ; \
335                         cd $${TMPDIRECTORY}; \
336                         export ORIGINNAME=origin; \
337                         make git-remote-add; \
338                 fi; \
339         fi;
340
341 git-clone-data::
342         if [ ! -d data ] ; then mkdir data; fi
343         @cd data;  if [ ! -d .git ] ; \
344         then \
345                 if [ -z $${EOS_GITUSER} ] ; then \
346                         git clone --depth 1 $(EOS_GIT_REPOSITRY_DATA_NOUSER) ./ ; \
347                 else \
348                         git clone --depth 1 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_DATA) ./; \
349                 fi ; \
350                 cd ../ ; \
351                 export ORIGINNAME=data; \
352                 make git-remote-add-data; \
353         fi
354
355 git-clone-optional::
356         if [ ! -d optional ] ; then mkdir optional; fi
357         if [ ! -L doc      ] ; then ln -sf optional/doc . ; fi
358         if [ ! -L objects  ] ; then ln -sf optional/objects . ; fi
359         @cd optional; if [ ! -d .git ] ; \
360         then \
361                 if [ -z $${EOS_GITUSER} ] ; then \
362                         git clone --depth 1 $(EOS_GIT_REPOSITRY_OPTIONAL_NOUSER) ./ ; \
363                 else \
364                         git clone --depth 1 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OPTIONAL) ./ ; \
365                 fi ; \
366                 cd ../ ; \
367                 export ORIGINNAME=optional; \
368                 make git-remote-add-optional; \
369         fi
370
371 git-clone-tutorial::
372         if [ ! -d tutorial ] ; then mkdir tutorial ; fi
373         @cd tutorial; if [ ! -d .git ] ; \
374         then \
375                 if [ -z $${EOS_GITUSER} ] ; then \
376                         git clone --depth 1 $(EOS_GIT_REPOSITRY_TUTORIAL_NOUSER) ./ ; \
377                 else \
378                         git clone --depth 1 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_TUTORIAL) ./ ; \
379                 fi; \
380                 cd ../ ; \
381                 export ORIGINNAME=tutorial; \
382                 make git-remote-add-tutorial; \
383         fi
384
385 git-clone-others::
386         if [ ! -d others ] ; then mkdir others; fi
387         @cd others ; if [ ! -d .git ] ; \
388         then \
389                 if [ -z $${EOS_GITUSER} ] ; then \
390                         git clone --depth 1 $(EOS_GIT_REPOSITRY_OTHERS_NOUSER) ./ ; \
391                 else \
392                         git clone --depth 1 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OTHERS) ./ ; \
393                 fi; \
394                 cd ../ ; \
395                 export ORIGINNAME=others; \
396                 make git-remote-add-others; \
397         fi
398
399 git-remote-add::
400         @if [ ! -z "$$ORIGINNAME" -a ! -z "$${EOS_HOME}" -a -d "$${EOS_HOME}"  ]; then \
401                 cd $${EOS_HOME}; \
402                 SSS=`git remote -v | awk '{print $$1}' | grep origin`; if [ ! -z "$$SSS" ] ; then git remote rm origin ; fi ; \
403                 if [ -z $${EOS_GITUSER} ] ; then \
404                         git remote add origin    $(EOS_GIT_REPOSITRY_NOUSER); \
405                 else \
406                         git remote add origin    $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY); \
407                 fi ; \
408         fi;
409
410 git-remote-add-data::
411         @if [ ! -z "$$ORIGINNAME" ]; then \
412                 cd $$ORIGINNAME; \
413                 SSS=`git remote -v | awk '{print $$1}' | grep data`; if [ ! -z "$$SSS" ] ; then git remote rm data ; fi ; \
414                 if [ -z $${EOS_GITUSER} ] ; then \
415                         git remote add data    $(EOS_GIT_REPOSITRY_DATA_NOUSER); \
416                 else \
417                         git remote add data    $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_DATA); \
418                 fi ; \
419         fi;
420
421 git-remote-add-optional::
422         @if [ ! -z "$$ORIGINNAME" ]; then \
423                 cd $$ORIGINNAME; \
424                 SSS=`git remote -v | awk '{print $$1}' | grep optional`; if [ ! -z "$$SSS" ] ; then git remote rm optional ; fi ; \
425                 if [ -z $${EOS_GITUSER} ] ; then \
426                         git remote add optional    $(EOS_GIT_REPOSITRY_OPTIONAL_NOUSER); \
427                 else \
428                         git remote add optional    $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OPTIONAL); \
429                 fi ; \
430         fi;
431
432 git-remote-add-tutorial::
433         @if [ ! -z "$$ORIGINNAME" ]; then \
434                 cd $$ORIGINNAME; \
435                 SSS=`git remote -v | awk '{print $$1}' | grep tutorial`; if [ ! -z "$$SSS" ] ; then git remote rm tutorial ; fi ; \
436                 if [ -z $${EOS_GITUSER} ] ; then \
437                         git remote add tutorial    $(EOS_GIT_REPOSITRY_TUTORIAL_NOUSER); \
438                 else \
439                         git remote add tutorial    $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_TUTORIAL); \
440                 fi ; \
441         fi;
442
443 git-remote-add-others::
444         @if [ ! -z "$$ORIGINNAME" ]; then \
445                 cd $$ORIGINNAME; \
446                 SSS=`git remote -v | awk '{print $$1}' | grep others`; if [ ! -z "$$SSS" ] ; then git remote rm others ; fi ; \
447                 if [ -z $${EOS_GITUSER} ] ; then \
448                         git remote add others    $(EOS_GIT_REPOSITRY_OTHERS_NOUSER); \
449                 else \
450                         git remote add others    $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OTHERS); \
451                 fi ; \
452         fi;