# $FreeWRT$
#-
# This file is part of the FreeWRT project. FreeWRT is copyrighted
# material, please see the LICENCE file in the top-level directory
# or at http://www.freewrt.org/licence for details.

PKG_NAME:=		u-boot
PKG_VERSION:=		1.1.4
PKG_MD5SUM:=		096cac66046326659b97eeded007ec73
DISTFILES:=		$(PKG_NAME)-$(PKG_VERSION).tar.bz2
MASTER_SITES:=		ftp://ftp.denx.de/pub/u-boot/

include $(TOPDIR)/rules.mk
include ../rules.mk
#include ${TOPDIR}/mk/fetch.mk

DEFS=			-idirafter ../include -DTEXT_BASE= -DUSE_HOSTCC
ifeq (${OStype},Darwin)
DEFS+=			-D__FreeBSD__
endif

$(WRKBUILD)/tools/mkimage: $(WRKBUILD)/.prepared
	cd ${WRKBUILD}/tools && \
	    ${HOSTCC} -O -g -Wall -pedantic ${DEFS} -c mkimage.c && \
	    ${HOSTCC} -O -g -Wall -pedantic ${DEFS} -c ../lib_generic/crc32.c && \
	    ${HOSTCC} ${DEFS} -o mkimage mkimage.o crc32.o

$(STAGING_TOOLS)/bin/mkimage: $(WRKBUILD)/tools/mkimage
	$(CP) $< $@

source: ${_CHECKSUM_COOKIE}
prepare: $(WRKBUILD)/.prepared
compile: $(WRKBUILD)/tools/mkimage $(STAGING_TOOLS)/bin/mkimage
install: $(STAGING_TOOLS)/bin/mkimage
clean: 
	rm -rf $(WRKBUILD)
