Skip to content

Commit 7e7d71e

Browse files
committed
modify the dynamic library name
1 parent d472ae9 commit 7e7d71e

File tree

6 files changed

+33
-163
lines changed

6 files changed

+33
-163
lines changed

uinet/Makefile

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1+
ifeq ($(V),1)
2+
Q :=
3+
else
4+
Q := -s
5+
endif
6+
7+
export MAKE := $(MAKE) $(Q)
8+
19
all:
2-
make -C lib
3-
make -C example
10+
@echo "make uinet at:"`date`
11+
@$(MAKE) -C lib
12+
@$(MAKE) -C example
13+
@$(MAKE) -C tools
414

515
clean:
6-
make -C lib clean
7-
make -C example clean
16+
@echo "make clean at:"`date`
17+
@$(MAKE) -C lib clean
18+
@$(MAKE) -C example clean
19+
@$(MAKE) -C tools clean

uinet/example/Makefile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
TOPDIR=..
22

3-
ifeq ($(FF_PATH),)
4-
FF_PATH=${TOPDIR}
5-
endif
6-
7-
8-
LIBS+= -L${FF_PATH}/lib -Wl,--whole-archive,-lfstack,--no-whole-archive
3+
LIBS+= -L${TOPDIR}/lib -Wl,--whole-archive,-lnetstack,--no-whole-archive
94
LIBS+= -Wl,--no-whole-archive -lrt -lm -ldl -pthread
105

116
TARGET="helloworld"
127
all:
8+
@echo "build helloworld"
139
$(CC) -g -I../lib -o ${TARGET} main.c ${LIBS}
14-
$(CC) -g -I../lib -o ${TARGET}_epoll main_epoll.c ${LIBS}
1510

16-
.PHONY: clean
11+
1712
clean:
18-
rm -f *.o ${TARGET} ${TARGET}_epoll
13+
rm -f *.o ${TARGET}
14+
15+
.PHONY: clean

uinet/example/main_epoll.c

Lines changed: 0 additions & 145 deletions
This file was deleted.

uinet/lib/Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ HOST_SRCS = ${FF_HOST_SRCS}
323323
OBJS+= $(patsubst %.c,%.o,${SRCS})
324324
HOST_OBJS+= $(patsubst %.c,%.o,${HOST_SRCS})
325325

326-
all: libfstack.a
326+
all: libnetstack.a
327327

328328

329329
#
@@ -333,21 +333,23 @@ all: libfstack.a
333333
# externally available.
334334
#
335335

336-
libfstack.a: ${HOST_OBJS} ${OBJS}
336+
libnetstack.a: ${HOST_OBJS} ${OBJS}
337337
ar -cqs $@ ${OBJS} ${HOST_OBJS}
338338

339339

340340

341341
${HOST_OBJS}: %.o: %.c
342-
${HOST_C}
342+
@echo " CC " $@
343+
@${HOST_C}
343344

344345

345346
${OBJS}: %.o: %.c
347+
@echo " CC " $@
346348
${NORMAL_C}
347349

348350

349351
.PHONY: clean
350352
clean:
351-
rm -f libfstack.a
353+
rm -f libnetstack.a
352354
rm -f ${HOST_OBJS} ${OBJS} ${PROGRAM}
353355

uinet/lib/packet_process.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,10 @@ void msg_loop(void)
212212
ff_thread_set_name("msg_loop");
213213

214214
tmp = malloc(10240);
215+
packet_fd = socket(PF_PACKET,SOCK_RAW,protocol != 0?htons(protocol):htons(ETH_P_ALL));
215216

216-
if ( (packet_fd=socket(PF_PACKET,SOCK_RAW,protocol != 0?htons(protocol):htons(ETH_P_ALL)))<0) {
217+
if(packet_fd < 0)
218+
{
217219
perror("create socket failed");
218220
return;
219221
}

uinet/tools/compat/ff_ipc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
#include <rte_mempool.h>
3434
#include <rte_malloc.h>
3535
#endif
36+
#include <stdio.h>
37+
#include <stdlib.h>
3638
#include <unistd.h>
3739

3840
//#include "ff_ipc.h"

0 commit comments

Comments
 (0)