All of lore.kernel.org
 help / color / mirror / Atom feed
* Getting Started -Makefile
@ 2007-11-19 12:08 David Farning
  2007-11-19 14:33 ` Koen Kooi
  2007-11-19 14:41 ` Holger Freyther
  0 siblings, 2 replies; 56+ messages in thread
From: David Farning @ 2007-11-19 12:08 UTC (permalink / raw)
  To: OpenEmbedded Development List

I think that my getting started Makefile is ready for testing.

To setup a development BitBake\OpenEmbedded system:

##Do not run this from an existing bb/oe directory.  It will##
##overwrite parts of your local.conf.                       ##

make a new  test directory
change to the test directory
copy Makefile to directory

$make setup
$make build-package-vim

This eliminates many of problems the new users have setting up bb
and oe.  There is no need to know any thing about svn of monotone.

I am caching sources in HOME to reduce traffic while testing.
I am still working on the quem testing image setup so I did not 
include it.

Thanks
David Farning









# "Makefile" - a Makefile for setting up OpenEmbedded builds
#
# Copyright (c) 2007  David Farning <dfarning@gmail.com>
# All rights reserved.
# 
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA  02110-1301, USA
#
# Thanks to Rod Whitby for the OpenMokoMakefile

# Set BITBAKE_SVN_REV to either HEAD or 1.8
BITBAKE_SVN_REV = HEAD

ifeq ("${BITBAKE_SVN_REV}","HEAD")
BB_SVN_PATH := bitbake/trunk/bitbake
else
BB_SVN_PATH := bitbake/branches/bitbake-1.8
endif

MTN := mtn
#Set OPENEMBEDDED_MTM_REV to either head of a specific revision
OPENEMBEDDED_MTN_REV = HEAD

ifneq ("${OPENEMBEDDED_MTN_REV}","HEAD")
OPENEMBEDDED_REV_FLAGS = -r ${OPENEMBEDDED_MTN_REV}
endif
OE_SNAPSHOT_SITE := http://www.openembedded.org/snapshots


MACHINE := qemux86
DISTRO := angstrom-2007.1

CWD := pwd

###############################################################################
# Setup
###############################################################################

.PHONY: setup
setup:  setup-bitbake setup-mtn setup-openembedded setup-config setup-env

