OSDN Git Service

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