📄 makefile
字号:
# MakefileSRC = main.c list.c debug.c timer_queue.c aodv_socket.c aodv_hello.c \ aodv_neighbor.c aodv_timeout.c routing_table.c seek_list.c \ k_route.c aodv_rreq.c aodv_rrep.c aodv_rerr.c packet_input.c \ packet_queue.c libipq.c icmp.cSRC_NS = debug.c list.c timer_queue.c aodv_socket.c aodv_hello.c \ aodv_neighbor.c aodv_timeout.c routing_table.c seek_list.c \ aodv_rreq.c aodv_rrep.c aodv_rerr.c packet_input.c \ packet_queue.cSRC_NS_CPP = aodv-uu.ccOBJS = $(SRC:%.c=%.o)OBJS_ARM = $(SRC:%.c=%-arm.o)OBJS_NS = $(SRC_NS:%.c=%-ns.o)OBJS_NS_CPP = $(SRC_NS_CPP:%.cc=%-ns.o)KERNEL=$(shell uname -r)# Compiler and options:CC=gcc# You might want to use gcc32 for the kernel module on Fedora core 1KCC=gccARM_CC=arm-linux-gccCPP=g++OPTS=-Wall -O3CPP_OPTS=-Wall# Change to compile against different kernel:KERNEL_SRC=/usr/src/linux# Comment out to disable debug operation...DEBUG=-g -DDEBUGDEFS=-DCONFIG_GATEWAY#-DUSE_IW_SPYCFLAGS=$(OPTS) $(DEBUG) $(DEFS)ifneq (,$(findstring USE_IW_SPY,$(DEFS)))SRC:=$(SRC) link_qual.cendififneq (,$(findstring CONFIG_GATEWAY,$(DEFS)))SRC:=$(SRC) min_ipenc.c locality.cendif# ARM specific configuration goes here:#=====================================ARM_INC=# NS specific configuration goes here:#=====================================NS_DEFS= # DON'T CHANGE (overridden by NS Makefile)# Set extra DEFINES here. Link layer feedback is now a runtime option.EXTRA_NS_DEFS=-DCONFIG_GATEWAYifneq (,$(findstring CONFIG_GATEWAY,$(EXTRA_NS_DEFS)))SRC_NS:=$(SRC_NS) locality.cendif# Note: OPTS is overridden by NS MakefileNS_CFLAGS=$(OPTS) $(CPP_OPTS) $(DEBUG) $(NS_DEFS) $(EXTRA_NS_DEFS)NS_INC= # DON'T CHANGE (overridden by NS Makefile)# Archiver and optionsAR=arAR_FLAGS=rc# These are the options for the kernel modules:#==============================================KINC=-nostdinc $(shell $(CC) -print-search-dirs | sed -ne 's/install: \(.*\)/-I \1include/gp') -I/lib/modules/$(KERNEL)/build/includeKDEFS=-D__KERNEL__ -DMODULEKCFLAGS=-Wall -O2 $(KDEFS) $(KINC)KCFLAGS_ARM =-Wall -O2 -D__KERNEL__ -DMODULE $(KINC).PHONY: default clean install uninstall depend tags aodvd-arm docsdefault: aodvd kaodv.oall: defaultarm: aodvd-arm kaodv-arm.ons: endian.h aodv-uu.oendian.h: $(CC) $(CFLAGS) -o endian endian.c ./endian > endian.h$(OBJS): %.o: %.c Makefile $(CC) $(CFLAGS) -c -o $@ $<$(OBJS_ARM): %-arm.o: %.c Makefile $(ARM_CC) $(CFLAGS) -DARM $(ARM_INC) -c -o $@ $<$(OBJS_NS): %-ns.o: %.c Makefile $(CPP) $(NS_CFLAGS) $(NS_INC) -c -o $@ $<$(OBJS_NS_CPP): %-ns.o: %.cc Makefile $(CPP) $(NS_CFLAGS) $(NS_INC) -c -o $@ $<aodvd: $(OBJS) Makefile $(CC) $(CFLAGS) -o $@ $(OBJS)aodvd-arm: $(OBJS_ARM) Makefile $(ARM_CC) $(CFLAGS) -DARM -o $(@:%-arm=%) $(OBJS_ARM)aodv-uu.o: $(OBJS_NS_CPP) $(OBJS_NS) $(AR) $(AR_FLAGS) libaodv-uu.a $(OBJS_NS_CPP) $(OBJS_NS) > /dev/null# Kernel module:kaodv.o: kaodv.c $(KCC) $(KCFLAGS) -c -o $@ $<kaodv-arm.o: kaodv.c $(ARM_CC) $(KCFLAGS_ARM) -c -o $(@:%-arm.o=%.o) $<tags: etags *.c *.hindent: indent -kr -l 80 *.c \ $(filter-out $(SRC_NS_CPP:%.cc=%.h),$(wildcard *.h))depend: @echo "Updating Makefile dependencies..." @makedepend -Y./ -- $(DEFS) -- $(SRC) &>/dev/null @makedepend -a -Y./ -- $(KDEFS) kaodv.c &>/dev/nullinstall: all install -s -m 755 aodvd /usr/sbin/aodvd @if [ ! -d /lib/modules/$(KERNEL)/aodv ]; then \ mkdir /lib/modules/$(KERNEL)/aodv; \ fi install -m 644 kaodv.o /lib/modules/$(KERNEL)/aodv/kaodv.o /sbin/depmod -auninstall: rm -f /usr/sbin/aodvd rm -rf /lib/modules/$(KERNEL)/aodvdocs: cd docs && $(MAKE) allclean: rm -f aodvd *~ *.o core *.log libaodv-uu.a endian endian.h#cd docs && $(MAKE) clean# DO NOT DELETEmain.o: defs.h timer_queue.h list.h debug.h params.h aodv_socket.hmain.o: aodv_rerr.h routing_table.h aodv_timeout.h k_route.h aodv_hello.hmain.o: aodv_rrep.h packet_input.h packet_queue.hlist.o: list.hdebug.o: aodv_rreq.h defs.h timer_queue.h list.h seek_list.h routing_table.hdebug.o: aodv_rrep.h aodv_rerr.h debug.h params.htimer_queue.o: timer_queue.h defs.h list.h debug.haodv_socket.o: aodv_socket.h defs.h timer_queue.h list.h aodv_rerr.haodv_socket.o: routing_table.h params.h aodv_rreq.h seek_list.h aodv_rrep.haodv_socket.o: aodv_hello.h aodv_neighbor.h debug.haodv_hello.o: aodv_hello.h defs.h timer_queue.h list.h aodv_rrep.haodv_hello.o: routing_table.h aodv_timeout.h aodv_rreq.h seek_list.h params.haodv_hello.o: aodv_socket.h aodv_rerr.h debug.haodv_neighbor.o: aodv_neighbor.h defs.h timer_queue.h list.h routing_table.haodv_neighbor.o: aodv_rerr.h aodv_hello.h aodv_rrep.h aodv_socket.h params.haodv_neighbor.o: debug.haodv_timeout.o: defs.h timer_queue.h list.h aodv_timeout.h aodv_socket.haodv_timeout.o: aodv_rerr.h routing_table.h params.h aodv_neighbor.haodv_timeout.o: aodv_rreq.h seek_list.h aodv_hello.h aodv_rrep.h debug.haodv_timeout.o: packet_queue.h k_route.h icmp.hrouting_table.o: routing_table.h defs.h timer_queue.h list.h aodv_timeout.hrouting_table.o: packet_queue.h aodv_rerr.h aodv_hello.h aodv_rrep.hrouting_table.o: aodv_socket.h params.h k_route.h debug.h seek_list.hseek_list.o: seek_list.h defs.h timer_queue.h list.h aodv_timeout.h params.hseek_list.o: debug.hk_route.o: defs.h timer_queue.h list.h debug.h k_route.haodv_rreq.o: aodv_rreq.h defs.h timer_queue.h list.h seek_list.haodv_rreq.o: routing_table.h aodv_rrep.h aodv_timeout.h k_route.haodv_rreq.o: aodv_socket.h aodv_rerr.h params.h debug.h locality.haodv_rrep.o: aodv_rrep.h defs.h timer_queue.h list.h routing_table.haodv_rrep.o: aodv_neighbor.h aodv_hello.h aodv_timeout.h aodv_socket.haodv_rrep.o: aodv_rerr.h params.h debug.haodv_rerr.o: aodv_rerr.h defs.h timer_queue.h list.h routing_table.haodv_rerr.o: aodv_socket.h params.h aodv_timeout.h debug.hpacket_input.o: defs.h timer_queue.h list.h debug.h routing_table.hpacket_input.o: aodv_hello.h aodv_rrep.h aodv_rreq.h seek_list.h aodv_rerr.hpacket_input.o: libipq.h params.h aodv_timeout.h aodv_socket.h packet_queue.hpacket_input.o: packet_input.h min_ipenc.hpacket_queue.o: packet_queue.h defs.h timer_queue.h list.h debug.hpacket_queue.o: routing_table.h libipq.h params.h aodv_timeout.h min_ipenc.hlibipq.o: libipq.hicmp.o: defs.h timer_queue.h list.h debug.hmin_ipenc.o: defs.h timer_queue.h list.h debug.h min_ipenc.hlocality.o: locality.h defs.h timer_queue.h list.h debug.h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -