summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--package/nbd/nbd.mk16
1 files changed, 10 insertions, 6 deletions
diff --git a/package/nbd/nbd.mk b/package/nbd/nbd.mk
index fa8dd4f30..a09b10b74 100644
--- a/package/nbd/nbd.mk
+++ b/package/nbd/nbd.mk
@@ -10,13 +10,17 @@ NBD_SITE=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/nbd/
NBD_CONF_OPT = $(if $(BR2_LARGEFILE),--enable-lfs,--disable-lfs)
NBD_DEPENDENCIES = libglib2
-$(eval $(call AUTOTARGETS,package,nbd))
-
-$(NBD_HOOK_POST_INSTALL): $(NBD_TARGET_INSTALL_TARGET)
ifneq ($(BR2_NBD_CLIENT),y)
- rm -f $(TARGET_DIR)/usr/sbin/nbd-client
+ NBD_TOREMOVE += nbd-client
endif
ifneq ($(BR2_NBD_SERVER),y)
- rm -f $(TARGET_DIR)/usr/bin/nbd-server
+ NBD_TOREMOVE += nbd-server
endif
- touch $@
+
+define NBD_CLEANUP_AFTER_INSTALL
+ rm -f $(addprefix $(TARGET_DIR)/usr/sbin/, $(NBD_TOREMOVE))
+endef
+
+NBD_POST_INSTALL_TARGET_HOOKS += NBD_CLEANUP_AFTER_INSTALL
+
+$(eval $(call AUTOTARGETS,package,nbd))