buildrootschalter/package/dtc/dtc.mk
Yann E. MORIN 257e1f4f43 package/dtc: add option to install programs
By default, we only install the libfdt library.

As suggested by Arnout, add an option that also
installs the few dtc programs.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-05-12 23:49:04 +02:00

57 lines
1.5 KiB
Makefile
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#############################################################
#
# dtc
#
#############################################################
DTC_VERSION = e4b497f367a3b2ae99cc52089a14a221b13a76ef
DTC_SITE = git://git.jdl.com/software/dtc.git
DTC_LICENSE = GPLv2+/BSD-2c
DTC_LICENSE_FILES = README.license GPL
DTC_INSTALL_STAGING = YES
define DTC_POST_INSTALL_TARGET_RM_DTDIFF
rm -f $(TARGET_DIR)/usr/bin/dtdiff
endef
ifeq ($(BR2_PACKAGE_DTC_PROGRAMS),y)
DTC_LICENSE += (for the library), GPLv2+ (for the executables)
# Use default goal to build everything
DTC_BUILD_GOAL =
DTC_INSTALL_GOAL = install
DTC_CLEAN_GOAL = clean
ifeq ($(BR2_PACKAGE_BASH),)
DTC_POST_INSTALL_TARGET_HOOKS += DTC_POST_INSTALL_TARGET_RM_DTDIFF
endif
else # $(BR2_PACKAGE_DTC_PROGRAMS) != y
DTC_BUILD_GOAL = libfdt
# libfdt_install is our own install rule added by our patch
DTC_INSTALL_GOAL = libfdt_install
DTC_CLEAN_GOAL = libfdt_clean
endif # $(BR2_PACKAGE_DTC_PROGRAMS) != y
define DTC_BUILD_CMDS
$(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS)" \
$(MAKE) -C $(@D) PREFIX=/usr $(DTC_BUILD_GOAL)
endef
# For staging, only the library is needed
define DTC_INSTALL_STAGING_CMDS
$(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) PREFIX=/usr libfdt_install
endef
define DTC_INSTALL_TARGET_CMDS
$(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) PREFIX=/usr $(DTC_INSTALL_GOAL)
endef
define DTC_CLEAN_CMDS
$(MAKE) -C $(@D) $(DTC_CLEAN_GOAL)
endef
$(eval $(generic-package))