2
0

package-bin.mk 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #
  2. # Copyright (C) 2007-2014 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. ifeq ($(DUMP),)
  8. define BuildTarget/bin
  9. ifeq ($(if $(VARIANT),$(BUILD_VARIANT)),$(VARIANT))
  10. ifdef Package/$(1)/install
  11. ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
  12. $(_pkg_target)compile: $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
  13. compile: install-bin-$(1)
  14. else
  15. compile: $(1)-disabled
  16. $(1)-disabled:
  17. @echo "WARNING: skipping $(1) -- package not selected" >&2
  18. endif
  19. endif
  20. endif
  21. $(PKG_BUILD_DIR)/.pkgdir/$(1).installed: $(STAMP_BUILT)
  22. rm -rf $(PKG_BUILD_DIR)/.pkgdir/$(1) $$@
  23. mkdir -p $(PKG_BUILD_DIR)/.pkgdir/$(1)
  24. $(call Package/$(1)/install,$(PKG_BUILD_DIR)/.pkgdir/$(1))
  25. touch $$@
  26. install-bin-$(1): $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
  27. rm -rf $(BIN_DIR)/$(1)
  28. -rmdir $(PKG_BUILD_DIR)/.pkgdir/$(1) >/dev/null 2>/dev/null
  29. if [ -d $(PKG_BUILD_DIR)/.pkgdir/$(1) ]; then \
  30. $(INSTALL_DIR) $(BIN_DIR)/$(1) && \
  31. $(CP) $(PKG_BUILD_DIR)/.pkgdir/$(1)/. $(BIN_DIR)/$(1)/; \
  32. fi
  33. clean-$(1):
  34. rm -rf $(BIN_DIR)/$(1)
  35. clean: clean-$(1)
  36. .PHONY: install-bin-$(1)
  37. endef
  38. endif