summaryrefslogtreecommitdiffstats
path: root/obsolete-buildroot/make/chillispot.mk
blob: dfd8a6d4c1569e372192e6aa9c81be334896ad9a (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
66
67
68
69
70
71
72
73
74
75
76
77
78
#############################################################
#
# chillispot
#
#############################################################

CHILLISPOT_VERSION:=0.92
CHILLISPOT_SOURCE:=chillispot-$(CHILLISPOT_VERSION).tar.gz
CHILLISPOT_SITE:=http://www.chillispot.org/download/
CHILLISPOT_CAT:=zcat
CHILLISPOT_DIR:=$(BUILD_DIR)/chillispot-$(CHILLISPOT_VERSION)
CHILLISPOT_BINARY:=src/chilli
CHILLISPOT_TARGET_BINARY:=usr/sbin/chilli

$(DL_DIR)/$(CHILLISPOT_SOURCE):
	 $(WGET) -P $(DL_DIR) $(CHILLISPOT_SITE)/$(CHILLISPOT_SOURCE)

chillispot-source: $(DL_DIR)/$(CHILLISPOT_SOURCE)

$(CHILLISPOT_DIR)/.unpacked: $(DL_DIR)/$(CHILLISPOT_SOURCE)
	$(CHILLISPOT_CAT) $(DL_DIR)/$(CHILLISPOT_SOURCE) | tar -C $(BUILD_DIR) -xvf -
	sed -i -e s:"-ggdb"::g $(CHILLISPOT_DIR)/src/Makefile.in
	touch $(CHILLISPOT_DIR)/.unpacked

$(CHILLISPOT_DIR)/.configured: $(CHILLISPOT_DIR)/.unpacked
	(cd $(CHILLISPOT_DIR); rm -rf config.cache; \
		$(TARGET_CONFIGURE_OPTS) \
		CFLAGS="$(TARGET_CFLAGS)" \
		ac_cv_func_setvbuf_reversed=no \
		./configure \
		--target=$(GNU_TARGET_NAME) \
		--host=$(GNU_TARGET_NAME) \
		--build=$(GNU_HOST_NAME) \
		--prefix=/usr \
		--exec-prefix=/usr \
		--bindir=/usr/bin \
		--sbindir=/usr/sbin \
		--libexecdir=/usr/lib/locate \
		--sysconfdir=/etc \
		--datadir=/usr/share \
		--localstatedir=/var/lib \
		--mandir=/usr/man \
		--infodir=/usr/info \
		$(DISABLE_NLS) \
		$(DISABLE_LARGEFILE) \
	);
	sed -i	-e s:"#define HAVE_MALLOC 0":"#define HAVE_MALLOC 1":g \
		-e s:"#define malloc rpl_malloc"::g \
		$(CHILLISPOT_DIR)/config.h
	touch  $(CHILLISPOT_DIR)/.configured

$(CHILLISPOT_DIR)/$(CHILLISPOT_BINARY): $(CHILLISPOT_DIR)/.configured
	$(MAKE) CC=$(TARGET_CC) $(TARGET_CONFIGURE_OPTS) -C $(CHILLISPOT_DIR) 

# This stuff is needed to work around GNU make deficiencies
chillispot-target_binary: $(CHILLISPOT_DIR)/$(CHILLISPOT_BINARY)
	@if [ -L $(TARGET_DIR)/$(CHILLISPOT_TARGET_BINARY) ] ; then \
		rm -f $(TARGET_DIR)/$(CHILLISPOT_TARGET_BINARY); fi;
	@if [ ! -f $(CHILLISPOT_DIR)/$(CHILLISPOT_BINARY) -o $(TARGET_DIR)/$(CHILLISPOT_TARGET_BINARY) \
	-ot $(CHILLISPOT_DIR)/$(CHILLISPOT_BINARY) ] ; then \
	    set -x; \
	    $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(CHILLISPOT_DIR) install; \
	    $(STRIP) $(TARGET_DIR)/$(CHILLISPOT_TARGET_BINARY)
	    rm -rf $(TARGET_DIR)/usr/man; fi;
	    
chillispot: $(CHILLISPOT_DIR)/$(CHILLISPOT_BINARY)
	#chillispot-target_binary
	$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(CHILLISPOT_DIR) install
	$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(CHILLISPOT_DIR)/doc install
	$(STRIP) $(TARGET_DIR)/$(CHILLISPOT_TARGET_BINARY)
	

chillispot-clean:
	$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(CHILLISPOT_DIR) uninstall
	-$(MAKE) -C $(CHILLISPOT_DIR) clean

chillispot-dirclean:
	rm -rf $(CHILLISPOT_DIR)