?? makefile.std
字號:
#*******************************************************************# uLan Communication - Makefile for regular compilation # through Linux kernel rules## Makefile-mod - driver definitions and types## (C) Copyright 1999 by Pavel Pisa ## The uLan driver is distributed under the Gnu General Public Licence. # See file COPYING for details.## Author reserves right to use and publish sources for embedded # applications under different conditions too.#*******************************************************************/# currently running kernelCURRENT=$(shell uname -r)KERNEL_NEW=$(shell if [ -d /lib/modules/$(CURRENT)/build ] ; \ then echo yes ; else echo no ; fi )# Where to look for kernel#KERNEL_LOCATION=/usr/src/linux#KERNEL_LOCATION=/usr/src/linux-2.4.22#KERNEL_LOCATION=/usr/src/linux-2.5.69#KERNEL_LOCATION=/usr/src/kernel/$(CURRENT)#KERNEL_LOCATION=/lib/modules/$(CURRENT)/buildifndef KERNEL_LOCATIONifeq ($(KERNEL_NEW),yes)KERNEL_LOCATION=/lib/modules/$(CURRENT)/buildMODULE_CHAR_LOC=/lib/modules/$(CURRENT)/kernel/drivers/charelseKERNEL_LOCATION=/usr/src/linuxMODULE_CHAR_LOC=/lib/modules/$(CURRENT)/miscendifendif# Test for latest 2.5.xx and future 2.6.xx kernelsKERNEL_VERSION := $(shell awk -F\" '/REL/ {print $$2}' \ $(KERNEL_LOCATION)/include/linux/version.h | awk -F\- '{print $$1}')ifeq ($(KERNEL_VERSION),)KERNEL_VERSION=$(shell grep UTS_RELEASE ${KERNEL_LOCATION}/include/linux/utsrelease.h | \ sed 's/[^"]*"\(.*\)\{1\}"/\1/')endifKERNEL_MODULE_V26 := $(shell echo $(KERNEL_VERSION) \ | sed -n 's/^.*2\.[5-9]\..*$$/yes/p')# Target object file if anyO_TARGET :=# Regular object filesO_OBJS = ul_drv.o# Objects with exported symbols (-DEXPORT_SYMTAB)OX_OBJS =# Module objects M_OBJS = $(O_OBJS)# Module only objects with exported symbols (-DEXPORT_SYMTAB)MX_OBJS = # Kernel only objects L_OBJS = # Kernel only objects with exported symbols (-DEXPORT_SYMTAB)LX_OBJS = # Additional CFLAGSEXTRA_CFLAGS =#EXTRA_CFLAGS += -ggdb# Linux 2.4.2 build system needs nextobj-m += $(O_OBJS)ifndef KERNEL_MODULE_V26FINAL_MODULE_OBJS=$(obj-m)elseFINAL_MODULE_OBJS=$(obj-m:%.o=%.ko)endif########## Source/target independent buil of module #############all : defaultdefault : make_this_moduledep: make_this_module_depinstall : install_this_modulemake_this_module: DIR=`pwd`; (cd $(KERNEL_LOCATION); make SUBDIRS=$$DIR modules)make_this_module_dep: DIR=`pwd`; (cd $(KERNEL_LOCATION); make SUBDIRS=$$DIR dep)install_this_module: make_this_module su -c "mkdir -v -p $(MODULE_CHAR_LOC) && cp -v $(FINAL_MODULE_OBJS) $(MODULE_CHAR_LOC)"clean: rm -f $(M_OBJS) $(MX_OBJS) *.ko .*.o.flags .*.o.cmd .*.ko.cmd .depend *~ \ *.mod.c *.mod.oifndef KERNEL_MODULE_V26include $(KERNEL_LOCATION)/Rules.makeendif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -