From efba32d0f638b7a08410d4ef206e89cd0ff89bda Mon Sep 17 00:00:00 2001 From: Olivier Dufour Date: Thu, 2 May 2013 10:52:41 +0200 Subject: cleo/buildroot/package: create a package for debug-utils, closes #3956 This package is disabled by default, and only available for MSE500 based boards. --- cleopatre/buildroot/package/Config.in | 1 + cleopatre/buildroot/package/debug-utils/Config.in | 7 ++ .../buildroot/package/debug-utils/debug-utils.mk | 92 ++++++++++++++++++++++ .../target/device/Spidcom/common/defconfig.base | 1 + 4 files changed, 101 insertions(+) create mode 100644 cleopatre/buildroot/package/debug-utils/Config.in create mode 100644 cleopatre/buildroot/package/debug-utils/debug-utils.mk (limited to 'cleopatre/buildroot') diff --git a/cleopatre/buildroot/package/Config.in b/cleopatre/buildroot/package/Config.in index 1c5eea8482..afa02f882e 100644 --- a/cleopatre/buildroot/package/Config.in +++ b/cleopatre/buildroot/package/Config.in @@ -233,6 +233,7 @@ source "package/spidapp/Config.in" source "package/plcd/Config.in" source "package/plcdrv/Config.in" source "package/pmd/Config.in" +source "package/debug-utils/Config.in" endif source "package/portmap/Config.in" source "package/pppd/Config.in" diff --git a/cleopatre/buildroot/package/debug-utils/Config.in b/cleopatre/buildroot/package/debug-utils/Config.in new file mode 100644 index 0000000000..da62972d65 --- /dev/null +++ b/cleopatre/buildroot/package/debug-utils/Config.in @@ -0,0 +1,7 @@ +config BR2_PACKAGE_DEBUG_UTILS + depends on BR2_TARGET_SPIDCOM_ARCH_MSE500 + bool "debug-utils" + help + Memroy debug utilities + + http://www.spidcom.com diff --git a/cleopatre/buildroot/package/debug-utils/debug-utils.mk b/cleopatre/buildroot/package/debug-utils/debug-utils.mk new file mode 100644 index 0000000000..355cd05f91 --- /dev/null +++ b/cleopatre/buildroot/package/debug-utils/debug-utils.mk @@ -0,0 +1,92 @@ +############################################################# +# +# debug-utils (Deamon to handle power management). +# +############################################################# +# Copyright (C) 2012 by MStar +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Library General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# 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 +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA +# + +DEBUG_UTILS_VERSION:=0.0.1 +DEBUG_UTILS_SITE:=$(BASE_DIR)/../application/debug-utils +DEBUG_UTILS_NAME:=debug-utils-$(DEBUG_UTILS_VERSION) +DEBUG_UTILS_DIR:=$(BUILD_DIR)/debug-utils-$(DEBUG_UTILS_VERSION) +DEBUG_UTILS_APP_DIR=$(DEBUG_UTILS_DIR)/mem +DEBUG_UTILS_MOD_DIR=$(DEBUG_UTILS_DIR)/debug-drv + +$(DEBUG_UTILS_DIR)/.unpacked: + ln -s $(DEBUG_UTILS_SITE) $(DEBUG_UTILS_DIR) + touch $(DEBUG_UTILS_DIR)/.unpacked + +$(DEBUG_UTILS_DIR)/.configured: $(DEBUG_UTILS_DIR)/.unpacked + touch $(DEBUG_UTILS_DIR)/.configured + +$(DEBUG_UTILS_MOD_DIR)/debugdrv.ko: $(DEBUG_UTILS_DIR)/.configured FORCE_DEBUG_UTILS_MAKE + @$(TARGET_CONFIGURE_OPTS) \ + $(MAKE) -C $(DEBUG_UTILS_MOD_DIR) + +$(DEBUG_UTILS_APP_DIR)/md: $(DEBUG_UTILS_DIR)/.configured FORCE_DEBUG_UTILS_MAKE + @$(TARGET_CONFIGURE_OPTS) \ + $(MAKE) -C $(DEBUG_UTILS_APP_DIR) md + +$(DEBUG_UTILS_APP_DIR)/mw: $(DEBUG_UTILS_DIR)/.configured FORCE_DEBUG_UTILS_MAKE + @$(TARGET_CONFIGURE_OPTS) \ + $(MAKE) -C $(DEBUG_UTILS_APP_DIR) mw + +$(TARGET_DIR)/lib/modules/debugdrv.ko: $(DEBUG_UTILS_MOD_DIR)/debugdrv.ko + mkdir -p $(TARGET_DIR)/lib/modules + cp $< $@ + +$(TARGET_DIR)/usr/bin/md: $(DEBUG_UTILS_APP_DIR)/md + mkdir -p $(TARGET_DIR)/usr/bin + cp $< $@ + +$(TARGET_DIR)/usr/bin/mw: $(DEBUG_UTILS_APP_DIR)/mw + mkdir -p $(TARGET_DIR)/usr/bin + cp $< $@ + +$(TARGET_DIR)/etc/init.d/S90debugdrv: $(DEBUG_UTILS_MOD_DIR)/S90debugdrv + mkdir -p $(TARGET_DIR)/etc/init.d + cp $< $@ + +debug-utils: uclibc $(TARGET_DIR)/usr/bin/md \ + $(TARGET_DIR)/usr/bin/mw \ + $(TARGET_DIR)/etc/init.d/S90debugdrv \ + $(TARGET_DIR)/lib/modules/debugdrv.ko \ + +debug-utils-clean: + rm -f $(TARGET_DIR)/usr/bin/md + rm -f $(TARGET_DIR)/usr/bin/mw + rm -f $(TARGET_DIR)/etc/init.d/S90debugdrv + rm -f $(TARGET_DIR)/lib/modules/debugdrv.ko + -$(MAKE) -C $(DEBUG_UTILS_APP_DIR) clean + -$(MAKE) -C $(DEBUG_UTILS_MOD_DIR) clean + +debug-utils-dirclean: + rm -f $(DEBUG_UTILS_DIR) + +# We declare DEBUG_UTILS_MAKE rule as PHONY to force compilation +.PHONY: FORCE_DEBUG_UTILS_MAKE + +############################################################# +# +# Toplevel Makefile options +# +############################################################# +ifeq ($(strip $(BR2_PACKAGE_DEBUG_UTILS)),y) +TARGETS+=debug-utils +endif diff --git a/cleopatre/buildroot/target/device/Spidcom/common/defconfig.base b/cleopatre/buildroot/target/device/Spidcom/common/defconfig.base index dc744b01d7..68df3e7c9e 100644 --- a/cleopatre/buildroot/target/device/Spidcom/common/defconfig.base +++ b/cleopatre/buildroot/target/device/Spidcom/common/defconfig.base @@ -361,6 +361,7 @@ BR2_PACKAGE_LIBSPID=y BR2_PACKAGE_SPIDAPP=y BR2_PACKAGE_PLCD=y BR2_PACKAGE_PLCDRV=y +BR2_PACKAGE_DEBUG_UTILS=n # # portmap requires a toolchain with 'Enable RPC' selected -- cgit v1.2.3