2 # Copyright (c) 2001, 2002 Swedish Institute of Computer Science.
5 # Redistribution and use in source and binary forms, with or without modification,
6 # are permitted provided that the following conditions are met:
8 # 1. Redistributions of source code must retain the above copyright notice,
9 # this list of conditions and the following disclaimer.
10 # 2. Redistributions in binary form must reproduce the above copyright notice,
11 # this list of conditions and the following disclaimer in the documentation
12 # and/or other materials provided with the distribution.
13 # 3. The name of the author may not be used to endorse or promote products
14 # derived from this software without specific prior written permission.
16 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17 # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
19 # SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
21 # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
24 # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
27 # Author: Adam Dunkels <adam@sics.se>
28 # Author: David Edmondson <dme@dme.org>
30 # Derived from simhost/Makefile.
35 DATAROOTDIR
=$(PREFIX
)/share
36 MANDIR
=$(DATAROOTDIR
)/man
41 #To compile for linux: make ARCH=linux
42 #To compile for cygwin: make ARCH=cygwin
46 CFLAGS
+=$(CPPFLAGS
) -g
-D
$(ARCH
) -DIPv4
-DLWIP_DEBUG \
47 -DDEFAULT_THREAD_STACKSIZE
=65536 -DTCPIP_THREAD_STACKSIZE
=65536 \
48 -pedantic
-Werror
-Wno-error
=address
-Wall
49 # not used for now but interesting:
55 LDLIBS
+=-levent
-lpthread
57 # LDLIBS=-lpthread -lsocket -lnsl
59 CONTRIBDIR
=..
/..
/..
/..
60 LWIPARCH
=$(CONTRIBDIR
)/ports
/unix
63 #Set this to where you have the lwip core module checked out from CVS
64 #default assumes it's a dir named lwip at the same level as the contrib module
65 LWIPDIR
=$(CONTRIBDIR
)/..
/lwip
/src
69 -I
$(LWIPDIR
)/include \
70 -I
$(LWIPARCH
)/include \
71 -I
$(LWIPDIR
)/include/ipv4 \
74 # COREFILES, CORE4FILES: The minimum set of files needed for lwIP.
76 $(LWIPDIR
)/core
/def.c \
77 $(LWIPDIR
)/core
/dns.c \
78 $(LWIPDIR
)/core
/init.c \
79 $(LWIPDIR
)/core
/mem.c \
80 $(LWIPDIR
)/core
/memp.c \
81 $(LWIPDIR
)/core
/netif.c \
82 $(LWIPDIR
)/core
/pbuf.c \
83 $(LWIPDIR
)/core
/stats.c \
84 $(LWIPDIR
)/core
/sys.c \
85 $(LWIPDIR
)/core
/tcp.c \
86 $(LWIPDIR
)/core
/tcp_in.c \
87 $(LWIPDIR
)/core
/tcp_out.c \
88 $(LWIPDIR
)/core
/timers.c \
91 $(LWIPDIR
)/core
/ipv4
/icmp.c \
92 $(LWIPDIR
)/core
/ipv4
/inet.c \
93 $(LWIPDIR
)/core
/ipv4
/inet_chksum.c \
94 $(LWIPDIR
)/core
/ipv4
/ip.c \
95 $(LWIPDIR
)/core
/ipv4
/ip_addr.c \
96 $(LWIPDIR
)/core
/ipv4
/ip_frag.c
98 # APIFILES: The files which implement the sequential APIs.
100 $(LWIPDIR
)/api
/api_lib.c \
101 $(LWIPDIR
)/api
/api_msg.c \
102 $(LWIPDIR
)/api
/err.c \
103 $(LWIPDIR
)/api
/netdb.c \
104 $(LWIPDIR
)/api
/tcpip.c
106 # ARCHFILES: Architecture specific files.
107 ARCHFILES
=$(wildcard $(LWIPARCH
)/*.c
$(LWIPARCH
)/netif
/list.c
$(LWIPARCH
)/netif
/tcpdump.c
)
109 # LWIPFILES: All the above.
110 LWIPFILES
=$(COREFILES
) $(CORE4FILES
) $(SNMPFILES
) $(APIFILES
) $(NETIFFILES
) $(ARCHFILES
)
111 LWIPFILESW
=$(wildcard $(LWIPFILES
))
112 LWIPOBJS
=$(notdir $(LWIPFILESW
:.c
=.o
))
117 $(CC
) $(CFLAGS
) -c
$(<:.o
=.c
)
119 all ipv4 compile
: ocproxy
123 rm -f
*.o
$(LWIPLIB
) ocproxy
*.s .depend
* *.core core
129 $(LWIPLIB
): $(LWIPOBJS
)
130 $(AR
) $(ARFLAGS
) $(LWIPLIB
) $?
132 .depend
: ocproxy.c
$(LWIPFILES
)
133 $(CCDEP
) $(CFLAGS
) -MM
$^
> .depend ||
rm -f .depend
135 ocproxy
: .depend
$(LWIPLIB
) ocproxy.o
136 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o ocproxy ocproxy.o
$(LWIPLIB
) $(LDLIBS
)
140 install -d
$(DESTDIR
)$(BINDIR
)
141 install ocproxy
$(DESTDIR
)$(BINDIR
)
142 install -d
$(DESTDIR
)$(MANDIR
)/man1
143 install -m
0644 ocproxy
.1 $(DESTDIR
)$(MANDIR
)/man1