lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] How to build LwIP1.3.0 for Xilinx PPC405


From: Lou Cypher
Subject: Re: [lwip-users] How to build LwIP1.3.0 for Xilinx PPC405
Date: Fri, 05 Jun 2009 12:41:52 +0200
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

> My target is to build this LwIP130 in EDK Shell without using Libgen, I
> guess a powerpc-eabi-xxx and a good makefile should work.
> 
> Now, my question is: is there a quick way to automatically let
> powerpc-eabi-xxx know the include path without using libgen? I am sure xps
> GUI deal with this somewhere, but I am new to GNU and couldn't find this
> underlying command. May I ask what's your "makefile" looks like?

Well, my Makefile(s) are really few, since I'm using the SDK environment (while
there are so many good reasons to avoid it as well).
I had some Makefile created by SDK for my lwip library, and they run from EDK
shell too (though they _always_ recompile all), I can attach them here.
I changed a very few lines of these files, and I guess you'll have to switch all
the mb-gcc, mb-ar, etc. in something like powerpc-eabi-gcc, ecc., plus linking
it all in an executable (my Makefile serves as a library generator)

Lou

include Makefile.lwip
include Makefile.adapter

COMPILER=
# ARCHIVER=
ARCHIVER=mb-ar
CP=cp
# COMPILER_FLAGS=-Wall -os
COMPILER_FLAGS=-O1 -g
EXTRA_COMPILER_FLAGS=

# RELEASEDIR=../../../lib
# INCLUDEDIR=../../../include
RELEASEDIR=./obj
INCLUDEDIR=../microblaze_0_sw_platform/microblaze_0/include

INCLUDES=-I${INCLUDEDIR} -I$(LWIP_DIR)/src/include 
-I$(LWIP_DIR)/src/include/ipv4 -I$(PORT)/include

EXPORT_INCLUDE_FILES =  $(LWIP_DIR)/src/include/ipv4/lwip \
                        $(LWIP_DIR)/src/include/lwip \
                        $(LWIP_DIR)/src/include/netif \
                        contrib/ports/xilinx/include/netif \
                        contrib/ports/xilinx/include/arch \
                        contrib/ports/xilinx/include/lwipopts.h

all:    libs

libs: liblwip4.a
#       cp liblwip4.a $(RELEASEDIR)

include: 
        @for i in $(EXPORT_INCLUDE_FILES); do \
        echo ${CP} -r $$i ${INCLUDEDIR}; \
        ${CP} -r $$i ${INCLUDEDIR}; \
        done

