[packages] squashfs-tools: update Makefile
[packages.git] / utils / squashfs-tools / Makefile
1
2 # Copyright (C) 2013 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:=squashfs-tools
11 PKG_VERSION:=4.2
12 PKG_RELEASE:=4
13
14 PKG_SOURCE:=squashfs$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@SF/squashfs
16 PKG_MD5SUM:=1b7a781fb4cf8938842279bd3e8ee852
17
18 PKG_CAT:=zcat
19 PKG_BUILD_PARALLEL:=1
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/squashfs$(PKG_VERSION)
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/squashfs-tools/Default
26   SECTION:=utils
27   CATEGORY:=Utilities
28   TITLE:=squashfs-tools
29   DEPENDS += +libpthread +zlib \
30         +SQUASHFS_TOOLS_LZO_SUPPORT:liblzo \
31         +SQUASHFS_TOOLS_XZ_SUPPORT:liblzma
32 endef
33
34 define Package/squashfs-tools-mksquashfs
35   $(call Package/squashfs-tools/Default)
36   TITLE+= mksquashfs
37 endef
38
39 define Package/squashfs-tools-unsquashfs
40   $(call Package/squashfs-tools/Default)
41   TITLE+= unsquashfs
42 endef
43
44 define Package/squashfs-tools-unsquashfs/config
45         source "$(SOURCE)/Config.in"
46 endef
47
48 define Build/Configure
49 endef
50
51 SQUASHFS_TOOLS_CONFIG := \
52         'XATTR_SUPPORT='
53
54 ifneq ($(CONFIG_SQUASHFS_TOOLS_XZ_SUPPORT),)
55 SQUASHFS_TOOLS_CONFIG += 'XZ_SUPPORT=1'
56 endif
57
58 ifneq ($(CONFIG_SQUASHFS_TOOLS_LZO_SUPPORT),)
59 SQUASHFS_TOOLS_CONFIG += 'LZO_SUPPORT=1'
60 endif
61
62 define Build/Compile
63         $(MAKE) -C $(PKG_BUILD_DIR)/squashfs-tools \
64                 CC="$(TARGET_CC)" \
65                 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
66                 EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
67                 $(SQUASHFS_TOOLS_CONFIG) \
68                 mksquashfs unsquashfs
69 endef
70
71 define Package/squashfs-tools-mksquashfs/install
72         $(INSTALL_DIR) $(1)/usr/sbin
73         $(INSTALL_BIN) $(PKG_BUILD_DIR)/squashfs-tools/mksquashfs $(1)/usr/sbin/mksquashfs
74 endef
75
76 define Package/squashfs-tools-unsquashfs/install
77         $(INSTALL_DIR) $(1)/usr/sbin
78         $(INSTALL_BIN) $(PKG_BUILD_DIR)/squashfs-tools/unsquashfs $(1)/usr/sbin/unsquashfs
79 endef
80
81 $(eval $(call BuildPackage,squashfs-tools-mksquashfs))
82 $(eval $(call BuildPackage,squashfs-tools-unsquashfs))