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