clean:
        echo "clean target for lwip"
        rm -f obj/*.o obj/*.a liblwip4.a

liblwip4.a: obj_dir print_msg_lwip_base $(LWIP_OBJS) print_msg_lwip_adapter 
$(ADAPTER_OBJS)
        @echo "Creating archive $@"
        $(ARCHIVER) rc $@ obj/*.o

obj_dir:
        mkdir -p obj

print_msg_lwip_base:
        @echo "Compiling lwIP with $(GCC_COMPILER)"

print_msg_lwip_adapter:
        @echo "Compiling lwIP adapter for Xilinx MAC:"

.c.o:
        @echo "Compiling $<"
        $(GCC_COMPILER) $(COMPILER_FLAGS) $(EXTRA_COMPILER_FLAGS) $(INCLUDES) 
-c $< -o obj/$(@F)
include Makefile.config

PORT = contrib/ports/xilinx

COMMON_SRCS = $(PORT)/sys_arch_raw.c \
              $(PORT)/netif/xpqueue.c \
              $(PORT)/netif/xadapter.c \
              $(PORT)/netif/xtopology_g.c

EMACLITE_SRCS = $(PORT)/netif/xemacliteif.c

TEMAC_SRCS = $(PORT)/netif/xlltemacif_hw.c \
             $(PORT)/netif/xlltemacif_physpeed.c \
             $(PORT)/netif/xlltemacif_fifo.c \
             $(PORT)/netif/xlltemacif_sdma.c \
             $(PORT)/netif/xlltemacif.c

SYSARCH_SOCKET_SRCS = $(PORT)/sys_arch.c

ADAPTER_SRCS = $(COMMON_SRCS)

ifeq ($(CONFIG_SOCKETS), y)
ADAPTER_SRCS += $(SYSARCH_SOCKET_SRCS)
endif   

ifeq ($(CONFIG_XEMACLITE), y)
ADAPTER_SRCS += $(EMACLITE_SRCS)
endif

ifeq ($(CONFIG_XLLTEMAC), y)
ADAPTER_SRCS += $(TEMAC_SRCS)
endif

ADAPTER_OBJS = $(ADAPTER_SRCS:%.c=%.o)

Attachment: Makefile.config
Description: application/xml

include Makefile.config

LWIP_DIR = lwip-1.3.0

CORE_SRCS = $(LWIP_DIR)/src/core/init.c \
            $(LWIP_DIR)/src/core/mem.c \
            $(LWIP_DIR)/src/core/memp.c \
            $(LWIP_DIR)/src/core/netif.c \
            $(LWIP_DIR)/src/core/pbuf.c \
            $(LWIP_DIR)/src/core/raw.c \
            $(LWIP_DIR)/src/core/stats.c \
            $(LWIP_DIR)/src/core/sys.c

CORE_IPV4_SRCS = $(LWIP_DIR)/src/core/ipv4/ip_addr.c \
                 $(LWIP_DIR)/src/core/ipv4/icmp.c \
                 $(LWIP_DIR)/src/core/ipv4/inet.c \
                 $(LWIP_DIR)/src/core/ipv4/inet_chksum.c \
                 $(LWIP_DIR)/src/core/ipv4/ip.c \
                 $(LWIP_DIR)/src/core/ipv4/ip_frag.c

CORE_IPV6_SRCS = $(LWIP_DIR)/src/core/ipv6/inet6.c  \
                 $(LWIP_DIR)/src/core/ipv6/ip6_addr.c \
                 $(LWIP_DIR)/src/core/ipv6/icmp6.c \
                 $(LWIP_DIR)/src/core/ipv6/ip6.c

CORE_TCP_SRCS  = $(LWIP_DIR)/src/core/tcp.c \
                 $(LWIP_DIR)/src/core/tcp_in.c \
                 $(LWIP_DIR)/src/core/tcp_out.c 

CORE_DHCP_SRCS = $(LWIP_DIR)/src/core/dhcp.c

CORE_UDP_SRCS  = $(LWIP_DIR)/src/core/udp.c

CORE_SNMP_SRCS = $(LWIP_DIR)/src/core/snmp/asn1_dec.c \
                 $(LWIP_DIR)/src/core/snmp/asn1_enc.c \
                 $(LWIP_DIR)/src/core/snmp/mib2.c \
                 $(LWIP_DIR)/src/core/snmp/mib_structs.c \
                 $(LWIP_DIR)/src/core/snmp/msg_in.c \
                 $(LWIP_DIR)/src/core/snmp/msg_out.c

CORE_ARP_SRCS  = $(LWIP_DIR)/src/netif/etharp.c

API_SOCK_SRCS = $(LWIP_DIR)/src/api/api_lib.c \
                 $(LWIP_DIR)/src/api/api_msg.c \
                 $(LWIP_DIR)/src/api/err.c \
                 $(LWIP_DIR)/src/api/netbuf.c \
                 $(LWIP_DIR)/src/api/sockets.c \
                 $(LWIP_DIR)/src/api/tcpip.c

# create LWIP_SRCS based on configured options

LWIP_SRCS = $(CORE_SRCS)

# we always include ARP, IPv4, TCP and UDP sources
LWIP_SRCS += $(CORE_ARP_SRCS)
LWIP_SRCS += $(CORE_IPV4_SRCS)
LWIP_SRCS += $(CORE_TCP_SRCS)
LWIP_SRCS += $(CORE_UDP_SRCS)
LWIP_SRCS += $(CORE_DHCP_SRCS)

ifeq ($(CONFIG_SOCKETS), y)
LWIP_SRCS += $(API_SOCK_SRCS)
endif   

LWIP_OBJS = $(LWIP_SRCS:%.c=%.o)

____________________________________________________________
GET FREE 5GB EMAIL - Check out spam free email with many cool features!
Visit http://www.inbox.com/email to find out more!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]