aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2017-01-23 12:32:04 +0100
committerFelix Fietkau <nbd@nbd.name>2017-01-23 12:41:49 +0100
commitfb07085218859e0afe033d8a32ac2618303911ff (patch)
treeeaf799c86ae56e9513af7116b1a70a8b82741dff
parentafd2827c5c51361175d2e2ac9888d5ed59db5175 (diff)
downloadupstream-fb07085218859e0afe033d8a32ac2618303911ff.tar.gz
upstream-fb07085218859e0afe033d8a32ac2618303911ff.tar.bz2
upstream-fb07085218859e0afe033d8a32ac2618303911ff.zip
build: fix bin/ package empty check
$(wildcard) is evaluated too early in the build process Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--include/package-bin.mk10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/package-bin.mk b/include/package-bin.mk
index 3d0baad228..68f5831340 100644
--- a/include/package-bin.mk
+++ b/include/package-bin.mk
@@ -27,10 +27,12 @@ ifeq ($(DUMP),)
touch $$@
install-bin-$(1): $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
- rm -rf $(BIN_DIR)/$(1)
- $(if $(wildcard $(PKG_BUILD_DIR)/.pkgdir/$(1)/*), \
- $(INSTALL_DIR) $(BIN_DIR)/$(1) && $(CP) $(PKG_BUILD_DIR)/.pkgdir/$(1)/. $(BIN_DIR)/$(1)/ \
- )
+ rm -rf $(BIN_DIR)/$(1)
+ -rmdir $(PKG_BUILD_DIR)/.pkgdir/$(1) >/dev/null 2>/dev/null
+ [ -d $(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)