2 # Copyright (C) 2009 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 # $Id: Makefile 6562 2009-10-05 08:30:14 ghd $
9 include $(TOPDIR
)/rules.mk
10 include $(INCLUDE_DIR
)/kernel.mk
14 PKG_RELEASE
:=$(PKG_VERSION
)-1
15 PKG_SOURCE_URL
:=http
://compcache.googlecode.com
/files
/
16 PKG_MD5SUM
:=27aec78dc50e34fb800c74e879057743
18 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
20 include $(INCLUDE_DIR
)/package.mk
22 define 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
)
32 include $(INCLUDE_DIR
)/kernel-defaults.mk
34 LZO
= sub-projects
/compression
/lzo-kmod
35 RZSC
= sub-projects
/rzscontrol
37 BUILDFLAGS
:=-DCONFIG_RAMZSWAP_STATS \
38 -I
$(PKG_BUILD_DIR
)/$(LZO
) \
41 RZSCFLAGS
:=-I
$(PKG_BUILD_DIR
)/$(RZSC
)/..
/include \
42 -I
$(PKG_BUILD_DIR
)/$(RZSC
)/..
/..
45 $(MAKE
) $(KERNEL_MAKEOPTS
) EXTRA_CFLAGS
="$(BUILDFLAGS)" M
="$(PKG_BUILD_DIR)" modules
46 $(TARGET_CC
) $(TARGET_CFLAGS
) $(RZSCFLAGS
) $(PKG_BUILD_DIR
)/$(RZSC
)/rzscontrol.c
-o
$(PKG_BUILD_DIR
)/rzscontrol
49 define KernelPackage
/compcache
/install
50 $(INSTALL_DIR
) $(1)/etc
/config
51 $(INSTALL_DATA
) .
/files
/compcache.config
$(1)/etc
/config
/compcache
52 $(SED
) 's,%ENABLED%,$(if $(CONFIG_COMPCACHE_ENABLE),1,0),g' \
53 -e
's,%RAM_REPORTED%,$(call qstrip,$(CONFIG_COMPCACHE_RAM_REPORTED)),g' \
54 -e
's,%BACKUP_DEV%,$(call qstrip,$(CONFIG_COMPCACHE_BACKUP_DEV)),g' \
55 $(1)/etc
/config
/compcache
56 $(INSTALL_DIR
) $(1)/etc
/init.d
57 $(INSTALL_BIN
) .
/files
/compcache.init
$(1)/etc
/init.d
/compcache
58 $(INSTALL_DIR
) $(1)/sbin
59 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/rzscontrol
$(1)/sbin
/rzscontrol
62 define KernelPackage
/compcache
/config
63 source
"$(SOURCE)/Config.in"
66 $(eval
$(call KernelPackage
,compcache
))