Functonal webserver with supporting code changes. WIP COMMIT
[akaros.git] / user / lwip / Makefrag
1 USER_LWIP_DIR := $(USER_DIR)/lwip
2 USER_LWIP_SRC_DIR = $(USER_LWIP_DIR)
3 OBJDIRS += $(USER_LWIP_SRC_DIR)
4 USER_LWIP_INCLUDE_DIR := $(USER_DIR)/lwip/include
5
6 USER_LWIP_SRC_CFLAGS    := $(USER_CFLAGS) -I$(USER_PARLIB_INCLUDE_DIR) \
7                                           -I$(USER_PARLIB_NEWLIB_DIR)/include \
8                                           -I$(USER_LWIP_INCLUDE_DIR)
9
10 USER_LWIP_SRC_SRCFILES  := $(USER_LWIP_SRC_DIR)/api/api_msg.c \
11                            $(USER_LWIP_SRC_DIR)/api/api_lib.c \
12                            $(USER_LWIP_SRC_DIR)/api/err.c \
13                            $(USER_LWIP_SRC_DIR)/api/netbuf.c \
14                            $(USER_LWIP_SRC_DIR)/api/netdb.c \
15                            $(USER_LWIP_SRC_DIR)/api/sockets.c \
16                            $(USER_LWIP_SRC_DIR)/api/tcpip.c \
17                            $(USER_LWIP_SRC_DIR)/netif/etharp.c \
18                            $(USER_LWIP_SRC_DIR)/netif/ethernetif.c \
19                            $(USER_LWIP_SRC_DIR)/core/dhcp.c \
20                            $(USER_LWIP_SRC_DIR)/core/init.c \
21                            $(USER_LWIP_SRC_DIR)/core/sys_arch.c \
22                            $(USER_LWIP_SRC_DIR)/core/mem.c \
23                            $(USER_LWIP_SRC_DIR)/core/memp.c \
24                            $(USER_LWIP_SRC_DIR)/core/netif.c \
25                            $(USER_LWIP_SRC_DIR)/core/pbuf.c  \
26                            $(USER_LWIP_SRC_DIR)/core/stats.c \
27                            $(USER_LWIP_SRC_DIR)/core/udp.c \
28                            $(USER_LWIP_SRC_DIR)/core/tcp.c \
29                            $(USER_LWIP_SRC_DIR)/core/raw.c \
30                            $(USER_LWIP_SRC_DIR)/core/sys.c \
31                            $(USER_LWIP_SRC_DIR)/core/tcp_out.c \
32                            $(USER_LWIP_SRC_DIR)/core/tcp_in.c \
33                            $(USER_LWIP_SRC_DIR)/core/ipv4/icmp.c \
34                            $(USER_LWIP_SRC_DIR)/core/ipv4/inet.c \
35                            $(USER_LWIP_SRC_DIR)/core/ipv4/ip.c  \
36                            $(USER_LWIP_SRC_DIR)/core/ipv4/ip_addr.c \
37                            $(USER_LWIP_SRC_DIR)/core/ipv4/ip_frag.c \
38                            $(USER_LWIP_SRC_DIR)/core/ipv4/inet_chksum.c 
39                                                         
40 USER_LWIP_SRC_OBJFILES  := $(patsubst $(USER_LWIP_SRC_DIR)/%.c, \
41                            $(OBJDIR)/$(USER_LWIP_DIR)/%.o,  \
42                            $(USER_LWIP_SRC_SRCFILES))
43
44
45 $(OBJDIR)/$(USER_LWIP_DIR)/%.o: $(USER_LWIP_SRC_DIR)/%.c
46         @echo + cc [LWIP] $<
47         @mkdir -p $(@D)
48         $(V)$(CC) $(USER_LWIP_SRC_CFLAGS) -c -o $@ $<
49         
50 $(OBJDIR)/$(USER_LWIP_DIR)/liblwip.a: $(USER_LWIP_SRC_OBJFILES)
51         @echo + ar [LWIP] $@
52         $(V)$(AR) r $@ $(USER_LWIP_SRC_OBJFILES) 2>/dev/null