From 18537fc9225cdbe98c27d98fd1bc3323a2a62ffd Mon Sep 17 00:00:00 2001 From: lr <1234@qq.com> Date: Fri, 17 May 2024 09:56:21 +0800 Subject: [PATCH] modify makefile eventually --- Ubiquitous/XiZi_AIoT/Makefile | 2 ++ Ubiquitous/XiZi_AIoT/services/app/Makefile | 2 +- .../XiZi_AIoT/services/net/net_server/Makefile | 6 ++---- .../XiZi_AIoT/services/net/net_server/lwip_server.c | 12 ++++++++++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Ubiquitous/XiZi_AIoT/Makefile b/Ubiquitous/XiZi_AIoT/Makefile index 4a560ba9c..1c0ec12cc 100755 --- a/Ubiquitous/XiZi_AIoT/Makefile +++ b/Ubiquitous/XiZi_AIoT/Makefile @@ -129,6 +129,8 @@ clean: @rm -rf services/tools/mkfs/mkfs @rm -rf services/app/fs.img @rm -rf services/app/user.map + @rm -rf services/net/net_server/user.map + @rm -rf services/net/net_server/bin distclean: @echo Clean all configuration diff --git a/Ubiquitous/XiZi_AIoT/services/app/Makefile b/Ubiquitous/XiZi_AIoT/services/app/Makefile index 0fdf53553..9873a4c29 100644 --- a/Ubiquitous/XiZi_AIoT/services/app/Makefile +++ b/Ubiquitous/XiZi_AIoT/services/app/Makefile @@ -26,7 +26,7 @@ INC_DIR = -I$(KERNEL_ROOT)/services/shell/letter-shell \ -I$(KERNEL_ROOT)/services/app ifeq ($(BOARD), imx6q-sabrelite) -all: init test_fs simple_client simple_server shell fs_server test_irq_hdlr test_irq_block test_irq_send eth_driver epit_server readme.txt | bin +all: init test_fs simple_client simple_server shell fs_server test_irq_hdlr test_irq_block test_irq_send eth_driver epit_server readme.txt lwip | bin else all: init test_fs simple_client simple_server shell fs_server test_irq_hdlr readme.txt | bin endif diff --git a/Ubiquitous/XiZi_AIoT/services/net/net_server/Makefile b/Ubiquitous/XiZi_AIoT/services/net/net_server/Makefile index 6e3c9be23..15b3bb4bc 100644 --- a/Ubiquitous/XiZi_AIoT/services/net/net_server/Makefile +++ b/Ubiquitous/XiZi_AIoT/services/net/net_server/Makefile @@ -55,11 +55,9 @@ libipc = $(KERNEL_ROOT)/services/app/libipc.o lwip: COMPILER lwip_server.o | bin @${ld} ${user_ldflags} -e main -o $@ ${api} ${core} ${ipv4} ${netif} lwip_service.o lwip_server.o \ - ${board_specs} ${libserial} ${printf} ${libmem} ${usyscall} ${arch_usyscall} ${arch_usyscall} \ - ${session} ${libipc} - @${objdump} -S $@ > $@.asm + ${board_specs} ${libserial} ${printf} ${libmem} ${usyscall} ${arch_usyscall} ${session} ${libipc} @mv *.o bin - @mv *.asm bin + @mv $@ $(KERNEL_ROOT)/services/app bin: @mkdir -p bin diff --git a/Ubiquitous/XiZi_AIoT/services/net/net_server/lwip_server.c b/Ubiquitous/XiZi_AIoT/services/net/net_server/lwip_server.c index 7c69f6b7a..9b2eeecad 100644 --- a/Ubiquitous/XiZi_AIoT/services/net/net_server/lwip_server.c +++ b/Ubiquitous/XiZi_AIoT/services/net/net_server/lwip_server.c @@ -18,6 +18,7 @@ #include "lwip/init.h" #include "lwip/ip4_addr.h" #include "lwip/netif.h" +#include "netif/ethernet.h" static struct netif gnetif; @@ -30,8 +31,14 @@ int IPC_DO_SERVE_FUNC(Ipc_LWIP_init)(char* ip, char* mask, char* gw){ lwip_init(); - // netif_add(&gnetif, &net_ipaddr, &net_netmask, &net_gw, NULL, - // ðernetif_init, ðernet_input); +#ifndef NETIF_ENET_INIT_FUNC + printf("Not Netif driver for Eport 0\n"); + return 0; +#endif + +#ifdef NETIF_ENET_INIT_FUNC + netif_add(&gnetif, &net_ipaddr, &net_netmask, &net_gw, NULL, + NETIF_ENET_INIT_FUNC, ðernet_input); /* Registers the default network interface */ netif_set_default(&gnetif); @@ -47,6 +54,7 @@ int IPC_DO_SERVE_FUNC(Ipc_LWIP_init)(char* ip, char* mask, char* gw){ netif_set_down(&gnetif); } return 0; +#endif }