bsdiff: Also pass down TARGET_CPPFLAGS
[openwrt/openwrt.git] / package / utils / bsdiff / Makefile
1 #
2 # Copyright (C) 2016 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=bsdiff
11 PKG_VERSION:=4.3
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://www.daemonology.net/bsdiff/
16 PKG_HASH:=18821588b2dc5bf159aa37d3bcb7b885d85ffd1e19f23a0c57a58723fea85f48
17 PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
18 HOST_BUILD_DEPENDS:=bzip2/host
19
20 PKG_LICENSE:=BSD-2-Clause
21
22 include $(INCLUDE_DIR)/host-build.mk
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/bsdiff
26 SECTION:=utils
27 CATEGORY:=Utilities
28 DEPENDS:=+libbz2
29 TITLE:=Binary diff tool
30 URL:=http://www.daemonology.net/bsdiff/
31 endef
32
33 define Package/bspatch
34 SECTION:=utils
35 CATEGORY:=Utilities
36 DEPENDS:=+libbz2
37 TITLE:=Binary patch tool
38 URL:=http://www.daemonology.net/bsdiff/
39 endef
40
41
42 define Build/Compile
43 $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS) \
44 -o $(PKG_BUILD_DIR)/bsdiff \
45 $(PKG_BUILD_DIR)/bsdiff.c -lbz2
46 $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS) \
47 -o $(PKG_BUILD_DIR)/bspatch \
48 $(PKG_BUILD_DIR)/bspatch.c -lbz2
49 endef
50
51 define Package/bsdiff/install
52 $(INSTALL_DIR) $(1)/usr/bin/
53 $(INSTALL_BIN) $(PKG_BUILD_DIR)/bsdiff $(1)/usr/bin/bsdiff
54 endef
55
56 define Package/bspatch/install
57 $(INSTALL_DIR) $(1)/usr/bin/
58 $(INSTALL_BIN) $(PKG_BUILD_DIR)/bspatch $(1)/usr/bin/bspatch
59 endef
60
61 define Host/Install
62 $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin/
63 $(MAKE) -C $(HOST_BUILD_DIR) PREFIX=$(STAGING_DIR_HOSTPKG)/ install
64 endef
65
66 define Host/Compile
67 $(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) \
68 -o $(HOST_BUILD_DIR)/bsdiff \
69 $(HOST_BUILD_DIR)/bsdiff.c -lbz2
70 endef
71
72 define Host/Install
73 $(INSTALL_BIN) $(HOST_BUILD_DIR)/bsdiff $(STAGING_DIR_HOSTPKG)/bin/
74 endef
75
76 $(eval $(call HostBuild))
77
78 $(eval $(call BuildPackage,bsdiff))
79 $(eval $(call BuildPackage,bspatch))