summaryrefslogtreecommitdiff
path: root/package/dmraid/dmraid.mk
blob: 4c02c0b7114653f5e6806e5de52d00d999b406b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#############################################################
#
# dmraid
#
#############################################################

DMRAID_VERSION=1.0.0.rc11
DMRAID_SOURCE:=dmraid-$(DMRAID_VERSION).tar.bz2
DMRAID_SITE:=http://people.redhat.com/~heinzm/sw/dmraid/src
DMRAID_DIR:=$(BUILD_DIR)/dmraid/$(DMRAID_VERSION)
DMRAID_CAT:=$(BZCAT)
DMRAID_BINARY:=dmraid
DMRAID_STAGING_BINARY:=$(DMRAID_DIR)/STAGING_DIR)/tools/$(DMRAID_BINARY)
DMRAID_TARGET_BINARY:=$(TARGET_DIR)/sbin/$(DMRAID_BINARY)

$(DL_DIR)/$(DMRAID_SOURCE):
	 $(WGET) -P $(DL_DIR) $(DMRAID_SITE)/$(DMRAID_SOURCE)

$(DMRAID_DIR)/.unpacked: $(DL_DIR)/$(DMRAID_SOURCE)
	$(DMRAID_CAT) $(DL_DIR)/$(DMRAID_SOURCE) | tar -C $(BUILD_DIR) -xvf -
	toolchain/patch-kernel.sh $(DMRAID_DIR) package/dmraid \*.patch
	touch $(DMRAID_DIR)/.unpacked

$(DMRAID_DIR)/.configured: $(DMRAID_DIR)/.unpacked
	(cd $(DMRAID_DIR); rm -rf config.cache; \
		$(TARGET_CONFIGURE_OPTS) \
		CFLAGS="$(TARGET_CFLAGS)" \
		./configure \
		--target=$(GNU_TARGET_NAME) \
		--host=$(GNU_TARGET_NAME) \
		--build=$(GNU_HOST_NAME) \
		--prefix=/usr \
		$(DISABLE_NLS) \
		$(DISABLE_LARGEFILE) \
		--with-user=$(shell id -un) --with-group=$(shell id -gn) \
	);
	touch $(DMRAID_DIR)/.configured

$(DMRAID_DIR)/tools/$(DMRAID_BINARY): $(DMRAID_DIR)/.configured
	$(MAKE1) -C $(DMRAID_DIR)
	-$(STRIP) $(DMRAID_DIR)/tools/$(DMRAID_BINARY)
	-$(UPX) --best $(DMRAID_DIR)/tools/$(DMRAID_BINARY)
	touch -c $(DMRAID_DIR)/tools/$(DMRAID_BINARY)

$(DMRAID_TARGET_BINARY): $(DMRAID_DIR)/tools/$(DMRAID_BINARY)
	$(INSTALL) -m 0755 $? $@
	$(INSTALL) -m 0755 package/dmraid/dmraid.init $(TARGET_DIR)/etc/init.d/dmraid

dmraid: uclibc dm $(DMRAID_TARGET_BINARY)

dmraid-clean:
	rm $(DMRAID_TARGET_BINARY)
	$(MAKE) -C $(DMRAID_DIR) clean

dmraid-dirclean:
	rm -rf $(DMRAID_DIR)

#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(strip $(BR2_PACKAGE_DMRAID)),y)
TARGETS+=dmraid
endif