Correct modification of topdir.conf
[fso-makefile.git] / Makefile
blob137c82b1ba36a265e646bf6333ef43218067d1c8
1 # Makefile for the OpenMoko SHR development system
2 # Licensed under the GPL v2 or later
4 BITBAKE_VERSION = branches/bitbake-1.8
6 FSO_STABLE_MILESTONE = milestone3
7 FSO_STABLE_VERSION = HEAD
9 SHR_STABLE_MILESTONE = milestone1
10 SHR_STABLE_VERSION = HEAD
12 .PHONY: all
13 all: update build
15 .PHONY: prefetch
16 prefetch: prefetch-fso-unstable prefetch-fso-testing prefetch-fso-${FSO_STABLE_MILESTONE} \
17 prefetch-shr-unstable prefetch-shr-testing prefetch-shr-${SHR_STABLE_MILESTONE}
19 .PHONY: build
20 build:
21 [ ! -e fso-unstable ] || ${MAKE} fso-unstable-image
22 [ ! -e fso-testing ] || ${MAKE} fso-testing-image
23 # [ ! -e fso-${FSO_STABLE_MILESTONE} ] || ${MAKE} fso-${FSO_STABLE_MILESTONE}-image
24 [ ! -e shr-unstable ] || ${MAKE} shr-unstable-image
25 # [ ! -e shr-testing ] || ${MAKE} shr-testing-image
26 # [ ! -e shr-${SHR_STABLE_MILESTONE} ] || ${MAKE} shr-${SHR_STABLE_MILESTONE}-image
27 [ ! -e fso-unstable ] || ${MAKE} fso-unstable-packages
28 [ ! -e fso-testing ] || ${MAKE} fso-testing-packages
29 # [ ! -e fso-${FSO_STABLE_MILESTONE} ] || ${MAKE} fso-${FSO_STABLE_MILESTONE}-packages
31 .PHONY: setup
32 setup: setup-common setup-bitbake setup-openembedded \
33 setup-fso-unstable setup-fso-testing setup-fso-${FSO_STABLE_MILESTONE} \
34 setup-shr-unstable setup-shr-testing setup-shr-${SHR_STABLE_MILESTONE}
36 .PHONY: update
37 update: update-common update-bitbake update-openembedded
38 [ ! -e shr ] || ${MAKE} update-shr
40 .PHONY: status
41 status: status-common status-bitbake status-openembedded
42 [ ! -e shr ] || ${MAKE} status-shr
44 .PHONY: clobber
45 clobber: clobber-fso-unstable clobber-fso-testing clobber-fso-${FSO_STABLE_MILESTONE} \
46 clobber-shr-unstable clobber-shr-testing clobber-shr-${SHR_STABLE_MILESTONE}
48 .PHONY: distclean
49 distclean: distclean-bitbake distclean-openembedded \
50 distclean-fso-unstable distclean-fso-testing distclean-fso-${FSO_STABLE_MILESTONE} \
51 distclean-shr-unstable distclean-shr-testing distclean-shr-${SHR_STABLE_MILESTONE}
53 .PHONY: prefetch-%
54 prefetch-%: %/.configured
55 ( cd $* ; ${MAKE} prefetch )
57 .PHONY: fso-%-image
58 fso-%-image: fso-%/.configured
59 ( cd fso-$* ; \
60 ${MAKE} setup-image-fso-image ; \
61 ${MAKE} setup-machine-om-gta01 ; \
62 ${MAKE} -k image )
63 ( cd fso-$* ; \
64 ${MAKE} setup-image-fso-image ; \
65 ${MAKE} setup-machine-om-gta02 ; \
66 ${MAKE} -k image )
68 .PHONY: fso-%-packages
69 fso-%-packages: fso-%/.configured
70 ( cd fso-$* ; \
71 ${MAKE} setup-image-fso-image ; \
72 ${MAKE} setup-machine-om-gta01 ; \
73 ${MAKE} -k distro index )
74 ( cd fso-$* ; \
75 ${MAKE} setup-image-fso-image ; \
76 ${MAKE} setup-machine-om-gta02 ; \
77 ${MAKE} -k distro index )
79 .PHONY: fso-%-index
80 fso-%-index: fso-%/.configured
81 ( cd fso-$* ; \
82 ${MAKE} setup-image-fso-image ; \
83 ${MAKE} -k index)
85 .PHONY: shr-%-image
86 shr-%-image: shr-%/.configured
87 ( cd shr-$* ; \
88 ${MAKE} setup-image-shr-image ; \
89 ${MAKE} setup-machine-om-gta01 ; \
90 ${MAKE} -k image )
91 ( cd shr-$* ; \
92 ${MAKE} setup-image-shr-image ; \
93 ${MAKE} setup-machine-om-gta02 ; \
94 ${MAKE} -k image )
96 .PHONY: shr-%-packages
97 shr-%-packages: shr-%/.configured
98 ( cd shr-$* ; \
99 ${MAKE} setup-image-shr-image ; \
100 ${MAKE} setup-machine-om-gta01 ; \
101 ${MAKE} -k distro index )
102 ( cd shr-$* ; \
103 ${MAKE} setup-image-shr-image ; \
104 ${MAKE} setup-machine-om-gta02 ; \
105 ${MAKE} -k distro index )
107 .PHONY: shr-%-index
108 shr-%-index: shr-%/.configured
109 ( cd shr-$* ; \
110 ${MAKE} setup-image-shr-image ; \
111 ${MAKE} -k index )
113 .PHONY: setup-common
114 .PRECIOUS: common/.git/config
115 setup-common common/.git/config:
116 [ -e common/.git/config ] || \
117 ( git clone git://git.freesmartphone.org/fso-makefile.git common && \
118 rm -f Makefile && \
119 ln -s common/Makefile Makefile )
120 touch common/.git/config
122 .PHONY: setup-bitbake
123 .PRECIOUS: bitbake/.svn/entries
124 setup-bitbake bitbake/.svn/entries:
125 [ -e bitbake/.svn/entries ] || \
126 ( svn co svn://svn.berlios.de/bitbake/${BITBAKE_VERSION} bitbake )
127 touch bitbake/.svn/entries
129 .PHONY: setup-openembedded
130 .PRECIOUS: openembedded/.git/config
131 setup-openembedded openembedded/.git/config:
132 [ -e openembedded/.git/config ] || \
133 ( git clone git://git.openembedded.net/openembedded openembedded ; \
134 cd openembedded ; \
135 git config --add remote.origin.fetch '+refs/heads/*:refs/remotes/*' )
136 ( cd openembedded && \
137 ( git branch | egrep -e ' org.openembedded.dev$$' > /dev/null || \
138 git checkout -b org.openembedded.dev --track origin/org.openembedded.dev ))
139 ( cd openembedded && git checkout org.openembedded.dev )
140 touch openembedded/.git/config
142 .PHONY: setup-shr
143 .PRECIOUS: shr/.svn/entries
144 setup-shr shr/.svn/entries:
145 [ -e shr/.git/config ] || \
146 ( git clone http://shr.bearstech.com/repo/shr.git shr )
147 touch shr/.git/config
149 .PHONY: setup-%
150 setup-%:
151 ${MAKE} $*/.configured
153 .PRECIOUS: setup-fso-${FSO_STABLE_MILESTONE}
154 setup-fso-${FSO_STABLE_MILESTONE}:
155 ${MAKE} fso-${FSO_STABLE_MILESTONE}/.configured
156 rm -f fso-${FSO_STABLE_MILESTONE}/.configured
157 rm -rf fso-${FSO_STABLE_MILESTONE}/openembedded
158 ( cd fso-${FSO_STABLE_MILESTONE} ; \
159 git clone ../openembedded ; \
160 cd openembedded ; \
161 git checkout -b ${FSO_STABLE_MILESTONE} ${FSO_STABLE_VERSION} )
162 touch fso-${FSO_STABLE_MILESTONE}/.configured
164 .PRECIOUS: fso-%/.configured
165 fso-%/.configured: common/.git/config bitbake/.svn/entries openembedded/.git/config
166 [ -d fso-$* ] || ( mkdir -p fso-$* )
167 [ -e downloads ] || ( mkdir -p downloads )
168 [ -e fso-$*/Makefile ] || ( cd fso-$* ; ln -sf ../common/openembedded.mk Makefile )
169 [ -e fso-$*/setup-env ] || ( cd fso-$* ; ln -sf ../common/setup-env . )
170 [ -e fso-$*/downloads ] || ( cd fso-$* ; ln -sf ../downloads . )
171 [ -e fso-$*/bitbake ] || ( cd fso-$* ; ln -sf ../bitbake . )
172 [ -e fso-$*/openembedded ] || ( cd fso-$* ; ln -sf ../openembedded . )
173 [ -d fso-$*/conf ] || ( mkdir -p fso-$*/conf )
174 [ -e fso-$*/conf/site.conf ] || ( cd fso-$*/conf ; ln -sf ../../common/conf/site.conf . )
175 [ -e fso-$*/conf/auto.conf ] || ( \
176 echo "DISTRO = \"openmoko\"" > fso-$*/conf/auto.conf ; \
177 echo "MACHINE = \"om-gta02\"" >> fso-$*/conf/auto.conf ; \
178 echo "IMAGE_TARGET = \"fso-image\"" >> fso-$*/conf/auto.conf ; \
179 echo "DISTRO_TARGET = \"openmoko-feed\"" >> fso-$*/conf/auto.conf ; \
180 echo "INHERIT += \"rm_work\"" >> fso-$*/conf/auto.conf ; \
182 [ -e fso-$*/conf/local.conf ] || ( \
183 echo "# require conf/distro/include/moko-autorev.inc" > fso-$*/conf/local.conf ; \
184 echo "# require conf/distro/include/fso-autorev.inc" >> fso-$*/conf/local.conf ; \
186 rm -rf fso-$*/tmp/cache
187 touch fso-$*/.configured
189 .PRECIOUS: shr-%/.configured
190 shr-%/.configured: common/.git/config bitbake/.svn/entries openembedded/.git/config shr/.svn/entries
191 [ -d shr-$* ] || ( mkdir -p shr-$* )
192 [ -e downloads ] || ( mkdir -p downloads )
193 [ -e shr-$*/Makefile ] || ( cd shr-$* ; ln -sf ../common/openembedded.mk Makefile )
194 [ -e shr-$*/setup-env ] || ( cd shr-$* ; ln -sf ../common/setup-env . )
195 [ -e shr-$*/downloads ] || ( cd shr-$* ; ln -sf ../downloads . )
196 [ -e shr-$*/bitbake ] || ( cd shr-$* ; ln -sf ../bitbake . )
197 [ -e shr-$*/openembedded ] || ( cd shr-$* ; ln -sf ../openembedded . )
198 [ -e shr-$*/shr ] || ( cd shr-$* ; ln -sf ../shr . )
199 [ -d shr-$*/conf ] || ( mkdir -p shr-$*/conf )
200 [ -e shr-$*/conf/site.conf ] || ( cd shr-$*/conf ; ln -sf ../../common/conf/site.conf . )
201 [ -e shr-$*/conf/topdir.conf ] || ( \
202 echo "TOPDIR = '`pwd`'" > shr-$*/conf/topdir.conf ; \
204 [ -e shr-$*/conf/auto.conf ] || ( \
205 echo "DISTRO = \"openmoko\"" > shr-$*/conf/auto.conf ; \
206 echo "MACHINE = \"om-gta02\"" >> shr-$*/conf/auto.conf ; \
207 echo "IMAGE_TARGET = \"shr-image\"" >> shr-$*/conf/auto.conf ; \
208 echo "DISTRO_TARGET = \"openmoko-feed\"" >> shr-$*/conf/auto.conf ; \
209 echo "INHERIT += \"rm_work\"" >> shr-$*/conf/auto.conf ; \
211 [ -e shr-$*/conf/local.conf ] || ( \
212 echo "# require conf/distro/include/moko-autorev.inc" > shr-$*/conf/local.conf ; \
213 echo "# require conf/distro/include/fso-autorev.inc" >> shr-$*/conf/local.conf ; \
214 echo "BBFILES += \"\$${TOPDIR}/shr/openembedded/packages/*/*.bb\"" >> shr-$*/conf/local.conf ; \
215 echo "BB_GIT_CLONE_FOR_SRCREV = \"1\"" >> shr-$*/conf/local.conf ; \
216 echo "OE_ALLOW_INSECURE_DOWNLOADS=1" >> shr-$*/conf/local.conf ; \
217 echo "require conf/distro/include/sane-srcrevs.inc" >> shr-$*/conf/local.conf ; \
218 echo "require conf/distro/include/sane-srcdates.inc" >> shr-$*/conf/local.conf ; \
219 echo "require conf/distro/include/shr-autorev.inc" >> shr-$*/conf/local.conf ; \
221 rm -rf shr-$*/tmp/cache
222 touch shr-$*/.configured
224 .PHONY: update-common
225 update-common: common/.git/config
226 ( cd common ; git pull )
228 .PHONY: update-bitbake
229 update-bitbake: bitbake/.svn/entries
230 ( cd bitbake ; svn up )
232 .PHONY: update-openembedded
233 update-openembedded: openembedded/.git/config
234 ( cd openembedded ; git pull )
236 .PHONY: update-shr
237 update-shr: shr/.svn/entries
238 ( cd shr ; git pull )
240 .PHONY: status-common
241 status-common: common/.git/config
242 ( cd common ; git diff --stat )
244 .PHONY: status-bitbake
245 status-bitbake: bitbake/.svn/entries
246 ( cd bitbake ; svn status )
248 .PHONY: status-openembedded
249 status-openembedded: openembedded/.git/config
250 ( cd openembedded ; git diff --stat )
252 .PHONY: status-shr
253 status-shr: shr/.svn/entries
254 ( cd shr ; git status )
256 .PHONY: clobber-%
257 clobber-%:
258 [ ! -e $*/Makefile ] || ( cd $* ; ${MAKE} clobber )
260 .PHONY: distclean-bitbake
261 distclean-bitbake:
262 rm -rf bitbake
264 .PHONY: distclean-openembedded
265 distclean-openembedded:
266 rm -rf openembedded
268 .PHONY: distclean-shr
269 distclean-shr:
270 rm -rf shr
272 .PHONY: distclean-%
273 distclean-%:
274 rm -rf $*
276 .PHONY: push
277 push: push-common
279 .PHONY: push-common
280 push-common: update-common
281 ( cd common ; git push --all ssh://git@git.freesmartphone.org/fso-makefile.git )
283 # End of Makefile