modify makefile eventually

This commit is contained in:
lr 2024-05-17 09:56:21 +08:00
parent aabb860bb2
commit 18537fc922
4 changed files with 15 additions and 7 deletions

View File

@ -129,6 +129,8 @@ clean:
@rm -rf services/tools/mkfs/mkfs @rm -rf services/tools/mkfs/mkfs
@rm -rf services/app/fs.img @rm -rf services/app/fs.img
@rm -rf services/app/user.map @rm -rf services/app/user.map
@rm -rf services/net/net_server/user.map
@rm -rf services/net/net_server/bin
distclean: distclean:
@echo Clean all configuration @echo Clean all configuration

View File

@ -26,7 +26,7 @@ INC_DIR = -I$(KERNEL_ROOT)/services/shell/letter-shell \
-I$(KERNEL_ROOT)/services/app -I$(KERNEL_ROOT)/services/app
ifeq ($(BOARD), imx6q-sabrelite) 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 else
all: init test_fs simple_client simple_server shell fs_server test_irq_hdlr readme.txt | bin all: init test_fs simple_client simple_server shell fs_server test_irq_hdlr readme.txt | bin
endif endif

View File

@ -55,11 +55,9 @@ libipc = $(KERNEL_ROOT)/services/app/libipc.o
lwip: COMPILER lwip_server.o | bin lwip: COMPILER lwip_server.o | bin
@${ld} ${user_ldflags} -e main -o $@ ${api} ${core} ${ipv4} ${netif} lwip_service.o lwip_server.o \ @${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} \ ${board_specs} ${libserial} ${printf} ${libmem} ${usyscall} ${arch_usyscall} ${session} ${libipc}
${session} ${libipc}
@${objdump} -S $@ > $@.asm
@mv *.o bin @mv *.o bin
@mv *.asm bin @mv $@ $(KERNEL_ROOT)/services/app
bin: bin:
@mkdir -p bin @mkdir -p bin

View File

@ -18,6 +18,7 @@
#include "lwip/init.h" #include "lwip/init.h"
#include "lwip/ip4_addr.h" #include "lwip/ip4_addr.h"
#include "lwip/netif.h" #include "lwip/netif.h"
#include "netif/ethernet.h"
static struct netif gnetif; static struct netif gnetif;
@ -30,8 +31,14 @@ int IPC_DO_SERVE_FUNC(Ipc_LWIP_init)(char* ip, char* mask, char* gw){
lwip_init(); lwip_init();
// netif_add(&gnetif, &net_ipaddr, &net_netmask, &net_gw, NULL, #ifndef NETIF_ENET_INIT_FUNC
// &ethernetif_init, &ethernet_input); 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, &ethernet_input);
/* Registers the default network interface */ /* Registers the default network interface */
netif_set_default(&gnetif); 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); netif_set_down(&gnetif);
} }
return 0; return 0;
#endif
} }