⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makefile

📁 一种AODV实现方法
💻
字号:
CCx86=gcc

#Change this Line to reflect where ARM-gcc is on your machine
CCarm=/opt/Embedix/tools/bin/arm-linux-gcc




KVERSION=`uname -r`
CURRENTDIR=`pwd`
LOCATE=locate
# if you don't have locate uncomment the line below...it should work.
# you may get alot of permission denied errors...just ignore them.
# find is scouring through every file in /usr/lib...some you'll have
# permission to...some you won't. Hence the error. (David Gervais)

#LOCATE=find /usr/lib | grep 

MODCFLAGS :=  -O3 -DMODULE -D__KERNEL__ -DLINUX -DMESSAGES

PATHx86 := /lib/modules/$(KVERSION)/build/include/ 

#Change this Line to reflect where the src for ARM Linux is on your machine
PATHarm := /home/adhoc/sl_5000/linux/include/

COMPILEx86 := $(CCx86) $(MODCFLAGS) -I$(PATHx86)
COMPILEarm := $(CCarm) $(MODCFLAGS) -I$(PATHarm)

OBJ=

LINKx86 := ld -m elf_i386 -r   
#Change this Line to reflect where the ARM linker is on your machine
LINKarm := /opt/Embedix/tools/bin/arm-linux-ld -m armelf -r

COMMONOBJ := module.o aodv_thread.o packet_in.o packet_out.o packet_queue.o utils.o rreq.o rrep.o rrep_ack.o rerr.o route_table.o rreq_id_queue.o event_queue.o timer_queue.o interface_list.o neighbor_list.o 
LINKOBJ :=  $(COMMONOBJ)
SRC := $(wildcard *.c)
X86OBJ := $(SRC:.c=-x86.o)
ARMOBJ := $(SRC:.c=-arm.o)
X86SRC := $(SRC:.c=-x86.c)




x86:	kernel_aodv.o 
	@echo "-----------------------------------------"
	@echo ""
	@echo "Kernel AODV v1.5"
	@echo "Luke Klein-Berndt (kleinb@nist.gov)"
	@echo "Wireless Communications Technologies Group"
	@echo "National Institute Of Standards and Technology"

arm:	kernel_aodv_arm.o
	@echo "-----------------------------------------"
	@echo ""
	@echo "Kernel AODV v1.5"
	@echo "Luke Klein-Berndt (kleinb@nist.gov)"
	@echo "Wireless Communications Technologies Group"
	@echo "National Institute Of Standards and Technology"


clean:	
	@echo "Removing all .o files..."
	@rm *.o -f

cleanup:	
	@echo "Removing all build files..."
	@rm  *-x86.o *-arm.o -f

### x86 Build


%-x86.o:	%.c
		$(COMPILEx86) -c $< -o $@

kernel_aodv.o:	$(LINKOBJ:.o=-x86.o)

	@echo ""
	@echo "*** Searching for libgcc.a (Thanks to David Gervais for this routine) ***"
	@echo "-----------------------------------------"
	@echo "Linking Modules..."

		$(LINKx86) -o kernel_aodv.o $(LINKOBJ:.o=-x86.o) `$(LOCATE) libgcc.a`
	@cd $(CURRENTDIR)

### arm Build


%-arm.o:	%.c
	$(COMPILEarm) -DARM -c $< -o $@

kernel_aodv_arm.o:	$(LINKOBJ:.o=-arm.o)
	@echo ""
	@echo "Linking Modules..."
			$(LINKarm) -o kernel_aodv_arm.o $(LINKOBJ:.o=-arm.o) 
	@cd $(CURRENTDIR)





⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -