<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>

新聞中心

EEPW首頁(yè) > 嵌入式系統 > 設計應用 > linux kernel 1.0 網(wǎng)絡(luò )模塊代碼分析――目錄及Makefile

linux kernel 1.0 網(wǎng)絡(luò )模塊代碼分析――目錄及Makefile

作者: 時(shí)間:2018-09-05 來(lái)源:網(wǎng)絡(luò ) 收藏

在linux kernel 1.0的net目錄下查看子目錄及文件結構:

本文引用地址:http://dyxdggzs.com/article/201809/388515.htm

[root@localhost net]# ls -R

.:

ddi.c inet Makefile socket.c Space.c unix

./inet:

arp.c datagram.c dev.h eth.h icmp.h ip.c loopback.c packet.c protocol.c raw.c README route.h skbuff.h sock.h tcp.h udp.c utils.c

arp.h dev.c eth.c icmp.c inet.h ip.h Makefile proc.c protocol.h raw.h route.c skbuff.c sock.c tcp.c timer.c udp.h

./unix:

Makefile proc.c sock.c unix.h

可以看到net由ddi.c,socket.c和Space.c三個(gè)文件,inet和unix兩個(gè)目錄,還有Makefile組成。

暫時(shí)不理睬inet和unix目錄下的文件,看看Makefile的內容:

# Note! Dependencies are done automagically by 'make dep', which also

# removes any old dependencies. DON'T put your own dependencies here

# unless it's something special (ie not a .c file).

#

# Note 2! The CFLAGS definition is now in the main makefile...

# only these two lines should need to be changed to remove inet sockets.

# (and the inet/tcpip.o in net.o)

SUBDIRS := unix inet

SUBOBJS := $(foreach f,$(SUBDIRS),$f/$f.o)

#SUBOBJS的值為 unix/unix.o inet/inet.o

.c.o:

$(CC) $(CFLAGS) -c $

.s.o:

$(AS) -o $*.o $

.c.s:

$(CC) $(CFLAGS) -S $

#老式makefile中的隱式規則定義

#如果編譯目標為xx.o:xx.c則自動(dòng)引用第一個(gè)規則,依此類(lèi)推

OBJS = Space.o ddi.o socket.o

all: subdirs net.o

net.o: $(OBJS) network.a

$(LD) -r -o net.o $(OBJS) network.a

#將Space.o,ddi.o,socket.o和netowrk.a編譯成net.o,net.o再編譯進(jìn)內核中。

network.a: $(SUBOBJS)

rm -f $@

ar rc $@ $(SUBOBJS)

ranlib $@

#將unix/unix.o和inet/inet.o打包成network.a

subdirs: dummy

set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i; done

#進(jìn)入各個(gè)子目錄分別編譯unix.o和inet.o

dep:

$(CPP) -M *.c > .depend

set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i dep; done

dummy:

#假的target

#

# include a dependency file if one exists

#

ifeq (.depend,$(wildcard .depend))

include .depend

endif

Makefile 51L, 1023C



關(guān)鍵詞:

評論


相關(guān)推薦

技術(shù)專(zhuān)區

關(guān)閉
国产精品自在自线亚洲|国产精品无圣光一区二区|国产日产欧洲无码视频|久久久一本精品99久久K精品66|欧美人与动牲交片免费播放
<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>