summaryrefslogtreecommitdiff
path: root/package/bsdiff/bsdiff.mk
diff options
context:
space:
mode:
authorMartin Banky <martin.banky@gmail.com>2010-09-26 00:13:55 -0700
committerPeter Korsgaard <jacmet@sunsite.dk>2010-09-26 21:54:13 +0200
commitd4f1332110075f7c1eca5e333c906cb274f89407 (patch)
tree57321b62557c4055848ffbf46ba538929360d5d1 /package/bsdiff/bsdiff.mk
parent85fac9e0c8bfa2230ecfaa96b765adec62315ca0 (diff)
bsdiff: convert to gentargets
[Peter: cleanup build, install and uninstall targets] Signed-off-by: Martin Banky <Martin.Banky@gmail.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/bsdiff/bsdiff.mk')
-rw-r--r--package/bsdiff/bsdiff.mk75
1 files changed, 26 insertions, 49 deletions
diff --git a/package/bsdiff/bsdiff.mk b/package/bsdiff/bsdiff.mk
index 62608e92a..276c6be1a 100644
--- a/package/bsdiff/bsdiff.mk
+++ b/package/bsdiff/bsdiff.mk
@@ -3,52 +3,29 @@
# bsdiff
#
#############################################################
-BSDIFF_VERSION:=4.3
-BSDIFF_SOURCE:=bsdiff-$(BSDIFF_VERSION).tar.gz
-BSDIFF_SITE:=http://www.daemonology.net/bsdiff
-BSDIFF_DIR:=$(BUILD_DIR)/bsdiff-$(BSDIFF_VERSION)
-BSDIFF_BINARY:=bsdiff
-BSDIFF_TARGET_BINARY:=usr/bin/bsdiff
-BSDIFF_ZCAT=$(ZCAT)
-
-$(DL_DIR)/$(BSDIFF_SOURCE):
- $(call DOWNLOAD,$(BSDIFF_SITE),$(BSDIFF_SOURCE))
-
-$(BSDIFF_DIR)/.source: $(DL_DIR)/$(BSDIFF_SOURCE)
- $(BSDIFF_ZCAT) $(DL_DIR)/$(BSDIFF_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
- touch $(BSDIFF_DIR)/.source
-
-$(BSDIFF_DIR)/$(BSDIFF_BINARY): $(BSDIFF_DIR)/.source
- (cd $(BSDIFF_DIR); \
- $(TARGET_CONFIGURE_ARGS) \
- $(TARGET_CONFIGURE_OPTS) \
- $(TARGET_CC) -L $(STAGING_DIR)/lib -lbz2 \
- $(TARGET_CFLAGS) bsdiff.c -o bsdiff; \
- $(TARGET_CONFIGURE_OPTS) \
- $(TARGET_CC) -L $(STAGING_DIR)/lib -lbz2 \
- $(TARGET_CFLAGS) bspatch.c -o bspatch; \
- )
-
-$(TARGET_DIR)/$(BSDIFF_TARGET_BINARY): $(BSDIFF_DIR)/$(BSDIFF_BINARY)
- cp -dpf $(BSDIFF_DIR)/bsdiff $(TARGET_DIR)/usr/bin/.
- cp -dpf $(BSDIFF_DIR)/bspatch $(TARGET_DIR)/usr/bin/.
-
-bsdiff: bzip2 $(TARGET_DIR)/$(BSDIFF_TARGET_BINARY)
-
-bsdiff-source: $(DL_DIR)/$(BSDIFF_SOURCE)
-
-bsdiff-clean:
- -rm $(TARGET_DIR)/usr/bin/{bsdiff,bspatch}
- -rm $(BSDIFF_DIR)/{bsdiff,bspatch}
-
-bsdiff-dirclean:
- rm -rf $(BSDIFF_DIR)
-
-#############################################################
-#
-# Toplevel Makefile options
-#
-#############################################################
-ifeq ($(BR2_PACKAGE_BSDIFF),y)
-TARGETS+=bsdiff
-endif
+BSDIFF_VERSION = 4.3
+BSDIFF_SOURCE = bsdiff-$(BSDIFF_VERSION).tar.gz
+BSDIFF_SITE = http://www.daemonology.net/bsdiff
+BSDIFF_DEPENDENCIES = bzip2
+
+define BSDIFF_BUILD_CMDS
+ $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) -lbz2 \
+ $(@D)/bsdiff.c -o $(@D)/bsdiff
+ $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) -lbz2 \
+ $(@D)/bspatch.c -o $(@D)/bspatch
+endef
+
+define BSDIFF_INSTALL_TARGET_CMDS
+ install -D -m 755 $(@D)/bsdiff $(TARGET_DIR)/usr/bin/bsdiff
+ install -D -m 755 $(@D)/bspatch $(TARGET_DIR)/usr/bin/bspatch
+endef
+
+define BSDIFF_UNINSTALL_TARGET_CMDS
+ rm -f $(TARGET_DIR)/usr/bin/bsdiff $(TARGET_DIR)/usr/bin/bspatch
+endef
+
+define BSDIFF_CLEAN_CMDS
+ rm -f $(@D)/bsdiff $(@D)/bspatch
+endef
+
+$(eval $(call GENTARGETS,package,bsdiff))