build: fix bin/ package empty check

$(wildcard) is evaluated too early in the build process

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2017-01-23 12:32:04 +01:00
parent afd2827c5c
commit fb07085218

View file

@ -27,10 +27,12 @@ ifeq ($(DUMP),)
touch $$@ touch $$@
install-bin-$(1): $(PKG_BUILD_DIR)/.pkgdir/$(1).installed install-bin-$(1): $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
rm -rf $(BIN_DIR)/$(1) rm -rf $(BIN_DIR)/$(1)
$(if $(wildcard $(PKG_BUILD_DIR)/.pkgdir/$(1)/*), \ -rmdir $(PKG_BUILD_DIR)/.pkgdir/$(1) >/dev/null 2>/dev/null
$(INSTALL_DIR) $(BIN_DIR)/$(1) && $(CP) $(PKG_BUILD_DIR)/.pkgdir/$(1)/. $(BIN_DIR)/$(1)/ \ [ -d $(PKG_BUILD_DIR)/.pkgdir/$(1) ] && { \
) $(INSTALL_DIR) $(BIN_DIR)/$(1) && \
$(CP) $(PKG_BUILD_DIR)/.pkgdir/$(1)/. $(BIN_DIR)/$(1)/; \
}
clean-$(1): clean-$(1):
rm -rf $(BIN_DIR)/$(1) rm -rf $(BIN_DIR)/$(1)