1############################################################################################
2#
3#	Makefile For curl
4#
5#	Author: Kathy Lai
6#	Date: 2014.04.02
7#	
8#	Description:
9#		It will be used by xAgent implementation.
10#		We will use the version curl-7.36.0 for xAgent.
11#
12#############################################################################################
13include ../config.mk
14
15ifeq ($(CONFIG_CLOUD_XAGENT_CONF),y)
16CURL_DIR=curl-7.36.0
17SUBDIRS += curl-7.36.0
18endif
19
20CURL_DIR_PATH=$(shell pwd)
21
22HOST="arm-linux"
23HOST_COMPILE=$(HOST)-
24CROSS_COMPILE=arm-uclibc-linux-2.6.36-
25
26all: curl_conf sub_clean curl libcurl_conf sub_clean libcurl
27
28
29curl_conf:
30	cd $(CURL_DIR); \
31	./configure --host=$(HOST)  CC=$(CROSS_COMPILE)gcc --disable-shared --with-ssl --disable-manual --disable-proxy --without-zlib \
32		 				--disable-cookies --disable-ipv6 --disable-dict --disable-file --disable-ftp --disable-gopher \
33						--disable-imap --disable-pop3 --disable-smtp --disable-telnet --disable-tftp --disable-rtsp  
34curl:	
35	for i in ${SUBDIRS}; do \
36		(cd $$i; make) || exit 1; \
37	done
38	cp $(CURL_DIR_PATH)/$(CURL_DIR)/src/curl $(CURL_DIR_PATH)/binary
39	
40	 
41libcurl_conf:
42	cd $(CURL_DIR); \
43	./configure --host=$(HOST)  CC=$(CROSS_COMPILE)gcc --enable-shared --with-ssl --disable-manual --disable-proxy --without-zlib \
44						--disable-cookies --disable-ipv6 --disable-dict --disable-file --disable-ftp --disable-gopher \
45						--disable-imap --disable-pop3 --disable-smtp --disable-telnet --disable-tftp --disable-rtsp  
46libcurl:
47	for i in ${SUBDIRS}; do \
48		(cd $$i; make) || exit 1; \
49	done
50	cp $(CURL_DIR_PATH)/$(CURL_DIR)/lib/.libs/libcurl.* $(CURL_DIR_PATH)/binary	
51
52sub_clean:
53	cd $(CURL_DIR); \
54	for i in ${SUBDIRS}; do \
55		(cd $$i; make clean); \
56	done
57
58clean: curl_conf sub_clean libcurl_conf sub_clean
59	rm -rf $(CURL_DIR_PATH)/binary/*
60	rm -rf $(TARGETDIR)/sbin/curl
61	rm -rf $(TARGETDIR)/usr/lib/libcurl.*
62install:
63#	$(CROSS_COMPILE)strip $(CURL_DIR_PATH)/binary/curl
64	install -d $(TARGETDIR)/sbin/
65	install -m 755 $(CURL_DIR_PATH)/binary/curl $(TARGETDIR)/sbin
66	install -m 755 $(CURL_DIR_PATH)/binary/libcurl.*  $(TARGETDIR)/usr/lib
67
68