Root/package/compcache/Makefile

1#
2# Copyright (C) 2009 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7# $Id: Makefile 6562 2009-10-05 08:30:14 ghd $
8
9include $(TOPDIR)/rules.mk
10include $(INCLUDE_DIR)/kernel.mk
11
12PKG_NAME:=compcache
13PKG_VERSION:=0.6.2
14PKG_RELEASE:=1
15PKG_SOURCE_URL:=http://compcache.googlecode.com/files/
16PKG_MD5SUM:=27aec78dc50e34fb800c74e879057743
17
18PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
19
20include $(INCLUDE_DIR)/package.mk
21
22define KernelPackage/compcache
23  SUBMENU:=Other modules
24  DEPENDS:=@LINUX_2_6 @BUSYBOX_CONFIG_SWAPONOFF
25  TITLE:=Driver for compressed ram swap device
26  VERSION:=$(LINUX_VERSION)-$(BOARD)-$(LINUX_RELEASE)+$(PKG_RELEASE)
27  FILES:=$(PKG_BUILD_DIR)/ramzswap.$(LINUX_KMOD_SUFFIX) \
28     $(PKG_BUILD_DIR)/sub-projects/compression/lzo-kmod/lzo1x.$(LINUX_KMOD_SUFFIX)
29  MENU:=1
30endef
31
32
33include $(INCLUDE_DIR)/kernel-defaults.mk
34
35LZO = sub-projects/compression/lzo-kmod
36RZSC = sub-projects/rzscontrol
37
38BUILDFLAGS:=-DCONFIG_RAMZSWAP_STATS \
39        -I$(PKG_BUILD_DIR)/$(LZO) \
40        -Wall
41
42RZSCFLAGS:=-I$(PKG_BUILD_DIR)/$(RZSC)/../include \
43       -I$(PKG_BUILD_DIR)/$(RZSC)/../..
44
45define Build/Compile
46    $(MAKE) $(KERNEL_MAKEOPTS) EXTRA_CFLAGS="$(BUILDFLAGS)" M="$(PKG_BUILD_DIR)" modules
47    $(TARGET_CC) $(TARGET_CFLAGS) $(RZSCFLAGS) $(PKG_BUILD_DIR)/$(RZSC)/rzscontrol.c -o $(PKG_BUILD_DIR)/rzscontrol
48endef
49
50define KernelPackage/compcache/install
51    $(INSTALL_DIR) $(1)/etc/config
52    $(INSTALL_DATA) ./files/compcache.config $(1)/etc/config/compcache
53    $(SED) 's,%ENABLED%,$(if $(CONFIG_COMPCACHE_ENABLE),1,0),g' \
54          -e 's,%RAM_REPORTED%,$(call qstrip,$(CONFIG_COMPCACHE_RAM_REPORTED)),g' \
55          -e 's,%BACKUP_DEV%,$(call qstrip,$(CONFIG_COMPCACHE_BACKUP_DEV)),g' \
56          $(1)/etc/config/compcache
57    $(INSTALL_DIR) $(1)/etc/init.d
58    $(INSTALL_BIN) ./files/compcache.init $(1)/etc/init.d/compcache
59    $(INSTALL_DIR) $(1)/sbin
60    $(INSTALL_BIN) $(PKG_BUILD_DIR)/rzscontrol $(1)/sbin/rzscontrol
61endef
62
63define KernelPackage/compcache/config
64    source "$(SOURCE)/Config.in"
65endef
66
67$(eval $(call KernelPackage,compcache))
68

Archive Download this file



interactive