.PHONY: setup-bitbake
setup-bitbake stamps/bitbake:
	[ -e stamps/bitbake ] || \
	( svn co -r ${BITBAKE_SVN_REV} svn://svn.berlios.de/${BB_SVN_PATH} bitbake )
	[ -d stamps ] || mkdir stamps
	touch stamps/bitbake

OE.mtn:
	if [ -z "`${MTN} --version | awk '{ print $$2; }'`" ] ; then \
	  echo 'Cannot determine version for monotone using "${MTN} --version"' ; \
	  false ; \
	fi
	[ -e OE.mtn ] || \
	( ( version=`${MTN} --version | awk '{ print $$2; }'` ; \
	    wget -c -O OE.mtn.bz2 \
		${OE_SNAPSHOT_SITE}/OE-this-is-for-mtn-$$version.mtn.bz2 || \
	    wget -c -O OE.mtn.bz2 \
		${OE_SNAPSHOT_SITE}/OE.mtn.bz2 ) && \
	  bunzip2 -c OE.mtn.bz2 > OE.mtn.partial && \
	  mv OE.mtn.partial OE.mtn )

.PHONY: setup-mtn
setup-mtn stamps/OE.mtn:
	[ -e OE.mtn ] || \
	${MAKE} OE.mtn
	[ -e stamps/OE.mtn ] || \
	( ${MTN} --db=OE.mtn db migrate && \
	  ${MTN} --db=OE.mtn pull monotone.openembedded.org org.openembedded.dev )
	[ -d stamps ] || mkdir stamps
	touch stamps/OE.mtn

.PHONY: setup-openembedded
setup-openembedded stamps/openembedded: stamps/OE.mtn
	[ -e stamps/openembedded ] || \
	( ${MTN} --db=OE.mtn checkout --branch=org.openembedded.dev \
		${OPENEMBEDDED_REV_FLAGS} openembedded ) || \
	( ${MTN} --db=OE.mtn checkout --branch=org.openembedded.dev \
		-r `${MTN} --db=OE.mtn automate heads org.openembedded.dev | head -n1` openembedded )
	[ -d stamps ] || mkdir stamps
	touch stamps/openembedded

.PHONY: setup-config
setup-config build/conf/local.conf:
	[ -e build/conf/local.conf ] || \
	(   mkdir -p build/conf; \
	    cp openembedded/conf/local.conf.sample build/conf/local.conf; \
	    sed -i -e 's/^#[[:space:]]*MACHINE[[:space:]]*=[[:space:]]*\".*\"/MACHINE = \"${MACHINE}\"/' build/conf/local.conf; \
	    sed -i -e 's/^#[[:space:]]*DISTRO[[:space:]]*=[[:space:]]*\".*\"/DISTRO = \"${DISTRO}\"/' build/conf/local.conf; \
	    sed -i -e 's|BBFILES := "$${@bb.*|BBFILES := "${shell pwd}/openembedded/packages/*/*.bb"|' build/conf/local.conf; \
	    sed -i -e 's|# EDIT THIS FILE.*||' build/conf/local.conf; \
	    sed -i -e 's|REMOVE_THIS_LINE.*||' build/conf/local.conf; )

setup-env:
	[ -e setup-env ] || \
	echo 'export OEDIR="'`pwd`'"'                            > setup-env

	echo \
	'export BBPATH="$${OEDIR}/build:$${OEDIR}/openembedded"' >> setup-env

	echo \
	'export PATH="$${OEDIR}/bitbake/bin:$${PATH}"'            >> setup-env
###############################################################################
# Update
###############################################################################

.PHONY: update
update: update-bitbake update-mtn update-openembedded 

.PHONY: update-bitbake
update-bitbake: stamps/bitbake
	cd bitbake && svn update -r ${BITBAKE_SVN_REV}

.PHONY: update-mtn
update-mtn: stamps/OE.mtn
	if [ "${OPENMOKO_MTN_REV}" != "`(cd openembedded && ${MTN} automate get_base_revision_id)`" ] ; then \
		${MTN} --db=OE.mtn pull monotone.openembedded.org org.openembedded.dev ; \
	fi

.PHONY: update-openembedded
update-openembedded: update-mtn stamps/openembedded
	( cd openembedded && ${MTN} update ${MTN_REV_FLAGS} ) || \
	( cd openembedded && ${MTN} update \
		-r `${MTN} automate heads | head -n1` )

###############################################################################
# Build Tests
###############################################################################

#FIXME build sdk should sdk be what I have been calling the cross compiler + tools?
#FIXME build test package
#FIXME build test distro
#FIXME build test qemu image

###############################################################################
# Build Package
###############################################################################

.PHONY: build-package-%
build-package-%: setup
	( . ./setup-env \
		&& echo $$PATH \
		&& echo $$BBPATH \
		&& bitbake -c build $* )

.PHONY: rebuild-package-%
rebuild-package-%: setup
	( . ./setup-env && bitbake -c rebuild $* )

.PHONY: clean-package-%
clean-package-%: setup
	( . ./setup-env && bitbake -c clean $* )

###############################################################################
# Clean
###############################################################################

.PHONY: clean
clean: clean-openembedded

.PHONY: clean-openembedded
clean-openembedded:
	rm -rf tmp

###############################################################################
#  Clobber
###############################################################################

.PHONY: clobber
clobber: clobber-bitbake clobber-openembedded clobber-config clobber-env

.PHONY: clobber-bitbake
clobber-bitbake:
	rm -rf bitbake stamps/bitbake

.PHONY: clobber-openembedded
clobber-openembedded: clean-openembedded
	rm -rf openembedded stamps/openembedded

.PHONY: clobber-config
clobber-config:
	rm -rf build/conf/local.conf

.PHONY: clobber-env
clobber-env:
	rm -rf setup-env





^ permalink raw reply	[flat|nested] 56+ messages in thread

end of thread, other threads:[~2007-11-23  1:37 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-19 12:08 Getting Started -Makefile David Farning
2007-11-19 14:33 ` Koen Kooi
2007-11-19 23:51   ` Rod Whitby
2007-11-20  9:12     ` pHilipp Zabel
2007-11-20 17:57       ` Tim Bird
2007-11-20 20:00         ` Cliff Brake
2007-11-20 20:38         ` Philip Balister
2007-11-20 23:25         ` Florian Boor
2007-11-21  2:24           ` Paul Sokolovsky
2007-11-21  3:38           ` Rod Whitby
2007-11-21  2:24         ` Paul Sokolovsky
2007-11-21  5:44           ` Rod Whitby
2007-11-21 17:45             ` Paul Sokolovsky
2007-11-22  1:35             ` Michael 'Mickey' Lauer
2007-11-22  4:20               ` Lorn Potter
2007-11-22  8:14                 ` Esben Haabendal
2007-11-23  1:05                   ` Lorn Potter
2007-11-21 17:58           ` Tim Bird
2007-11-21 18:29             ` Paul Sokolovsky
2007-11-21 23:17               ` Rod Whitby
2007-11-22  0:44                 ` Tim Bird
2007-11-22 20:29                 ` Paul Sokolovsky
2007-11-21 19:32             ` Philip Balister
2007-11-21 19:32             ` Philip Balister
2007-11-20 21:16       ` Rod Whitby
2007-11-21  6:20       ` Esben Haabendal
2007-11-21 17:57         ` Paul Sokolovsky
2007-11-21 23:04           ` Rod Whitby
2007-11-22  8:40           ` Esben Haabendal
2007-11-20  9:39     ` Richard Purdie
2007-11-20 11:06       ` Rod Whitby
2007-11-20 12:30         ` Koen Kooi
2007-11-20 21:20           ` Rod Whitby
2007-11-20  9:58     ` Koen Kooi
2007-11-20 11:11       ` Rod Whitby
2007-11-20 12:27         ` Koen Kooi
2007-11-20 21:19           ` Rod Whitby
2007-11-20 14:39         ` Paul Sokolovsky
2007-11-20 23:20       ` Florian Boor
2007-11-20 11:44     ` Rod Whitby
2007-11-20 13:10       ` Koen Kooi
2007-11-20 21:11         ` Rod Whitby
2007-11-20 23:06           ` Lorn Potter
2007-11-19 14:41 ` Holger Freyther
2007-11-19 18:32   ` Tobias Pflug
2007-11-19 21:08   ` Lorn Potter
2007-11-20  9:33     ` Richard Purdie
2007-11-20 10:46       ` Marcin Juszkiewicz
2007-11-20 15:32       ` Mike (mwester)
2007-11-20 17:04         ` Marcin Juszkiewicz
2007-11-20 17:29         ` Holger Freyther
2007-11-20 17:29         ` Koen Kooi
2007-11-20 23:12         ` Lorn Potter
2007-11-22  1:32           ` Michael 'Mickey' Lauer
2007-11-22  1:28         ` The truth about OE team being afraid of 'make' (was: Getting Started -Makefile) Michael 'Mickey' Lauer
2007-11-22  3:15           ` Chris Larson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.