2020-09-22 02:48:37 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2015-03-29 07:29:18 +00:00
|
|
|
#
|
2020-09-22 02:48:37 +00:00
|
|
|
# Copyright (C) 2007-2020 OpenWrt.org
|
2007-09-29 01:21:56 +00:00
|
|
|
|
|
|
|
ifeq ($(DUMP),)
|
|
|
|
define BuildTarget/bin
|
2021-11-03 18:51:32 +00:00
|
|
|
TARGET_VARIANT=$(if $(ALL_VARIANTS),$(if $(VARIANT),$(filter-out *,$(VARIANT)),$(firstword $(ALL_VARIANTS))))
|
2021-10-22 19:12:10 +00:00
|
|
|
ifeq ($(if $(TARGET_VARIANT),$(BUILD_VARIANT)),$(TARGET_VARIANT))
|
2007-09-29 01:21:56 +00:00
|
|
|
ifdef Package/$(1)/install
|
2014-07-02 11:39:28 +00:00
|
|
|
ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
|
2017-01-19 11:41:59 +00:00
|
|
|
$(_pkg_target)compile: $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
|
2007-09-29 01:21:56 +00:00
|
|
|
compile: install-bin-$(1)
|
|
|
|
else
|
|
|
|
compile: $(1)-disabled
|
|
|
|
$(1)-disabled:
|
2013-02-21 11:45:18 +00:00
|
|
|
@echo "WARNING: skipping $(1) -- package not selected" >&2
|
2007-09-29 01:21:56 +00:00
|
|
|
endif
|
|
|
|
endif
|
2010-05-15 15:57:00 +00:00
|
|
|
endif
|
2007-09-29 01:21:56 +00:00
|
|
|
|
2017-01-18 19:38:36 +00:00
|
|
|
$(PKG_BUILD_DIR)/.pkgdir/$(1).installed: $(STAMP_BUILT)
|
|
|
|
rm -rf $(PKG_BUILD_DIR)/.pkgdir/$(1) $$@
|
|
|
|
mkdir -p $(PKG_BUILD_DIR)/.pkgdir/$(1)
|
|
|
|
$(call Package/$(1)/install,$(PKG_BUILD_DIR)/.pkgdir/$(1))
|
|
|
|
touch $$@
|
|
|
|
|
|
|
|
install-bin-$(1): $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
|
2017-01-23 11:32:04 +00:00
|
|
|
rm -rf $(BIN_DIR)/$(1)
|
|
|
|
-rmdir $(PKG_BUILD_DIR)/.pkgdir/$(1) >/dev/null 2>/dev/null
|
2017-01-23 12:40:15 +00:00
|
|
|
if [ -d $(PKG_BUILD_DIR)/.pkgdir/$(1) ]; then \
|
2017-01-23 11:32:04 +00:00
|
|
|
$(INSTALL_DIR) $(BIN_DIR)/$(1) && \
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/.pkgdir/$(1)/. $(BIN_DIR)/$(1)/; \
|
2017-01-23 12:40:15 +00:00
|
|
|
fi
|
2007-09-29 01:21:56 +00:00
|
|
|
|
|
|
|
clean-$(1):
|
|
|
|
rm -rf $(BIN_DIR)/$(1)
|
|
|
|
|
|
|
|
clean: clean-$(1)
|
|
|
|
.PHONY: install-bin-$(1)
|
|
|
|
endef
|
|
|
|
endif
|