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 ee35ca1..3d0baad 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)