#!/usr/bin/make -f # # Makefile-opendreambox v0.4.6 (2010-02-20) # # Note: You can override all variables by storing them # in an external file called "build.conf". -include build.conf # target platform: dm500hd, dm500plus, dm600pvr, dm7020, dm7025, dm800, dm8000 MACHINE ?= dm500plus # for a list of some other repositories have # a look at http://git.opendreambox.org/ GIT_URL ?= git://git.opendreambox.org/git/openembedded # in case you want to send pull requests or generate patches #GIT_AUTHOR_NAME ?= Your Name #GIT_AUTHOR_EMAIL ?= you@example.com # Uncomment this if you want to use only one Git repository # for all platforms. #SINGLE_REPOSITORY ?= 1 # Uncomment this if you're upgrading an installation # from Monotone. This changes the directory layout # to the old version without shared directories. #UPGRADE_FROM_MONOTONE ?= 1 # you should not need to change anything below BB_URL = git://git.opendreambox.org/git/bitbake BB_BRANCH = 1.4.2-git GIT = git GIT_BRANCH = opendreambox-1.5 PWD := $(shell pwd) ifeq ($(UPGRADE_FROM_MONOTONE),1) OE_BASE = $(PWD) else OE_BASE = $(PWD)/$(MACHINE) endif ifeq ($(SINGLE_REPOSITORY),1) GIT_DIR = $(PWD)/openembedded else GIT_DIR = $(OE_BASE)/openembedded endif ifeq ($(findstring $(MACHINE),dm500plus dm600pvr dm7020),$(MACHINE)) ARCH = powerpc else ARCH = mipsel endif all: initialize @echo @echo "Openembedded for the Dreambox environment has been initialized" @echo "properly. Now you can either:" @echo @echo " - make the 'image'-target to build an image, or" @echo " - go into $(MACHINE)/build/, source env.source and start on your own!" @echo bb: bb/.git bb/.git: @if [ -e bb/.svn ]; then \ echo "BitBake needs to be updated. Please remove the \"bb\" directory manually!"; \ exit 1; \ fi $(GIT) clone -n $(BB_URL) bb cd bb && ( \ if [ -n "$(GIT_AUTHOR_EMAIL)" ]; then git config user.email "$(GIT_AUTHOR_EMAIL)"; fi; \ if [ -n "$(GIT_AUTHOR_NAME)" ]; then git config user.name "$(GIT_AUTHOR_NAME)"; fi; \ $(GIT) branch --track $(BB_BRANCH) origin/$(BB_BRANCH) || true; \ $(GIT) checkout -f $(BB_BRANCH) \ ) bb-update: bb/.git cd bb && $(GIT) pull origin $(BB_BRANCH) .PHONY: bb-update image initialize openembedded-update openembedded-update-all image: bb-update initialize openembedded-update cd $(OE_BASE)/build; . ./env.source; bitbake -k dreambox-image initialize: $(OE_BASE)/cache sources $(OE_BASE)/build $(OE_BASE)/build/conf \ $(OE_BASE)/build/tmp $(GIT_DIR) $(OE_BASE)/build/conf/local.conf \ $(OE_BASE)/build/env.source bb openembedded-update: $(GIT_DIR) cd $(GIT_DIR) && $(GIT) pull origin $(GIT_BRANCH) openembedded-update-all: @for dir in dm*/openembedded; do \ echo "running $(GIT) pull origin $(GIT_BRANCH) in $$dir"; \ cd $$dir && $(GIT) pull origin $(GIT_BRANCH) && cd -; \ done $(OE_BASE)/build $(OE_BASE)/build/conf $(OE_BASE)/build/tmp $(OE_BASE)/cache sources: mkdir -p $@ $(OE_BASE)/build/conf/local.conf: echo 'DL_DIR = "$(PWD)/sources"' > $@ echo 'OE_BASE = "$(OE_BASE)"' >> $@ echo 'BBFILES = "$(GIT_DIR)/packages/*/*.bb"' >> $@ echo 'BBMASK = "(nslu.*|.*-sdk.*)"' >> $@ echo 'PREFERRED_PROVIDERS += " virtual/$${TARGET_PREFIX}gcc-initial:gcc-cross-initial"' >> $@ echo 'PREFERRED_PROVIDERS += " virtual/$${TARGET_PREFIX}gcc:gcc-cross"' >> $@ echo 'PREFERRED_PROVIDERS += " virtual/$${TARGET_PREFIX}g++:gcc-cross"' >> $@ echo 'MACHINE = "$(MACHINE)"' >> $@ echo 'TARGET_OS = "linux"' >> $@ echo 'DISTRO = "opendreambox-1.5"' >> $@ echo 'CACHE = "$(OE_BASE)/cache/oe-cache.$${USER}"' >> $@ $(OE_BASE)/build/env.source: echo 'OE_BASE=$(OE_BASE)' > $@ echo 'export BBPATH="$(GIT_DIR)/:$(PWD)/bb/:$${OE_BASE}/build/"' >> $@ echo 'PATH=$(PWD)/bb/bin:$${OE_BASE}/build/tmp/cross/bin:$${PATH}' >> $@ echo 'export PATH' >> $@ echo 'export LD_LIBRARY_PATH=' >> $@ echo 'export LANG=C' >> $@ cat $@ $(GIT_DIR): $(GIT_DIR)/.git $(GIT_DIR)/.git: @if [ -d $(GIT_DIR)/_MTN ]; then echo "Please remove your old monotone repository from $(GIT_DIR)!"; exit 1; fi $(GIT) clone -n $(GIT_URL) $(GIT_DIR) cd $(GIT_DIR) && ( \ if [ -n "$(GIT_AUTHOR_EMAIL)" ]; then git config user.email "$(GIT_AUTHOR_EMAIL)"; fi; \ if [ -n "$(GIT_AUTHOR_NAME)" ]; then git config user.name "$(GIT_AUTHOR_NAME)"; fi; \ $(GIT) branch --track $(GIT_BRANCH) origin/$(GIT_BRANCH) || true; \ $(GIT) checkout -f $(GIT_BRANCH) \ )