package-bin.mk 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. .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. $(INSTALL_DIR) $(BIN_DIR)/$(1)
  29. $(CP) $(PKG_BUILD_DIR)/.pkgdir/$(1)/. $(BIN_DIR)/$(1)/
  30. clean-$(1):
  31. rm -rf $(BIN_DIR)/$(1)
  32. clean: clean-$(1)
  33. .PHONY: install-bin-$(1)
  34. endef
  35. endif