📄 makefile
字号:
########################################################################### # RT2400/RT2500 SourceForge Project - http://rt2x00.serialmonkey.com # # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # # (at your option) any later version. # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program; if not, write to the # # Free Software Foundation, Inc., # # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # # # Licensed under the GNU GPL # # Original code supplied under license from RaLink Inc, 2004. # ########################################################################### ########################################################################### # Module Name: Makefile # # Abstract: Makefile for rt2570 kernel module # # Revision History: # Who When What # -------- ----------- ----------------------------- # MarkW 8th Dec 04 Rewrite of Makefile # AmirS 1st Jan 05 Update for gmake compat# MarkW 20th Jan 05 Fixed permissions on directory# MichalL 5th Mar 05 Module installation fixes# RobinC 2nd Jun 05 Import makefile into rt2570 tree # MathiasK 04th Jul 05 Module installation fixes# MarkW 29th Jul 05 Allow installation dir override########################################################################### all: moduleMODULE_NAME := rt2570#PATCHLEVEL := 6 #KERNDIR=/usr/src/linux-2.6#MODDIR=/lib/modules/2.6.12/extraifeq ($(PATCHLEVEL),) PATCHLEVEL := $(shell uname -r | cut -d. -f2)endifRESMAN_CORE_OBJS := rtusb_main.oRESMAN_GLUE_OBJS := mlme.o rtusb_bulk.o connect.o sync.o rtusb_init.o rtmp_tkip.o wpa.o rtmp_wep.o rtusb_info.o assoc.o auth.o auth_rsp.o md5.o rtusb_io.o sanity.o rtusb_data.o$(MODULE_NAME)-objs := $(RESMAN_CORE_OBJS) $(RESMAN_GLUE_OBJS)ifdef TOPDIRobj-m += $(MODULE_NAME).oendifEXTRA_CFLAGS += -I$(src)ifdef KERNDIR KERNEL_SOURCES := $(KERNDIR)else KERNEL_SOURCES := /lib/modules/$(shell uname -r)/buildendififdef MODDIR MODULE_ROOT := $(MODDIR)else MODULE_ROOT := /lib/modules/$(shell uname -r)/extraendififdef KERNOUT KERNEL_OUTPUT := KBUILD_OUTPUT=$(KERNOUT)else KERNEL_OUTPUT :=endifsrc ?= .obj ?= .ifeq ($(PATCHLEVEL), 4) MODULE_OBJECT := $(MODULE_NAME).o MODULE_CONF := /etc/modules.confelse MODULE_OBJECT := $(MODULE_NAME).ko MODULE_CONF := /etc/modprobe.confendififeq ($(PATCHLEVEL), 4)$(obj)/$(MODULE_NAME).o: $($(MODULE_NAME)-objs) $(LD) $(EXTRA_LDFLAGS) -r -o $@ $($(MODULE_NAME)-objs)endifKBUILD_PARAMS := -C $(KERNEL_SOURCES) SUBDIRS=$(PWD) $(KERNEL_OUTPUT)module: @$(MAKE) $(KBUILD_PARAMS) modules; \ if ! [ -f $(MODULE_OBJECT) ]; then \ echo "$(MODULE_OBJECT) failed to build!"; \ exit 1; \ fiarm: @$(MAKE) $(KBUILD_PARAMS) 'EXTRA_CFLAGS=-mstructure-size-boundary=8 -I$(src)' modules; if ! [ -f $(MODULE_OBJECT) ]; then \ echo "$(MODULE_OBJECT) failed to build!"; \ exit 1; \ fiarmdebug: @$(MAKE) $(KBUILD_PARAMS) 'EXTRA_CFLAGS=-mstructure-size-boundary=8 -I$(src) -DRT2500_DBG' modules; if ! [ -f $(MODULE_OBJECT) ]; then \ echo "$(MODULE_OBJECT) failed to build!"; \ exit 1; \ fidebug: @$(MAKE) $(KBUILD_PARAMS) 'EXTRA_CFLAGS=-I$(src) -DRT2500_DBG' modules; \ if ! [ -f $(MODULE_OBJECT) ]; then \ echo "$(MODULE_OBJECT) failed to build!"; \ exit 1; \ ficlean: @rm -f $(RESMAN_GLUE_OBJS) $(RESMAN_CORE_OBJS) .*.{cmd,flags} @rm -f $(MODULE_NAME).{o,ko,mod.{o,c}} built-in.o $(VERSION_HEADER) *~ @rm -fr .tmp_versionsmodules_install:ifeq ($(PATCHLEVEL),4) if ! [ -f $(MODULE_OBJECT) ]; then \ module; \ fi @echo "install '$(MODULE_OBJECT)' to $(MODULE_ROOT)" install -m 755 -o 0 -g 0 -d $(MODULE_ROOT) install -m 644 -o 0 -g 0 $(MODULE_OBJECT) $(MODULE_ROOT) /sbin/depmod -aelse echo "2.6 module install" make $(KBUILD_PARAMS) modules_install /sbin/depmod -aendifinstall: modules_install @if ! grep -q 'rausb0' $(MODULE_CONF) ; then \ echo "append 'alias rausb0 rt2570' to $(MODULE_CONF)"; \ echo "alias rausb0 rt2570" >> $(MODULE_CONF) ; \ fiinstall-fedora: if ! [ -f $(MODULE_OBJECT) ]; then \ module; \ fi @echo "install '$(MODULE_OBJECT)' to $(MODULE_ROOT)" install -m 755 -o 0 -g 0 -d $(MODULE_ROOT) install -m 644 -o 0 -g 0 $(MODULE_OBJECT) $(MODULE_ROOT) /sbin/depmod -a @if ! grep -q 'wlan0' /etc/modprobe.conf ; then \ echo "append 'alias wlan0 rt2570' to /etc/modprobe.conf"; \ echo "alias wlan0 rt2570" >> /etc/modprobe.conf ; \ echo "options rt2570 ifname=wlan%d" >> /etc/modprobe.conf ; \ fiifeq ($(PATCHLEVEL), 4)include $(KERNEL_SOURCES)/Rules.makeendif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -