e094f7bf782fbca9ceeb689c8e1e18c919de8b02
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / dtc / dtc.mk
1 ################################################################################
2 #
3 # dtc
4 #
5 ################################################################################
6
7 DTC_VERSION = 1.4.1
8 DTC_SOURCE = dtc-$(DTC_VERSION).tar.xz
9 DTC_SITE = https://www.kernel.org/pub/software/utils/dtc
10 DTC_LICENSE = GPLv2+/BSD-2c
11 DTC_LICENSE_FILES = README.license GPL
12 DTC_INSTALL_STAGING = YES
13 DTC_DEPENDENCIES = host-bison host-flex
14
15 define DTC_POST_INSTALL_TARGET_RM_DTDIFF
16         rm -f $(TARGET_DIR)/usr/bin/dtdiff
17 endef
18
19 ifeq ($(BR2_PACKAGE_DTC_PROGRAMS),y)
20
21 DTC_LICENSE += (for the library), GPLv2+ (for the executables)
22 DTC_INSTALL_GOAL = install
23 ifeq ($(BR2_PACKAGE_BASH),)
24 DTC_POST_INSTALL_TARGET_HOOKS += DTC_POST_INSTALL_TARGET_RM_DTDIFF
25 endif
26
27 else # $(BR2_PACKAGE_DTC_PROGRAMS) != y
28
29 DTC_INSTALL_GOAL = install-lib
30
31 endif # $(BR2_PACKAGE_DTC_PROGRAMS) != y
32
33 define DTC_BUILD_CMDS
34         $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) PREFIX=/usr
35 endef
36
37 # For staging, only the library is needed
38 define DTC_INSTALL_STAGING_CMDS
39         $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) PREFIX=/usr install-lib \
40                 install-includes
41 endef
42
43 define DTC_INSTALL_TARGET_CMDS
44         $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) PREFIX=/usr $(DTC_INSTALL_GOAL)
45 endef
46
47 $(eval $(generic-package))