# # Copyright (C) 2006-2010 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # ifneq ($(__rules_inc),1) __rules_inc=1 ifeq ($(DUMP),) -include $(TOPDIR)/.config endif include $(TOPDIR)/include/debug.mk include $(TOPDIR)/include/verbose.mk export TMP_DIR:=$(TOPDIR)/tmp qstrip=$(strip $(subst ",,$(1))) #")) empty:= space:= $(empty) $(empty) merge=$(subst $(space),,$(1)) confvar=$(call merge,$(foreach v,$(1),$(if $($(v)),y,n))) strip_last=$(patsubst %.$(lastword $(subst .,$(space),$(1))),%,$(1)) define sep endef _SINGLE=export MAKEFLAGS=$(space); CFLAGS:= ARCH:=$(subst i486,i386,$(subst i586,i386,$(subst i686,i386,$(call qstrip,$(CONFIG_ARCH))))) ARCH_PACKAGES:=$(call qstrip,$(CONFIG_TARGET_ARCH_PACKAGES)) BOARD:=$(call qstrip,$(CONFIG_TARGET_BOARD)) TARGET_OPTIMIZATION:=$(call qstrip,$(CONFIG_TARGET_OPTIMIZATION)) export EXTRA_OPTIMIZATION:=$(call qstrip,$(CONFIG_EXTRA_OPTIMIZATION)) TARGET_SUFFIX=$(call qstrip,$(CONFIG_TARGET_SUFFIX)) BUILD_SUFFIX:=$(call qstrip,$(CONFIG_BUILD_SUFFIX)) SUBDIR:=$(patsubst $(TOPDIR)/%,%,${CURDIR}) export SHELL:=/usr/bin/env bash OPTIMIZE_FOR_CPU=$(subst i386,i486,$(ARCH)) ifeq ($(ARCH),powerpc) FPIC:=-fPIC else FPIC:=-fpic endif HOST_FPIC:=-fPIC ARCH_SUFFIX:=$(call qstrip,$(CONFIG_CPU_TYPE)) GCC_ARCH:= ifneq ($(ARCH_SUFFIX),) ARCH_SUFFIX:=_$(ARCH_SUFFIX) endif ifneq ($(filter -march=armv%,$(TARGET_OPTIMIZATION)),) GCC_ARCH:=$(patsubst -march=%,%,$(filter -march=armv%,$(TARGET_OPTIMIZATION))) endif ifdef CONFIG_HAS_SPE_FPU TARGET_SUFFIX:=$(TARGET_SUFFIX)spe endif ifdef CONFIG_MIPS64_ABI ifneq ($(CONFIG_MIPS64_ABI_O32),y) ARCH_SUFFIX:=$(ARCH_SUFFIX)_$(call qstrip,$(CONFIG_MIPS64_ABI)) endif endif DL_DIR:=$(if $(call qstrip,$(CONFIG_DOWNLOAD_FOLDER)),$(call qstrip,$(CONFIG_DOWNLOAD_FOLDER)),$(TOPDIR)/dl) BIN_DIR:=$(if $(call qstrip,$(CONFIG_BINARY_FOLDER)),$(call qstrip,$(CONFIG_BINARY_FOLDER)),$(TOPDIR)/bin/$(BOARD)) INCLUDE_DIR:=$(TOPDIR)/include SCRIPT_DIR:=$(TOPDIR)/scripts BUILD_DIR_BASE:=$(TOPDIR)/build_dir BUILD_DIR_HOST:=$(BUILD_DIR_BASE)/host STAGING_DIR_HOST:=$(TOPDIR)/staging_dir/host ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) GCCV:=$(call qstrip,$(CONFIG_GCC_VERSION)) LIBC:=$(call qstrip,$(CONFIG_LIBC)) LIBCV:=$(call qstrip,$(CONFIG_LIBC_VERSION)) REAL_GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-openwrt-linux$(if $(TARGET_SUFFIX),-$(TARGET_SUFFIX)) GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-openwrt-linux DIR_SUFFIX:=_$(LIBC)-$(LIBCV)$(if $(CONFIG_arm),_eabi) BIN_DIR:=$(BIN_DIR)$(if $(CONFIG_USE_UCLIBC),,-$(LIBC)) TARGET_DIR_NAME = target-$(ARCH)$(ARCH_SUFFIX)$(DIR_SUFFIX)$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX)) TOOLCHAIN_DIR_NAME = toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)$(DIR_SUFFIX) else ifeq ($(CONFIG_NATIVE_TOOLCHAIN),) GNU_TARGET_NAME=$(call qstrip,$(CONFIG_TARGET_NAME)) else GNU_TARGET_NAME=$(shell gcc -dumpmachine) endif REAL_GNU_TARGET_NAME=$(GNU_TARGET_NAME) TARGET_DIR_NAME:=target-$(GNU_TARGET_NAME)$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX)) TOOLCHAIN_DIR_NAME:=toolchain-$(GNU_TARGET_NAME) endif PACKAGE_DIR:=$(BIN_DIR)/packages BUILD_DIR:=$(BUILD_DIR_BASE)/$(TARGET_DIR_NAME) STAGING_DIR:=$(TOPDIR)/staging_dir/$(TARGET_DIR_NAME) BUILD_DIR_TOOLCHAIN:=$(BUILD_DIR_BASE)/$(TOOLCHAIN_DIR_NAME) TOOLCHAIN_DIR:=$(TOPDIR)/staging_dir/$(TOOLCHAIN_DIR_NAME) STAMP_DIR:=$(BUILD_DIR)/stamp STAMP_DIR_HOST=$(BUILD_DIR_HOST)/stamp TARGET_ROOTFS_DIR?=$(if $(call qstrip,$(CONFIG_TARGET_ROOTFS_DIR)),$(call qstrip,$(CONFIG_TARGET_ROOTFS_DIR)),$(BUILD_DIR)) TARGET_DIR:=$(TARGET_ROOTFS_DIR)/root-$(BOARD) STAGING_DIR_ROOT:=$(STAGING_DIR)/root-$(BOARD) BUILD_LOG_DIR:=$(TOPDIR)/logs PKG_INFO_DIR := $(STAGING_DIR)/pkginfo TARGET_PATH:=$(STAGING_DIR_HOST)/bin:$(subst $(space),:,$(filter-out .,$(filter-out ./,$(subst :,$(space),$(PATH))))) TARGET_CFLAGS:=$(TARGET_OPTIMIZATION)$(if $(CONFIG_DEBUG), -g3) $(EXTRA_OPTIMIZATION) TARGET_CXXFLAGS = $(TARGET_CFLAGS) TARGET_ASFLAGS_DEFAULT = $(TARGET_CFLAGS) TARGET_ASFLAGS = $(TARGET_ASFLAGS_DEFAULT) TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include TARGET_LDFLAGS:=-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib ifneq ($(CONFIG_EXTERNAL_TOOLCHAIN),) LIBGCC_S_PATH=$(realpath $(wildcard $(call qstrip,$(CONFIG_LIBGCC_ROOT_DIR))/$(call qstrip,$(CONFIG_LIBGCC_FILE_SPEC)))) LIBGCC_S=$(if $(LIBGCC_S_PATH),-L$(dir $(LIBGCC_S_PATH)) -lgcc_s) LIBGCC_A=$(realpath $(lastword $(wildcard $(dir $(LIBGCC_S_PATH))/gcc/*/*/libgcc.a))) else LIBGCC_A=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.a)) LIBGCC_S=$(if $(wildcard $(TOOLCHAIN_DIR)/lib/libgcc_s.so),-L$(TOOLCHAIN_DIR)/lib -lgcc_s,$(LIBGCC_A)) endif LIBRPC=-lrpc LIBRPC_DEPENDS=+librpc ifeq ($(CONFIG_ARCH_64BIT),y) LIB_SUFFIX:=64 endif ifndef DUMP ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) -include $(TOOLCHAIN_DIR)/info.mk export GCC_HONOUR_COPTS:=0 TARGET_CROSS:=$(if $(TARGET_CROSS),$(TARGET_CROSS),$(OPTIMIZE_FOR_CPU)-openwrt-linux$(if $(TARGET_SUFFIX),-$(TARGET_SUFFIX))-) TARGET_CFLAGS+= -fhonour-copts $(if $(CONFIG_GCC_VERSION_4_4)$(CONFIG_GCC_VERSION_4_5),,-Wno-error=unused-but-set-variable) TARGET_CPPFLAGS+= -I$(TOOLCHAIN_DIR)/usr/include -I$(TOOLCHAIN_DIR)/include TARGET_LDFLAGS+= -L$(TOOLCHAIN_DIR)/usr/lib -L$(TOOLCHAIN_DIR)/lib TARGET_PATH:=$(TOOLCHAIN_DIR)/bin:$(TARGET_PATH) else ifeq ($(CONFIG_NATIVE_TOOLCHAIN),) TARGET_CROSS:=$(call qstrip,$(CONFIG_TOOLCHAIN_PREFIX)) TOOLCHAIN_ROOT_DIR:=$(call qstrip,$(CONFIG
#
# Copyright (C) 2013-2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=kobs-ng
PKG_VERSION:=5.4
PKG_RELEASE:=1

PKG_SOURCE:=imx-kobs-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.freescale.com/lgfiles/NMG/MAD/YOCTO/
PKG_MD5SUM:=77467d834f858c2ec216841583e5f437
PKG_BUILD_DIR:=$(BUILD_DIR)/imx-kobs-$(PKG_VERSION)

PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=COPYING

include $(INCLUDE_DIR)/package.mk

define Package/kobs-ng
  SECTION:=utils
  CATEGORY:=Utilities
  TITLE:=Application for writing bootstreams to NAND flash
  DEPENDS:=@TARGET_imx6
endef

define Package/kobs-ng/description
 The kobs-ng application writes a bootstream to NAND flash with the proper
 FCB/DBBT headers and replicated streams.
endef

define Build/Prepare
	$(call Build/Prepare/Default)
	echo "const char* git_sha = \"$(PKG_VERSION)\";" > $(PKG_BUILD_DIR)/autoversion.h
endef

define Package/kobs-ng/install
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/kobs-ng $(1)/usr/sbin/
endef

$(eval $(call BuildPackage,kobs-ng))