OSDN Git Service

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