xref: /OK3568_Linux_fs/buildroot/package/skeleton-custom/skeleton-custom.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun################################################################################
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# skeleton-custom
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun################################################################################
6*4882a593Smuzhiyun
7*4882a593Smuzhiyun# The skeleton can't depend on the toolchain, since all packages depends on the
8*4882a593Smuzhiyun# skeleton and the toolchain is a target package, as is skeleton.
9*4882a593Smuzhiyun# Hence, skeleton would depends on the toolchain and the toolchain would depend
10*4882a593Smuzhiyun# on skeleton.
11*4882a593SmuzhiyunSKELETON_CUSTOM_ADD_TOOLCHAIN_DEPENDENCY = NO
12*4882a593SmuzhiyunSKELETON_CUSTOM_ADD_SKELETON_DEPENDENCY = NO
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunSKELETON_CUSTOM_PROVIDES = skeleton
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunSKELETON_CUSTOM_INSTALL_STAGING = YES
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunSKELETON_CUSTOM_PATH = $(call qstrip,$(BR2_ROOTFS_SKELETON_CUSTOM_PATH))
19*4882a593Smuzhiyun
20*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_SKELETON_CUSTOM)$(BR_BUILDING),yy)
21*4882a593Smuzhiyunifeq ($(SKELETON_CUSTOM_PATH),)
22*4882a593Smuzhiyun$(error No path specified for the custom skeleton)
23*4882a593Smuzhiyunendif
24*4882a593Smuzhiyunendif
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun# For a merged /usr, ensure that /lib, /bin and /sbin and their /usr
27*4882a593Smuzhiyun# counterparts are appropriately setup as symlinks ones to the others.
28*4882a593Smuzhiyunifeq ($(BR2_ROOTFS_MERGED_USR),y)
29*4882a593SmuzhiyunSKELETON_CUSTOM_NOT_MERGED_USR_DIRS = \
30*4882a593Smuzhiyun	$(shell support/scripts/check-merged-usr.sh $(SKELETON_CUSTOM_PATH))
31*4882a593Smuzhiyunendif # merged /usr
32*4882a593Smuzhiyun
33*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_SKELETON_CUSTOM)$(BR_BUILDING),yy)
34*4882a593Smuzhiyunifneq ($(SKELETON_CUSTOM_NOT_MERGED_USR_DIRS),)
35*4882a593Smuzhiyun$(error The custom skeleton in $(SKELETON_CUSTOM_PATH) is not \
36*4882a593Smuzhiyun	using a merged /usr for the following directories: \
37*4882a593Smuzhiyun	$(SKELETON_CUSTOM_NOT_MERGED_USR_DIRS))
38*4882a593Smuzhiyunendif
39*4882a593Smuzhiyunendif
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun# The target-dir-warning file and the lib{32,64} symlinks are the only
42*4882a593Smuzhiyun# things we customise in the custom skeleton.
43*4882a593Smuzhiyundefine SKELETON_CUSTOM_INSTALL_TARGET_CMDS
44*4882a593Smuzhiyun	$(call SYSTEM_RSYNC,$(SKELETON_CUSTOM_PATH),$(TARGET_DIR))
45*4882a593Smuzhiyun	$(call SYSTEM_USR_SYMLINKS_OR_DIRS,$(TARGET_DIR))
46*4882a593Smuzhiyun	$(call SYSTEM_LIB_SYMLINK,$(TARGET_DIR))
47*4882a593Smuzhiyun	$(INSTALL) -m 0644 support/misc/target-dir-warning.txt \
48*4882a593Smuzhiyun		$(TARGET_DIR_WARNING_FILE)
49*4882a593Smuzhiyunendef
50*4882a593Smuzhiyun
51*4882a593Smuzhiyun# For the staging dir, we don't really care what we install, but we
52*4882a593Smuzhiyun# need the /lib and /usr/lib appropriately setup. Since we ensure,
53*4882a593Smuzhiyun# above, that they are correct in the skeleton, we can simply copy the
54*4882a593Smuzhiyun# skeleton to staging.
55*4882a593Smuzhiyundefine SKELETON_CUSTOM_INSTALL_STAGING_CMDS
56*4882a593Smuzhiyun	$(call SYSTEM_RSYNC,$(SKELETON_CUSTOM_PATH),$(STAGING_DIR))
57*4882a593Smuzhiyun	$(call SYSTEM_USR_SYMLINKS_OR_DIRS,$(STAGING_DIR))
58*4882a593Smuzhiyun	$(call SYSTEM_LIB_SYMLINK,$(STAGING_DIR))
59*4882a593Smuzhiyunendef
60*4882a593Smuzhiyun
61*4882a593Smuzhiyun$(eval $(generic-package))
62