xref: /OK3568_Linux_fs/buildroot/package/freescale-imx/freescale-imx.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun################################################################################
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# freescale-imx
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun################################################################################
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunFREESCALE_IMX_SITE = http://www.nxp.com/lgfiles/NMG/MAD/YOCTO
8*4882a593Smuzhiyun
9*4882a593Smuzhiyun# Helper for self-extracting binaries distributed by Freescale.
10*4882a593Smuzhiyun#
11*4882a593Smuzhiyun# The --force option makes sure it doesn't fail if the source
12*4882a593Smuzhiyun# directory already exists. The --auto-accept skips the license check,
13*4882a593Smuzhiyun# as it is not needed in Buildroot because we have legal-info. Since
14*4882a593Smuzhiyun# there's a EULA in the binary file, we extract it in this macro, and
15*4882a593Smuzhiyun# it should therefore be added to the LICENSE_FILES variable of
16*4882a593Smuzhiyun# packages using this macro. Also, remember to set REDISTRIBUTE to
17*4882a593Smuzhiyun# "NO". Indeed, this is a legal minefield: the EULA specifies that the
18*4882a593Smuzhiyun# Board Support Package includes software and hardware (sic!) for
19*4882a593Smuzhiyun# which a separate license is needed...
20*4882a593Smuzhiyun#
21*4882a593Smuzhiyun# $(1): full path to the archive file
22*4882a593Smuzhiyun#
23*4882a593Smuzhiyundefine FREESCALE_IMX_EXTRACT_HELPER
24*4882a593Smuzhiyun	awk 'BEGIN      { start = 0; } \
25*4882a593Smuzhiyun	     /^EOEULA/  { start = 0; } \
26*4882a593Smuzhiyun	                { if (start) print; } \
27*4882a593Smuzhiyun	     /<<EOEULA/ { start = 1; }' \
28*4882a593Smuzhiyun	    $(1) > $(@D)/EULA
29*4882a593Smuzhiyun	cd $(@D) && sh $(1) --force --auto-accept
30*4882a593Smuzhiyun	find $(@D)/$(basename $(notdir $(1))) -mindepth 1 -maxdepth 1 -exec mv {} $(@D) \;
31*4882a593Smuzhiyun	rmdir $(@D)/$(basename $(notdir $(1)))
32*4882a593Smuzhiyunendef
33*4882a593Smuzhiyun
34*4882a593Smuzhiyuninclude $(sort $(wildcard package/freescale-imx/*/*.mk))
35