build: use directory name instead of PKG_NAME for staging files and package metadata
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48110
This commit is contained in:
parent
e14d2aee0a
commit
b1986d8fd6
1 changed files with 14 additions and 14 deletions
|
@ -49,6 +49,7 @@ find_library_dependencies = $(wildcard $(patsubst %,$(STAGING_DIR)/pkginfo/%.ver
|
||||||
) \
|
) \
|
||||||
))))
|
))))
|
||||||
|
|
||||||
|
PKG_DIR_NAME:=$(lastword $(subst /,$(space),$(CURDIR)))
|
||||||
STAMP_NO_AUTOREBUILD=$(wildcard $(PKG_BUILD_DIR)/.no_autorebuild)
|
STAMP_NO_AUTOREBUILD=$(wildcard $(PKG_BUILD_DIR)/.no_autorebuild)
|
||||||
PREV_STAMP_PREPARED:=$(if $(STAMP_NO_AUTOREBUILD),$(wildcard $(PKG_BUILD_DIR)/.prepared*))
|
PREV_STAMP_PREPARED:=$(if $(STAMP_NO_AUTOREBUILD),$(wildcard $(PKG_BUILD_DIR)/.prepared*))
|
||||||
ifneq ($(PREV_STAMP_PREPARED),)
|
ifneq ($(PREV_STAMP_PREPARED),)
|
||||||
|
@ -60,9 +61,9 @@ endif
|
||||||
STAMP_CONFIGURED=$(PKG_BUILD_DIR)/.configured$(if $(DUMP),,_$(call confvar,$(PKG_CONFIG_DEPENDS)))
|
STAMP_CONFIGURED=$(PKG_BUILD_DIR)/.configured$(if $(DUMP),,_$(call confvar,$(PKG_CONFIG_DEPENDS)))
|
||||||
STAMP_CONFIGURED_WILDCARD=$(patsubst %_$(call confvar,$(PKG_CONFIG_DEPENDS)),%_*,$(STAMP_CONFIGURED))
|
STAMP_CONFIGURED_WILDCARD=$(patsubst %_$(call confvar,$(PKG_CONFIG_DEPENDS)),%_*,$(STAMP_CONFIGURED))
|
||||||
STAMP_BUILT:=$(PKG_BUILD_DIR)/.built
|
STAMP_BUILT:=$(PKG_BUILD_DIR)/.built
|
||||||
STAMP_INSTALLED:=$(STAGING_DIR)/stamp/.$(PKG_NAME)$(if $(BUILD_VARIANT),.$(BUILD_VARIANT),)_installed
|
STAMP_INSTALLED:=$(STAGING_DIR)/stamp/.$(PKG_DIR_NAME)$(if $(BUILD_VARIANT),.$(BUILD_VARIANT),)_installed
|
||||||
|
|
||||||
STAGING_FILES_LIST:=$(PKG_NAME)$(if $(BUILD_VARIANT),.$(BUILD_VARIANT),).list
|
STAGING_FILES_LIST:=$(PKG_DIR_NAME)$(if $(BUILD_VARIANT),.$(BUILD_VARIANT),).list
|
||||||
|
|
||||||
define CleanStaging
|
define CleanStaging
|
||||||
rm -f $(STAMP_INSTALLED)
|
rm -f $(STAMP_INSTALLED)
|
||||||
|
@ -85,7 +86,6 @@ ifneq ($(wildcard $(PKG_BUILD_DIR)/.source_dir),)
|
||||||
QUILT:=1
|
QUILT:=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
PKG_DIR_NAME:=$(lastword $(subst /,$(space),$(CURDIR)))
|
|
||||||
PKG_INSTALL_STAMP:=$(PKG_INFO_DIR)/$(PKG_DIR_NAME).$(if $(BUILD_VARIANT),$(BUILD_VARIANT),default).install
|
PKG_INSTALL_STAMP:=$(PKG_INFO_DIR)/$(PKG_DIR_NAME).$(if $(BUILD_VARIANT),$(BUILD_VARIANT),default).install
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/download.mk
|
include $(INCLUDE_DIR)/download.mk
|
||||||
|
@ -190,28 +190,28 @@ define Build/DefaultTargets
|
||||||
|
|
||||||
$(STAMP_INSTALLED) : export PATH=$$(TARGET_PATH_PKG)
|
$(STAMP_INSTALLED) : export PATH=$$(TARGET_PATH_PKG)
|
||||||
$(STAMP_INSTALLED): $(STAMP_BUILT)
|
$(STAMP_INSTALLED): $(STAMP_BUILT)
|
||||||
rm -rf $(TMP_DIR)/stage-$(PKG_NAME)
|
rm -rf $(TMP_DIR)/stage-$(PKG_DIR_NAME)
|
||||||
mkdir -p $(TMP_DIR)/stage-$(PKG_NAME)/host $(STAGING_DIR)/packages $(STAGING_DIR_HOST)/packages
|
mkdir -p $(TMP_DIR)/stage-$(PKG_DIR_NAME)/host $(STAGING_DIR)/packages $(STAGING_DIR_HOST)/packages
|
||||||
$(foreach hook,$(Hooks/InstallDev/Pre),\
|
$(foreach hook,$(Hooks/InstallDev/Pre),\
|
||||||
$(call $(hook),$(TMP_DIR)/stage-$(PKG_NAME),$(TMP_DIR)/stage-$(PKG_NAME)/host)$(sep)\
|
$(call $(hook),$(TMP_DIR)/stage-$(PKG_DIR_NAME),$(TMP_DIR)/stage-$(PKG_DIR_NAME)/host)$(sep)\
|
||||||
)
|
)
|
||||||
$(call Build/InstallDev,$(TMP_DIR)/stage-$(PKG_NAME),$(TMP_DIR)/stage-$(PKG_NAME)/host)
|
$(call Build/InstallDev,$(TMP_DIR)/stage-$(PKG_DIR_NAME),$(TMP_DIR)/stage-$(PKG_DIR_NAME)/host)
|
||||||
$(foreach hook,$(Hooks/InstallDev/Post),\
|
$(foreach hook,$(Hooks/InstallDev/Post),\
|
||||||
$(call $(hook),$(TMP_DIR)/stage-$(PKG_NAME),$(TMP_DIR)/stage-$(PKG_NAME)/host)$(sep)\
|
$(call $(hook),$(TMP_DIR)/stage-$(PKG_DIR_NAME),$(TMP_DIR)/stage-$(PKG_DIR_NAME)/host)$(sep)\
|
||||||
)
|
)
|
||||||
if [ -f $(STAGING_DIR)/packages/$(STAGING_FILES_LIST) ]; then \
|
if [ -f $(STAGING_DIR)/packages/$(STAGING_FILES_LIST) ]; then \
|
||||||
$(SCRIPT_DIR)/clean-package.sh \
|
$(SCRIPT_DIR)/clean-package.sh \
|
||||||
"$(STAGING_DIR)/packages/$(STAGING_FILES_LIST)" \
|
"$(STAGING_DIR)/packages/$(STAGING_FILES_LIST)" \
|
||||||
"$(STAGING_DIR)"; \
|
"$(STAGING_DIR)"; \
|
||||||
fi
|
fi
|
||||||
if [ -d $(TMP_DIR)/stage-$(PKG_NAME) ]; then \
|
if [ -d $(TMP_DIR)/stage-$(PKG_DIR_NAME) ]; then \
|
||||||
(cd $(TMP_DIR)/stage-$(PKG_NAME); find ./ > $(TMP_DIR)/stage-$(PKG_NAME).files); \
|
(cd $(TMP_DIR)/stage-$(PKG_DIR_NAME); find ./ > $(TMP_DIR)/stage-$(PKG_DIR_NAME).files); \
|
||||||
$(call locked, \
|
$(call locked, \
|
||||||
mv $(TMP_DIR)/stage-$(PKG_NAME).files $(STAGING_DIR)/packages/$(STAGING_FILES_LIST) && \
|
mv $(TMP_DIR)/stage-$(PKG_DIR_NAME).files $(STAGING_DIR)/packages/$(STAGING_FILES_LIST) && \
|
||||||
$(CP) $(TMP_DIR)/stage-$(PKG_NAME)/* $(STAGING_DIR)/; \
|
$(CP) $(TMP_DIR)/stage-$(PKG_DIR_NAME)/* $(STAGING_DIR)/; \
|
||||||
,staging-dir); \
|
,staging-dir); \
|
||||||
fi
|
fi
|
||||||
rm -rf $(TMP_DIR)/stage-$(PKG_NAME)
|
rm -rf $(TMP_DIR)/stage-$(PKG_DIR_NAME)
|
||||||
touch $$@
|
touch $$@
|
||||||
|
|
||||||
ifdef Build/InstallDev
|
ifdef Build/InstallDev
|
||||||
|
@ -228,7 +228,7 @@ define Build/DefaultTargets
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/IncludeOverlay
|
define Build/IncludeOverlay
|
||||||
$(eval -include $(wildcard $(TOPDIR)/overlay/*/$(PKG_NAME).mk))
|
$(eval -include $(wildcard $(TOPDIR)/overlay/*/$(PKG_DIR_NAME).mk))
|
||||||
define Build/IncludeOverlay
|
define Build/IncludeOverlay
|
||||||
endef
|
endef
|
||||||
endef
|
endef
|
||||||
|
|
Loading…
Reference in a new issue