build: do not create empty directories in bin/
authorFelix Fietkau <nbd@nbd.name>
Mon, 23 Jan 2017 09:49:57 +0000 (10:49 +0100)
committerFelix Fietkau <nbd@nbd.name>
Mon, 23 Jan 2017 10:01:56 +0000 (11:01 +0100)
Some packages may not install any files

Signed-off-by: Felix Fietkau <nbd@nbd.name>
include/package-bin.mk

index ee35ca180f021da16ee09d41a967b2efde926bfe..3d0baad2287bf603d39feeb82e4b53187ec6c934 100644 (file)
@@ -28,8 +28,9 @@ ifeq ($(DUMP),)
 
     install-bin-$(1): $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
          rm -rf $(BIN_DIR)/$(1)
-         $(INSTALL_DIR) $(BIN_DIR)/$(1)
-         $(CP) $(PKG_BUILD_DIR)/.pkgdir/$(1)/. $(BIN_DIR)/$(1)/
+         $(if $(wildcard $(PKG_BUILD_DIR)/.pkgdir/$(1)/*), \
+               $(INSTALL_DIR) $(BIN_DIR)/$(1) && $(CP) $(PKG_BUILD_DIR)/.pkgdir/$(1)/. $(BIN_DIR)/$(1)/ \
+         )
 
     clean-$(1):
          rm -rf $(BIN_DIR)/$(1)