aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board-js2x/Makefile3
-rw-r--r--board-qemu/Makefile4
-rw-r--r--clients/net-snk/Makefile2
-rw-r--r--clients/net-snk/app/Makefile4
-rw-r--r--clients/net-snk/app/netapps/Makefile2
-rw-r--r--lib/Makefile2
-rw-r--r--lib/libnet/Makefile (renamed from clients/net-snk/app/netlib/Makefile)43
-rw-r--r--lib/libnet/bootp.c (renamed from clients/net-snk/app/netlib/bootp.c)0
-rw-r--r--lib/libnet/dhcp.c (renamed from clients/net-snk/app/netlib/dhcp.c)0
-rw-r--r--lib/libnet/dhcp.h (renamed from clients/net-snk/app/netlib/dhcp.h)0
-rw-r--r--lib/libnet/dhcpv6.c (renamed from clients/net-snk/app/netlib/dhcpv6.c)0
-rw-r--r--lib/libnet/dhcpv6.h (renamed from clients/net-snk/app/netlib/dhcpv6.h)0
-rw-r--r--lib/libnet/dns.c (renamed from clients/net-snk/app/netlib/dns.c)0
-rw-r--r--lib/libnet/dns.h (renamed from clients/net-snk/app/netlib/dns.h)0
-rw-r--r--lib/libnet/ethernet.c (renamed from clients/net-snk/app/netlib/ethernet.c)0
-rw-r--r--lib/libnet/ethernet.h (renamed from clients/net-snk/app/netlib/ethernet.h)0
-rw-r--r--lib/libnet/icmpv6.c (renamed from clients/net-snk/app/netlib/icmpv6.c)0
-rw-r--r--lib/libnet/icmpv6.h (renamed from clients/net-snk/app/netlib/icmpv6.h)0
-rw-r--r--lib/libnet/ipv4.c (renamed from clients/net-snk/app/netlib/ipv4.c)0
-rw-r--r--lib/libnet/ipv4.h (renamed from clients/net-snk/app/netlib/ipv4.h)0
-rw-r--r--lib/libnet/ipv6.c (renamed from clients/net-snk/app/netlib/ipv6.c)0
-rw-r--r--lib/libnet/ipv6.h (renamed from clients/net-snk/app/netlib/ipv6.h)0
-rw-r--r--lib/libnet/ndp.c (renamed from clients/net-snk/app/netlib/ndp.c)0
-rw-r--r--lib/libnet/ndp.h (renamed from clients/net-snk/app/netlib/ndp.h)0
-rw-r--r--lib/libnet/tcp.c (renamed from clients/net-snk/app/netlib/tcp.c)0
-rw-r--r--lib/libnet/tcp.h (renamed from clients/net-snk/app/netlib/tcp.h)0
-rw-r--r--lib/libnet/tftp.c (renamed from clients/net-snk/app/netlib/tftp.c)0
-rw-r--r--lib/libnet/tftp.h (renamed from clients/net-snk/app/netlib/tftp.h)0
-rw-r--r--lib/libnet/udp.c (renamed from clients/net-snk/app/netlib/udp.c)0
-rw-r--r--lib/libnet/udp.h (renamed from clients/net-snk/app/netlib/udp.h)0
30 files changed, 35 insertions, 25 deletions
diff --git a/board-js2x/Makefile b/board-js2x/Makefile
index f24a504..db63b91 100644
--- a/board-js2x/Makefile
+++ b/board-js2x/Makefile
@@ -13,7 +13,8 @@
BOARD_TARGETS = tools_build romfs_build clients_build stage1 subdirs
SUBDIRS = slof rtas
-COMMON_LIBS = libc libipmi libbootmsg libbases libnvram libelf libusb libbcm
+COMMON_LIBS = libc libipmi libbootmsg libbases libnvram libelf libusb \
+ libbcm libnet
all: $(BOARD_TARGETS)
$(MAKE) boot_rom.bin
diff --git a/board-qemu/Makefile b/board-qemu/Makefile
index 29ee016..78639cc 100644
--- a/board-qemu/Makefile
+++ b/board-qemu/Makefile
@@ -14,8 +14,8 @@ BOARD_TARGETS = tools_build romfs_build clients_build stage1 subdirs
SUBDIRS = slof
-COMMON_LIBS = libc libbootmsg libbases libnvram libelf libhvcall libvirtio libusb \
- libveth libe1k
+COMMON_LIBS = libc libbootmsg libbases libnvram libelf libhvcall libvirtio \
+ libusb libveth libe1k libnet
all: $(BOARD_TARGETS)
$(MAKE) boot_rom.bin
diff --git a/clients/net-snk/Makefile b/clients/net-snk/Makefile
index c0bb73a..1cab7ae 100644
--- a/clients/net-snk/Makefile
+++ b/clients/net-snk/Makefile
@@ -17,7 +17,7 @@ include $(TOP)/make.rules
OBJS = kernel/kernel.o oflib/oflib.o libc/libc-glue.o app/app.o
.PHONY : subdirs clean depend mrproper
-CLIENTLIBS = $(LIBCMNDIR)/libelf.a $(LIBCMNDIR)/libc.a
+CLIENTLIBS = $(LIBCMNDIR)/libelf.a $(LIBCMNDIR)/libnet.a $(LIBCMNDIR)/libc.a
all: .depend subdirs
$(MAKE) client
diff --git a/clients/net-snk/app/Makefile b/clients/net-snk/app/Makefile
index 6faed63..41d4bf7 100644
--- a/clients/net-snk/app/Makefile
+++ b/clients/net-snk/app/Makefile
@@ -16,10 +16,10 @@ export TOP
endif
include $(TOP)/make.rules
-CFLAGS +=$(ADDCFLAGS) -Inetlib
+CFLAGS +=$(ADDCFLAGS) -I$(LIBCMNDIR)/libnet
OBJS = main.o
-OBJDIRS = netlib/netlib.o netapps/netboot.o
+OBJDIRS = netapps/netboot.o
OBJDIRS += netapps/ping.o
OBJDIRS += netapps/args.o
diff --git a/clients/net-snk/app/netapps/Makefile b/clients/net-snk/app/netapps/Makefile
index 1e50226..5d95346 100644
--- a/clients/net-snk/app/netapps/Makefile
+++ b/clients/net-snk/app/netapps/Makefile
@@ -16,7 +16,7 @@ ifndef TOP
endif
include $(TOP)/make.rules
-CFLAGS += -I.. -I../netlib -I../../../../lib/ -Wall -W
+CFLAGS += -I.. -I$(LIBCMNDIR)/libnet -I$(LIBCMNDIR) -Wall -W
OBJS = netboot.o ping.o args.o
diff --git a/lib/Makefile b/lib/Makefile
index ed8a359..6d9db66 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -11,7 +11,7 @@
# ****************************************************************************/
SUBDIRS = libc libipmi libbootmsg libbases libnvram libelf libhvcall libvirtio \
- libusb libveth libe1k libbcm
+ libusb libveth libe1k libbcm libnet
all: subdirs
diff --git a/clients/net-snk/app/netlib/Makefile b/lib/libnet/Makefile
index 610e189..14c29d3 100644
--- a/clients/net-snk/app/netlib/Makefile
+++ b/lib/libnet/Makefile
@@ -16,27 +16,36 @@ ifndef TOP
endif
include $(TOP)/make.rules
-CFLAGS += -I../netapps
+CFLAGS += -I. -I.. -I../libc/include
+CFLAGS += -I../../clients/net-snk/app/netapps -I../../clients/net-snk/include
-ifeq ($(SNK_USE_MTFTP), 1)
-CFLAGS += -DUSE_MTFTP
-endif
+SRCS = ethernet.c ipv4.c udp.c tcp.c dns.c bootp.c dhcp.c tftp.c \
+ ipv6.c dhcpv6.c icmpv6.c ndp.c
-OBJS = ethernet.o ipv4.o udp.o tcp.o dns.o bootp.o \
- dhcp.o ipv6.o dhcpv6.o icmpv6.o ndp.o
+OBJS = $(SRCS:%.c=%.o)
-ifeq ($(SNK_USE_MTFTP), 1)
-OBJS += mtftp.o
-else
-OBJS += tftp.o
-endif
+TARGET = ../libnet.a
+
+all: $(TARGET)
+
+$(TARGET): $(OBJS)
+ $(AR) -rc $@ $(OBJS)
+ $(RANLIB) $@
+
+clean:
+ $(RM) $(TARGET) $(OBJS)
+
+distclean: clean
+ $(RM) Makefile.dep
-all: netlib.o
-netlib.o: $(OBJS)
- $(LD) $(LDFLAGS) $^ -o $@ -r
+# Rules for creating the dependency file:
+depend:
+ $(RM) Makefile.dep
+ $(MAKE) Makefile.dep
-clean:
- $(RM) -f *.o *.a *.i
+Makefile.dep: Makefile
+ $(CC) -M $(CPPFLAGS) $(CFLAGS) $(SRCS) > Makefile.dep
-include $(TOP)/make.depend
+# Include dependency file if available:
+-include Makefile.dep
diff --git a/clients/net-snk/app/netlib/bootp.c b/lib/libnet/bootp.c
index 6d58cef..6d58cef 100644
--- a/clients/net-snk/app/netlib/bootp.c
+++ b/lib/libnet/bootp.c
diff --git a/clients/net-snk/app/netlib/dhcp.c b/lib/libnet/dhcp.c
index 0cb4fa4..0cb4fa4 100644
--- a/clients/net-snk/app/netlib/dhcp.c
+++ b/lib/libnet/dhcp.c
diff --git a/clients/net-snk/app/netlib/dhcp.h b/lib/libnet/dhcp.h
index 645fdd1..645fdd1 100644
--- a/clients/net-snk/app/netlib/dhcp.h
+++ b/lib/libnet/dhcp.h
diff --git a/clients/net-snk/app/netlib/dhcpv6.c b/lib/libnet/dhcpv6.c
index 491d540..491d540 100644
--- a/clients/net-snk/app/netlib/dhcpv6.c
+++ b/lib/libnet/dhcpv6.c
diff --git a/clients/net-snk/app/netlib/dhcpv6.h b/lib/libnet/dhcpv6.h
index 02747a0..02747a0 100644
--- a/clients/net-snk/app/netlib/dhcpv6.h
+++ b/lib/libnet/dhcpv6.h
diff --git a/clients/net-snk/app/netlib/dns.c b/lib/libnet/dns.c
index a7313a9..a7313a9 100644
--- a/clients/net-snk/app/netlib/dns.c
+++ b/lib/libnet/dns.c
diff --git a/clients/net-snk/app/netlib/dns.h b/lib/libnet/dns.h
index b8756af..b8756af 100644
--- a/clients/net-snk/app/netlib/dns.h
+++ b/lib/libnet/dns.h
diff --git a/clients/net-snk/app/netlib/ethernet.c b/lib/libnet/ethernet.c
index 1e03a0b..1e03a0b 100644
--- a/clients/net-snk/app/netlib/ethernet.c
+++ b/lib/libnet/ethernet.c
diff --git a/clients/net-snk/app/netlib/ethernet.h b/lib/libnet/ethernet.h
index e541c8f..e541c8f 100644
--- a/clients/net-snk/app/netlib/ethernet.h
+++ b/lib/libnet/ethernet.h
diff --git a/clients/net-snk/app/netlib/icmpv6.c b/lib/libnet/icmpv6.c
index e897588..e897588 100644
--- a/clients/net-snk/app/netlib/icmpv6.c
+++ b/lib/libnet/icmpv6.c
diff --git a/clients/net-snk/app/netlib/icmpv6.h b/lib/libnet/icmpv6.h
index 41b0c70..41b0c70 100644
--- a/clients/net-snk/app/netlib/icmpv6.h
+++ b/lib/libnet/icmpv6.h
diff --git a/clients/net-snk/app/netlib/ipv4.c b/lib/libnet/ipv4.c
index 3a1a789..3a1a789 100644
--- a/clients/net-snk/app/netlib/ipv4.c
+++ b/lib/libnet/ipv4.c
diff --git a/clients/net-snk/app/netlib/ipv4.h b/lib/libnet/ipv4.h
index 5717c9a..5717c9a 100644
--- a/clients/net-snk/app/netlib/ipv4.h
+++ b/lib/libnet/ipv4.h
diff --git a/clients/net-snk/app/netlib/ipv6.c b/lib/libnet/ipv6.c
index 49de5c7..49de5c7 100644
--- a/clients/net-snk/app/netlib/ipv6.c
+++ b/lib/libnet/ipv6.c
diff --git a/clients/net-snk/app/netlib/ipv6.h b/lib/libnet/ipv6.h
index 6f783b3..6f783b3 100644
--- a/clients/net-snk/app/netlib/ipv6.h
+++ b/lib/libnet/ipv6.h
diff --git a/clients/net-snk/app/netlib/ndp.c b/lib/libnet/ndp.c
index f1f51c7..f1f51c7 100644
--- a/clients/net-snk/app/netlib/ndp.c
+++ b/lib/libnet/ndp.c
diff --git a/clients/net-snk/app/netlib/ndp.h b/lib/libnet/ndp.h
index cd18158..cd18158 100644
--- a/clients/net-snk/app/netlib/ndp.h
+++ b/lib/libnet/ndp.h
diff --git a/clients/net-snk/app/netlib/tcp.c b/lib/libnet/tcp.c
index faa0b83..faa0b83 100644
--- a/clients/net-snk/app/netlib/tcp.c
+++ b/lib/libnet/tcp.c
diff --git a/clients/net-snk/app/netlib/tcp.h b/lib/libnet/tcp.h
index 375afd7..375afd7 100644
--- a/clients/net-snk/app/netlib/tcp.h
+++ b/lib/libnet/tcp.h
diff --git a/clients/net-snk/app/netlib/tftp.c b/lib/libnet/tftp.c
index c1197cf..c1197cf 100644
--- a/clients/net-snk/app/netlib/tftp.c
+++ b/lib/libnet/tftp.c
diff --git a/clients/net-snk/app/netlib/tftp.h b/lib/libnet/tftp.h
index 6b5996c..6b5996c 100644
--- a/clients/net-snk/app/netlib/tftp.h
+++ b/lib/libnet/tftp.h
diff --git a/clients/net-snk/app/netlib/udp.c b/lib/libnet/udp.c
index 1203947..1203947 100644
--- a/clients/net-snk/app/netlib/udp.c
+++ b/lib/libnet/udp.c
diff --git a/clients/net-snk/app/netlib/udp.h b/lib/libnet/udp.h
index f154542..f154542 100644
--- a/clients/net-snk/app/netlib/udp.h
+++ b/lib/libnet/udp.h