[packages] squashfs-tools: fix recursive dependency
[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:=3
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 endef
31
32 define Package/squashfs-tools-mksquashfs
33   $(call Package/squashfs-tools/Default)
34   TITLE+= mksquashfs
35 endef
36
37 define Package/squashfs-tools-unsquashfs
38   $(call Package/squashfs-tools/Default)
39   TITLE+= unsquashfs
40 endef
41
42 define Package/squashfs-tools-unsquashfs/config
43         source "$(SOURCE)/Config.in"
44 endef
45
46 define Build/Configure
47 endef
48
49 SQUASHFS_TOOLS_CONFIG := \
50         'XATTR_SUPPORT='
51
52 ifneq ($(CONFIG_SQUASHFS_TOOLS_XZ_SUPPORT),)
53 SQUASHFS_TOOLS_CONFIG += 'XZ_SUPPORT=1'
54 endif
55
56 ifneq ($(CONFIG_SQUASHFS_TOOLS_LZO_SUPPORT),)
57 SQUASHFS_TOOLS_CONFIG += 'LZO_SUPPORT=1'
58 endif
59
60 define Build/Compile
61         $(MAKE) -C $(PKG_BUILD_DIR)/squashfs-tools \
62                 CC="$(TARGET_CC)" \
63                 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
64                 EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
65                 $(SQUASHFS_TOOLS_CONFIG) \
66                 mksquashfs unsquashfs
67 endef
68
69 define Package/squashfs-tools-mksquashfs/install
70         $(INSTALL_DIR) $(1)/usr/sbin
71         $(INSTALL_BIN) $(PKG_BUILD_DIR)/squashfs-tools/mksquashfs $(1)/usr/sbin/mksquashfs
72 endef
73
74 define Package/squashfs-tools-unsquashfs/install
75         $(INSTALL_DIR) $(1)/usr/sbin
76         $(INSTALL_BIN) $(PKG_BUILD_DIR)/squashfs-tools/unsquashfs $(1)/usr/sbin/unsquashfs
77 endef
78
79 $(eval $(call BuildPackage,squashfs-tools-mksquashfs))
80 $(eval $(call BuildPackage,squashfs-tools-unsquashfs))