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