OSDN Git Service

prepare subtree:
[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         #echo tacyas@git.sourceforge.jp:/gitroot/eos/hostdependX86MAC64.git
107         #echo $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_HOSTDEPEND)$${EOS_HOSTDIR}.git
108         git remote add -f hostdepend$${EOS_HOSTDIER} $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_HOSTDEPEND)$${EOS_HOSTDIR}.git 
109         git subtree add --prefix=hostdepend/$${EOS_HOSTDIR}/ --squash hostdepend$${EOS_HOSTDIR} master 
110
111 git-add-optional::
112         cd optional; git add -v --all . 
113
114 git-add-data::
115         cd data; git add -v --all . 
116
117 git-add-tutorial::
118         cd tutorial; git add -v --all . 
119
120 git-add-others::
121         cd others; git add -v --all . 
122
123 git-add-others2::
124         cd others2; git add --all . 
125
126 git-commit-all:: git-commit git-commit-data git-commit-optional git-commit-tutorial git-commit-others
127
128 git-commit::
129         git commit 
130
131 git-commit-optional::
132         cd optional; git commit  
133
134 git-commit-data::
135         cd data; git commit 
136
137 git-commit-tutorial::
138         cd tutorial; git commit 
139
140 git-commit-others::
141         cd others; git commit 
142
143 git-commit-others2::
144         cd others2; git commit 
145
146 git-backup::
147         git push $(EOS_GIT_BACKUPSITE) master  --tags
148
149 git-tag::
150         @export DIRECTORYNAME=./; \
151         make git-tag-common;
152
153 git-tag-optional::
154         @export DIRECTORYNAME=optional; \
155         make git-tag-common;
156
157 git-tag-data::
158         @export DIRECTORYNAME=data; \
159         make git-tag-common;
160
161 git-tag-tutorial::
162         @export DIRECTORYNAME=tutorial; \
163         make git-tag-common;
164
165 git-tag-others::
166         @export DIRECTORYNAME=others; \
167         make git-tag-common;
168
169 git-tag-common::
170         @if [ ! -z "$$DIRECTORYNAME" ]; then \
171                 cd $$DIRECTORYNAME; \
172                 echo; \
173                 git tag | sort -k 2,2 -n -t p ; \
174                 echo "Version No. (e.g. vXX.YY.ZZpSSSS)"; \
175                 read TTT; \
176                 if [ ! -z "$$TTT" ]; then \
177                         git tag $$TTT; \
178                 else \
179                         echo "Incorrect."; \
180                 fi; \
181         fi;
182
183 git-push-all:: git-push git-push-data git-push-optional git-push-tutorial git-push-others
184
185 git-push::git-push-hostdepend
186 #       git push origin master  --tags
187         @export DIRECTORYNAME=./; \
188         export ORIGINNAME=origin; \
189         make git-push-with-check;
190
191 git-push-hostdepend::
192         git subtree push --prefix=hostdepend/$${EOS_HOSTDIR}/ --squash hostdepend$${EOS_HOSTDIR} master 
193
194 git-push-optional::
195 #       cd optional; git push optional master --tags
196         @export DIRECTORYNAME=optional; \
197         export ORIGINNAME=optional; \
198         make git-push-with-check;
199
200 git-push-data::
201 #       cd data; git push data master --tags
202         @export DIRECTORYNAME=data; \
203         export ORIGINNAME=data; \
204         make git-push-with-check;
205
206 git-push-tutorial::
207 #       cd tutorial; git push tutorial master --tags
208         @export DIRECTORYNAME=tutorial; \
209         export ORIGINNAME=tutorial; \
210         make git-push-with-check;
211
212 git-push-others::
213 #       cd others; git push others master --tags
214         @export DIRECTORYNAME=others; \
215         export ORIGINNAME=others; \
216         make git-push-with-check;
217
218 git-push-with-check::
219         @if [ ! -z "$$DIRECTORYNAME" -a ! -z "$$ORIGINNAME" ]; then \
220                 cd $$DIRECTORYNAME; \
221                 echo; \
222                 SSS=`git tag | sort -k 2,2 -n -t p | tail -1`; \
223                 if [ ! -z "$$SSS" ]; then \
224                         echo "$$SSS is Current Tags in $$ORIGINNAME."; \
225                         echo "Did Tag update? Y(: push) | N(or Otherwords : not push)"; \
226                         read TTT; \
227                         if [ "$$TTT" = Y ]; then \
228                                 git push $$ORIGINNAME master --tags; \
229                         else \
230                                 echo "not push."; \
231                         fi; \
232                 else \
233                         echo "Tags do not exist in $$ORIGINNAME."; \
234                         echo "Before push please add tag at current repositry."; \
235                 fi; \
236         fi;
237
238 git-fetch-all:: git-fetch git-fetch-data git-fetch-optional git-fetch-tutorial git-fetch-others
239
240 git-fetch::git-pull-hostdepend
241         cd .       ; git fetch origin master --tags     ; git log -1
242
243 git-pull-hostdepend::
244         git subtree pull --prefix=hostdepend/$${EOS_HOSTDIR}/ hostdpend$${EOS_HOSTDIR} master 
245
246 git-fetch-data::
247         cd data    ; git fetch data master --tags               ; git log -1
248
249 git-fetch-optional::
250         cd optional; git fetch optional master --tags   ; git log -1
251
252 git-fetch-tutorial::
253         cd tutorial; git fetch tutorial master --tags   ; git log -1
254
255 git-fetch-others::
256         cd others  ; git fetch others master --tags             ; git log -1
257
258 git-merge-all:: git-merge git-merge-data git-merge-optional git-merge-tutorial git-merge-others
259
260 git-merge::
261         cd .       ; git log -1; git merge FETCH_HEAD 
262
263 git-merge-data::
264         cd data    ; git log -1; git merge FETCH_HEAD 
265
266 git-merge-optional::
267         cd optional; git log -1; git merge FETCH_HEAD
268
269 git-merge-tutorial::
270         cd tutorial; git log -1; git merge FETCH_HEAD 
271
272 git-merge-others::
273         cd others  ; git log -1; git merge FETCH_HEAD 
274
275 #
276 # Nickname 
277 #
278
279 git-init-all:: git-init git-init-data git-init-optional git-init-tutorial git-init-others
280
281 git-init:: git-add-hostdepend
282         if [ ! -d .git ] ; then git init        ; fi
283         @export ORIGINNAME=origin; \
284         make git-remote-add;
285
286 git-init-data::
287         if [ ! -d data ] ; then mkdir data; fi
288         cd data; \
289         if [ ! -d .git ] ; then git init        ; fi ;
290         @export ORIGINNAME=data; \
291         make git-remote-add-data;
292
293 git-init-optional::
294         if [ ! -d optional ] ; then mkdir optional; fi
295         if [ ! -L doc      ] ; then ln -sf optional/doc . ; fi
296         if [ ! -L objects  ] ; then ln -sf optional/objects . ; fi
297         cd optional; \
298         if [ ! -d .git ] ; then git init        ; fi ;
299         @export ORIGINNAME=optional; \
300         make git-remote-add-optional;
301
302 git-init-tutorial::
303         if [ ! -d tutorial ] ; then mkdir tutorial ; fi
304         cd tutorial; \
305         if [ ! -d .git ] ; then git init        ; fi ;
306         @export ORIGINNAME=tutorial; \
307         make git-remote-add-tutorial;
308
309 git-init-others::
310         if [ ! -d others ] ; then mkdir others; fi
311         cd others ; \
312         if [ ! -d .git ] ; then git init        ; fi ;
313         @export ORIGINNAME=others; \
314         make git-remote-add-others;
315
316 git-init-others2::
317         if [ ! -d others2 ] ; then mkdir others2; fi
318         cd others2 ; git remote add others2 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OTHERS)
319
320 git-clone-all:: git-clone
321         @if [ ! -z "$${EOS_HOME}" -a -d "$${EOS_HOME}" ] ; then \
322                 cd $${EOS_HOME} ; \
323                 make git-clone-data git-clone-optional git-clone-tutorial git-clone-others; \
324         fi;
325
326 git-clone::
327         @if [ ! -z "$${EOS_HOME}" -a -d "$${EOS_HOME}" ] ; then \
328                 TMPDIRECTORY=$$(pwd) ; \
329                 cd $${EOS_HOME} ; \
330                 if [ ! -d  .git ] ; \
331                 then \
332                         if [ -z $${EOS_GITUSER} ] ; then \
333                                 git clone --depth 1 $(EOS_GIT_REPOSITRY_NOUSER) ./ ; \
334                         else \
335                                 git clone --depth 1 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY) ./ ; \
336                         fi ; \
337                         cd $${TMPDIRECTORY}; \
338                         export ORIGINNAME=origin; \
339                         make git-remote-add; \
340                 fi; \
341         fi;
342
343 git-clone-data::
344         if [ ! -d data ] ; then mkdir data; fi
345         @cd data;  if [ ! -d .git ] ; \
346         then \
347                 if [ -z $${EOS_GITUSER} ] ; then \
348                         git clone --depth 1 $(EOS_GIT_REPOSITRY_DATA_NOUSER) ./ ; \
349                 else \
350                         git clone --depth 1 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_DATA) ./; \
351                 fi ; \
352                 cd ../ ; \
353                 export ORIGINNAME=data; \
354                 make git-remote-add-data; \
355         fi
356
357 git-clone-optional::
358         if [ ! -d optional ] ; then mkdir optional; fi
359         if [ ! -L doc      ] ; then ln -sf optional/doc . ; fi
360         if [ ! -L objects  ] ; then ln -sf optional/objects . ; fi
361         @cd optional; if [ ! -d .git ] ; \
362         then \
363                 if [ -z $${EOS_GITUSER} ] ; then \
364                         git clone --depth 1 $(EOS_GIT_REPOSITRY_OPTIONAL_NOUSER) ./ ; \
365                 else \
366                         git clone --depth 1 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OPTIONAL) ./ ; \
367                 fi ; \
368                 cd ../ ; \
369                 export ORIGINNAME=optional; \
370                 make git-remote-add-optional; \
371         fi
372
373 git-clone-tutorial::
374         if [ ! -d tutorial ] ; then mkdir tutorial ; fi
375         @cd tutorial; if [ ! -d .git ] ; \
376         then \
377                 if [ -z $${EOS_GITUSER} ] ; then \
378                         git clone --depth 1 $(EOS_GIT_REPOSITRY_TUTORIAL_NOUSER) ./ ; \
379                 else \
380                         git clone --depth 1 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_TUTORIAL) ./ ; \
381                 fi; \
382                 cd ../ ; \
383                 export ORIGINNAME=tutorial; \
384                 make git-remote-add-tutorial; \
385         fi
386
387 git-clone-others::
388         if [ ! -d others ] ; then mkdir others; fi
389         @cd others ; if [ ! -d .git ] ; \
390         then \
391                 if [ -z $${EOS_GITUSER} ] ; then \
392                         git clone --depth 1 $(EOS_GIT_REPOSITRY_OTHERS_NOUSER) ./ ; \
393                 else \
394                         git clone --depth 1 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OTHERS) ./ ; \
395                 fi; \
396                 cd ../ ; \
397                 export ORIGINNAME=others; \
398                 make git-remote-add-others; \
399         fi
400
401 git-remote-add::
402         @if [ ! -z "$$ORIGINNAME" -a ! -z "$${EOS_HOME}" -a -d "$${EOS_HOME}"  ]; then \
403                 cd $${EOS_HOME}; \
404                 SSS=`git remote -v | awk '{print $$1}' | grep origin`; if [ ! -z "$$SSS" ] ; then git remote rm origin ; fi ; \
405                 if [ -z $${EOS_GITUSER} ] ; then \
406                         git remote add origin    $(EOS_GIT_REPOSITRY_NOUSER); \
407                 else \
408                         git remote add origin    $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY); \
409                 fi ; \
410         fi;
411
412 git-remote-add-data::
413         @if [ ! -z "$$ORIGINNAME" ]; then \
414                 cd $$ORIGINNAME; \
415                 SSS=`git remote -v | awk '{print $$1}' | grep data`; if [ ! -z "$$SSS" ] ; then git remote rm data ; fi ; \
416                 if [ -z $${EOS_GITUSER} ] ; then \
417                         git remote add data    $(EOS_GIT_REPOSITRY_DATA_NOUSER); \
418                 else \
419                         git remote add data    $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_DATA); \
420                 fi ; \
421         fi;
422
423 git-remote-add-optional::
424         @if [ ! -z "$$ORIGINNAME" ]; then \
425                 cd $$ORIGINNAME; \
426                 SSS=`git remote -v | awk '{print $$1}' | grep optional`; if [ ! -z "$$SSS" ] ; then git remote rm optional ; fi ; \
427                 if [ -z $${EOS_GITUSER} ] ; then \
428                         git remote add optional    $(EOS_GIT_REPOSITRY_OPTIONAL_NOUSER); \
429                 else \
430                         git remote add optional    $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OPTIONAL); \
431                 fi ; \
432         fi;
433
434 git-remote-add-tutorial::
435         @if [ ! -z "$$ORIGINNAME" ]; then \
436                 cd $$ORIGINNAME; \
437                 SSS=`git remote -v | awk '{print $$1}' | grep tutorial`; if [ ! -z "$$SSS" ] ; then git remote rm tutorial ; fi ; \
438                 if [ -z $${EOS_GITUSER} ] ; then \
439                         git remote add tutorial    $(EOS_GIT_REPOSITRY_TUTORIAL_NOUSER); \
440                 else \
441                         git remote add tutorial    $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_TUTORIAL); \
442                 fi ; \
443         fi;
444
445 git-remote-add-others::
446         @if [ ! -z "$$ORIGINNAME" ]; then \
447                 cd $$ORIGINNAME; \
448                 SSS=`git remote -v | awk '{print $$1}' | grep others`; if [ ! -z "$$SSS" ] ; then git remote rm others ; fi ; \
449                 if [ -z $${EOS_GITUSER} ] ; then \
450                         git remote add others    $(EOS_GIT_REPOSITRY_OTHERS_NOUSER); \
451                 else \
452                         git remote add others    $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OTHERS); \
453                 fi ; \
454         fi;