#/**************************************************************************
# *                                                                        *
# *         Copyright (c) 2002 by Sunplus Technology Co., Ltd.             *
# *                                                                        *
# *  This software is copyrighted by and is the property of Sunplus        *
# *  Technology Co., Ltd. All rights are reserved by Sunplus Technology    *
# *  Co., Ltd. This software may only be used in accordance with the       *
# *  corresponding license agreement. Any unauthorized use, duplication,   *
# *  distribution, or disclosure of this software is expressly forbidden.  *
# *                                                                        *
# *  This Copyright notice MUST not be removed or modified without prior   *
# *  written consent of Sunplus Technology Co., Ltd.                       *
# *                                                                        *
# *  Sunplus Technology Co., Ltd. reserves the right to modify this        *
# *  software without notice.                                              *
# *                                                                        *
# *  Sunplus Technology Co., Ltd.                                          *
# *  19, Innovation First Road, Science-Based Industrial Park,             *
# *  Hsin-Chu, Taiwan, R.O.C.                                              *
# *                                                                        *
# **************************************************************************/
NDK_ROOT	:= ..
SRC_DIR		:= .
GOAL		:= lwIP.a

include $(NDK_ROOT)/ndk_pre_config.mk

CFLAGS   += -Wno-unused-but-set-variable
ifdef ICATCHTEK_TOOLCHAIN4_DEFINED
CFLAGS   += -Wno-address
endif

INCLUDES += -Iinclude -Iinclude/ipv4 ${NDK_INCS}
CUSTOMIZED_INSTALL := YES

include $(NDK_ROOT)/ndk_post_config.mk

# This target must be placed behind the ndk_post_config.mk, or no objects are compiled.
customized_install: ${TGT_INST_H_FILES} ${TGT_INST_H_FILES_IP4}
	@if [ ! -e "${NDK_OUTPUT_INC}/lwip" ]; then mkdir -p ${NDK_OUTPUT_INC}/lwip; fi
	@if [ ! -e "${NDK_OUTPUT_INC}/arch" ]; then mkdir -p ${NDK_OUTPUT_INC}/arch; fi
	@$(CP) -u tcpip_port.h			${NDK_OUTPUT_INC}/tcpip_port.h
	@$(CP) -u include/lwip/sockets.h	${NDK_OUTPUT_INC}/lwip/sockets.h
	@$(CP) -u include/lwip/opt.h 		${NDK_OUTPUT_INC}/lwip/opt.h
	@$(CP) -u include/lwip/lwipopts.h	${NDK_OUTPUT_INC}/lwip/lwipopts.h
	@$(CP) -u include/lwip/debug.h		${NDK_OUTPUT_INC}/lwip/debug.h
	@$(CP) -u include/lwip/arch.h		${NDK_OUTPUT_INC}/lwip/arch.h
	@$(CP) -u include/lwip/netdb.h		${NDK_OUTPUT_INC}/lwip/netdb.h
	@$(CP) -u include/lwip/def.h		${NDK_OUTPUT_INC}/lwip/def.h
	@$(CP) -u include/lwip/err.h		${NDK_OUTPUT_INC}/lwip/err.h
	@$(CP) -u include/lwip/pbuf.h		${NDK_OUTPUT_INC}/lwip/pbuf.h
	@$(CP) -u include/arch/cc.h 		${NDK_OUTPUT_INC}/arch/cc.h
	@$(CP) -u include/ipv4/lwip/inet.h	${NDK_OUTPUT_INC}/lwip/inet.h
	@$(CP) -u include/ipv4/lwip/ip_addr.h	${NDK_OUTPUT_INC}/lwip/ip_addr.h
