xref: /OK3568_Linux_fs/buildroot/boot/at91bootstrap3/at91bootstrap3.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun################################################################################
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# at91bootstrap3
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun################################################################################
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunAT91BOOTSTRAP3_VERSION = $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_VERSION))
8*4882a593Smuzhiyun
9*4882a593Smuzhiyunifeq ($(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL),y)
10*4882a593SmuzhiyunAT91BOOTSTRAP3_TARBALL = $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL_LOCATION))
11*4882a593SmuzhiyunAT91BOOTSTRAP3_SITE = $(patsubst %/,%,$(dir $(AT91BOOTSTRAP3_TARBALL)))
12*4882a593SmuzhiyunAT91BOOTSTRAP3_SOURCE = $(notdir $(AT91BOOTSTRAP3_TARBALL))
13*4882a593SmuzhiyunBR_NO_CHECK_HASH_FOR += $(AT91BOOTSTRAP3_SOURCE)
14*4882a593Smuzhiyunelse ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_GIT),y)
15*4882a593SmuzhiyunAT91BOOTSTRAP3_SITE = $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_URL))
16*4882a593SmuzhiyunAT91BOOTSTRAP3_SITE_METHOD = git
17*4882a593SmuzhiyunBR_NO_CHECK_HASH_FOR += $(AT91BOOTSTRAP3_SOURCE)
18*4882a593Smuzhiyunelse
19*4882a593SmuzhiyunAT91BOOTSTRAP3_SITE = $(call github,linux4sam,at91bootstrap,$(AT91BOOTSTRAP3_VERSION))
20*4882a593Smuzhiyunendif
21*4882a593Smuzhiyun
22*4882a593Smuzhiyunifeq ($(BR2_TARGET_AT91BOOTSTRAP3_LATEST_VERSION),y)
23*4882a593SmuzhiyunAT91BOOTSTRAP3_LICENSE = MIT
24*4882a593SmuzhiyunAT91BOOTSTRAP3_LICENSE_FILES = LICENSES/MIT.txt
25*4882a593Smuzhiyunelse ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_LATEST_VERSION_3X),y)
26*4882a593SmuzhiyunAT91BOOTSTRAP3_LICENSE = Atmel License
27*4882a593Smuzhiyunendif
28*4882a593Smuzhiyun
29*4882a593SmuzhiyunAT91BOOTSTRAP3_CPE_ID_VENDOR = linux4sam
30*4882a593SmuzhiyunAT91BOOTSTRAP3_CPE_ID_PRODUCT = at91bootstrap
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunAT91BOOTSTRAP3_INSTALL_IMAGES = YES
33*4882a593SmuzhiyunAT91BOOTSTRAP3_INSTALL_TARGET = NO
34*4882a593Smuzhiyun
35*4882a593Smuzhiyunifeq ($(BR2_TARGET_AT91BOOTSTRAP3_NEEDS_PYTHON3),y)
36*4882a593SmuzhiyunAT91BOOTSTRAP3_DEPENDENCIES += host-python3
37*4882a593Smuzhiyunendif
38*4882a593Smuzhiyun
39*4882a593SmuzhiyunAT91BOOTSTRAP3_CUSTOM_PATCH_DIR = \
40*4882a593Smuzhiyun	$(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_PATCH_DIR))
41*4882a593Smuzhiyun
42*4882a593SmuzhiyunAT91BOOTSTRAP3_MAKE_OPTS = CROSS_COMPILE=$(TARGET_CROSS) DESTDIR=$(BINARIES_DIR)
43*4882a593Smuzhiyun
44*4882a593Smuzhiyunifneq ($(AT91BOOTSTRAP3_CUSTOM_PATCH_DIR),)
45*4882a593Smuzhiyundefine AT91BOOTSTRAP3_APPLY_CUSTOM_PATCHES
46*4882a593Smuzhiyun	$(APPLY_PATCHES) $(@D) $(AT91BOOTSTRAP3_CUSTOM_PATCH_DIR) \*.patch
47*4882a593Smuzhiyunendef
48*4882a593Smuzhiyun
49*4882a593SmuzhiyunAT91BOOTSTRAP3_POST_PATCH_HOOKS += AT91BOOTSTRAP3_APPLY_CUSTOM_PATCHES
50*4882a593Smuzhiyunendif
51*4882a593Smuzhiyun
52*4882a593Smuzhiyundefine AT91BOOTSTRAP3_BUILD_CMDS
53*4882a593Smuzhiyun	$(MAKE) $(AT91BOOTSTRAP3_MAKE_OPTS) -C $(@D)
54*4882a593Smuzhiyunendef
55*4882a593Smuzhiyun
56*4882a593Smuzhiyundefine AT91BOOTSTRAP3_INSTALL_IMAGES_CMDS
57*4882a593Smuzhiyun	cp $(wildcard $(@D)/build/binaries/*.bin $(@D)/binaries/*.bin) $(BINARIES_DIR)
58*4882a593Smuzhiyunendef
59*4882a593Smuzhiyun
60*4882a593Smuzhiyunifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG),y)
61*4882a593SmuzhiyunAT91BOOTSTRAP3_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG))_defconfig
62*4882a593Smuzhiyunelse ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG),y)
63*4882a593SmuzhiyunAT91BOOTSTRAP3_KCONFIG_FILE = $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE))
64*4882a593Smuzhiyunendif
65*4882a593Smuzhiyun
66*4882a593SmuzhiyunAT91BOOTSTRAP3_KCONFIG_EDITORS = menuconfig xconfig gconfig
67*4882a593SmuzhiyunAT91BOOTSTRAP3_KCONFIG_OPTS = $(AT91BOOTSTRAP3_MAKE_OPTS)
68*4882a593Smuzhiyun
69*4882a593Smuzhiyun# Checks to give errors that the user can understand
70*4882a593Smuzhiyun# Must be before we call to kconfig-package
71*4882a593Smuzhiyunifeq ($(BR_BUILDING),y)
72*4882a593Smuzhiyun
73*4882a593Smuzhiyunifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG),y)
74*4882a593Smuzhiyun# We must use the user-supplied kconfig value, because
75*4882a593Smuzhiyun# AT91BOOTSTRAP3_KCONFIG_DEFCONFIG will at least contain
76*4882a593Smuzhiyun# the trailing _defconfig
77*4882a593Smuzhiyunifeq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG)),)
78*4882a593Smuzhiyun$(error No at91bootstrap3 defconfig name specified, check your BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG setting)
79*4882a593Smuzhiyunendif
80*4882a593Smuzhiyunendif
81*4882a593Smuzhiyun
82*4882a593Smuzhiyunifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG),y)
83*4882a593Smuzhiyunifeq ($(AT91BOOTSTRAP3_KCONFIG_FILE),)
84*4882a593Smuzhiyun$(error No at91bootstrap3 configuration file specified, check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE setting)
85*4882a593Smuzhiyunendif
86*4882a593Smuzhiyunendif
87*4882a593Smuzhiyun
88*4882a593Smuzhiyunifeq ($(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_GIT),y)
89*4882a593Smuzhiyunifeq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_URL)),)
90*4882a593Smuzhiyun$(error No custom at91bootstrap3 repository URL specified. Check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_URL setting)
91*4882a593Smuzhiyunendif
92*4882a593Smuzhiyunifeq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_VERSION)),)
93*4882a593Smuzhiyun$(error No custom at91bootstrap3 repository version specified. Check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_VERSION setting)
94*4882a593Smuzhiyunendif
95*4882a593Smuzhiyunendif
96*4882a593Smuzhiyun
97*4882a593Smuzhiyunifeq ($(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL),y)
98*4882a593Smuzhiyunifeq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL_LOCATION)),)
99*4882a593Smuzhiyun$(error No custom AT91Bootstrap3 tarball specified. Check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL_LOCATION setting)
100*4882a593Smuzhiyunendif # qstrip BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL_LOCATION
101*4882a593Smuzhiyunendif # BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL
102*4882a593Smuzhiyun
103*4882a593Smuzhiyunendif # BR_BUILDING
104*4882a593Smuzhiyun
105*4882a593Smuzhiyun$(eval $(kconfig-package))
106