|
arm linux内核:linux-2.6.13-hzh
交叉编译环境:cross-3.3.2
/******************Makefile***********************************/
#
# .zd1211 - USB2.0 802.11b/g driver for Zydas ZD1211 chipsets
#
#
#
CC=arm-linux-gcc
CPP=arm-linux-g++
LD=arm-linux-ld
rM=rm -f -r
MODPATH := /opt/linux-2.6.13-hzh
# if the kernel is 2.6.x, turn on this
KERN_26=y
KERNEL_SOURCE=$(MODPATH)
#KERNEL_SOURCE=/usr/src/linux
# set to 1 for zd1211b
ZD1211REV_B=1
SRC_DIR=src
DEFINES=-D__KERNEL__ -DMODULE=1
ifeq ($(KERN_26), y)
ifeq ($(ZD1211REV_B),1)
MODULE = zd1211b.ko
endif
ifeq ($(ZD1211REV_B),0)
MODULE = zd1211.ko
endif
INCLUDES=-I$(KERNEL_SOURCE)/include -I$(SRC_DIR)/include/ -I$(SRC_DIR)
EXTRA_CFLAGS += -I$(PWD)/src/include
ifndef CONFIG_FRAME_POINTER
EXTRA_CFLAGS += -fomit-frame-pointer
endif
ifdef CONFIG_SMP
EXTRA_CFLAGS += -D__SMP__ -DSMP
endif
KDIR := $(MODPATH)
PWD := $(shell pwd)
WLAN_SRC=$(PWD)
EXTRA_CFLAGS += -Wall -Os -s -Wstrict-prototypes -pipe
#EXTRA_CFLAGS += -Wa,-a,-ad -g
EXTRA_CFLAGS += -DZDCONF_WE_STAT_SUPPORT=1
EXTRA_CFLAGS += -DCONFIG_NET_WIRELESS
EXTRA_CFLAGS += -DHOST_IF_USB
EXTRA_CFLAGS += -DAMAC
EXTRA_CFLAGS += -DGCCK
EXTRA_CFLAGS += -DOFDM
EXTRA_CFLAGS += -DHOSTAPD_SUPPORT
EXTRA_CFLAGS += -DUSE_EP4_SET_REG
EXTRA_CFLAGS += -DDOWNLOADFIRMWARE
EXTRA_CFLAGS += -DfTX_GAIN_OFDM=0
EXTRA_CFLAGS += -DfNEW_CODE_MAP=1
EXTRA_CFLAGS += -DfWRITE_WORD_REG=1
EXTRA_CFLAGS += -DfREAD_MUL_REG=1
EXTRA_CFLAGS += -DENHANCE_RX=1
ifeq ($(ZD1211REV_B),1)
EXTRA_CFLAGS += -DZD1211B
endif
ifeq ($(ZD1211REV_B),0)
EXTRA_CFLAGS += -DZD1211
endif
#EXTRA_CFLAGS += $(INCLUDES)
ifeq ($(ZD1211REV_B),1)
obj-m := zd1211b.o
endif
ifeq ($(ZD1211REV_B),0)
obj-m := zd1211.o
endif
zd1211-objs := $(SRC_DIR)/zd1205.o \
$(SRC_DIR)/zdasocsvc.o \
$(SRC_DIR)/zdauthreq.o \
$(SRC_DIR)/zdauthrsp.o \
$(SRC_DIR)/zdmmrx.o \
$(SRC_DIR)/zdshared.o \
$(SRC_DIR)/zdhci.o \
$(SRC_DIR)/zdglobal.o \
$(SRC_DIR)/zdencrypt.o \
$(SRC_DIR)/zdpmfilter.o \
$(SRC_DIR)/zdpsmon.o \
$(SRC_DIR)/zdsynch.o \
$(SRC_DIR)/zdbuf.o \
$(SRC_DIR)/zd1205_proc.o \
$(SRC_DIR)/zdhw.o \
$(SRC_DIR)/zddebug.o \
$(SRC_DIR)/zdtkipseed.o \
$(SRC_DIR)/zdmic.o \
$(SRC_DIR)/zdusb.o
ifeq ($(ZD1211REV_B),1)
zd1211-objs += $(SRC_DIR)/zd1211.o
zd1211b-objs = $(zd1211-objs)
endif
ifeq ($(ZD1211REV_B),0)
zd1211-objs += $(SRC_DIR)/zd1211.o
endif
all:
ifneq ($(KERNELRELEASE),)
else
ifndef ZD1211REV_B
make both
else
@echo -e $(KDIR)
@echo -e $(PWD)
@echo -e $(EXTRA_CFLAGS)
@echo -e $(zd1211-objs)
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
endif
endif
else # kernel 2.4
INCLUDES=-I$(KERNEL_SOURCE)/include -I$(SRC_DIR)/include/ -I$(SRC_DIR)
ifeq ($(ZD1211REV_B),1)
MODULE = zd1211b.o
endif
ifeq ($(ZD1211REV_B),0)
MODULE = zd1211.o
endif
OBJECTS=$(SRC_DIR)/zd1205.o \
$(SRC_DIR)/zdasocsvc.o \
$(SRC_DIR)/zdauthreq.o \
$(SRC_DIR)/zdauthrsp.o \
$(SRC_DIR)/zdmmrx.o \
$(SRC_DIR)/zdshared.o \
$(SRC_DIR)/zdhci.o \
$(SRC_DIR)/zdglobal.o \
$(SRC_DIR)/zdencrypt.o \
$(SRC_DIR)/zdpmfilter.o \
$(SRC_DIR)/zdpsmon.o \
$(SRC_DIR)/zdsynch.o \
$(SRC_DIR)/zdbuf.o \
$(SRC_DIR)/zd1205_proc.o \
$(SRC_DIR)/zdhw.o \
$(SRC_DIR)/zddebug.o \
$(SRC_DIR)/zdtkipseed.o \
$(SRC_DIR)/zdmic.o \
$(SRC_DIR)/zdusb.o
OBJECTS += $(SRC_DIR)/zd1211.o
CFLAGS=-O -Wall -Wstrict-prototypes -pipe # -Wa,-a,-ad -g
ifdef CONFIG_MODVERSIONS
CFLAGS += -DMODVERSIONS -include $(KERNEL_SOURCE)/include/linux/modversions.h #kernel 2.4
endif
ifndef CONFIG_FRAME_POINTER
CFLAGS += -fomit-frame-pointer
endif
ifdef CONFIG_SMP
CFLAGS += -D__SMP__ -DSMP
endif
CFLAGS += -DZDCONF_WE_STAT_SUPPORT=1
CFLAGS += -DHOST_IF_USB
CFLAGS += -DAMAC
CFLAGS += -DGCCK
CFLAGS += -DOFDM
CFLAGS += -DHOSTAPD_SUPPORT
CFLAGS += -DUSE_EP4_SET_REG
CFLAGS += -DDOWNLOADFIRMWARE
CFLAGS += -DfTX_GAIN_OFDM=0
CFLAGS += -DfNEW_CODE_MAP=1
CFLAGS += -DfWRITE_WORD_REG=1
CFLAGS += -DfREAD_MUL_REG=1
ifeq ($(ZD1211REV_B),1)
CFLAGS += -DZD1211B
endif
ifeq ($(ZD1211REV_B),0)
CFLAGS += -DZD1211
endif
CFLAGS += -DENHANCE_RX=1
ifndef ZD1211REV_B
all:
make both
else
all: $(MODULE)
endif
$(MODULE): $(OBJECTS)
$(LD) -static -r $(OBJECTS) -o $(MODULE)
chmod -x $(MODULE)
%.o: %.c
$(CC) -static $(CFLAGS) $(INCLUDES) $(DEFINES) $(DEBUG) -c $< -o $@
endif
both:
make ZD1211REV_B=0
make install ZD1211REV_B=0
make clean
make ZD1211REV_B=1
make install ZD1211REV_B=1
menuconfig:
/bin/sh scripts/Menuconfig config.in
inst:
make
make install
install: all
mkdir -p $(MODPATH)/net
# mkdir -p /etc/zd1211
cp $(MODULE) $(MODPATH)/net
depmod -a $(VERSION)
#for apdbg
gcc -o apdbg apdbg.c
chmod +x apdbg
cp ./apdbg /sbin/apdbg
clean:
rm -rf .tmp_versions .*.cmd *.ko *.mod.c *.mod.o *.o $(SRC_DIR)/*.o $(SRC_DIR)/.*.o.cmd
/************************End of Makefile*************************************/
/************************Result of make*************************************/
/opt/linux-2.6.13-hzh
/home/sunzh/trunk
-I/home/sunzh/trunk/src/include -fomit-frame-pointer -O -Wall -Wstrict-prototypes -pipe -DZDCONF_WE_STAT_SUPPORT=1 -DCONFIG_NET_WIRELESS -DHOST_IF_USB -DAMAC -DGCCK -DOFDM -DHOSTAPD_SUPPORT -DUSE_EP4_SET_REG -DDOWNLOADFIRMWARE -DfTX_GAIN_OFDM=0 -DfNEW_CODE_MAP=1 -DfWRITE_WORD_REG=1 -DfREAD_MUL_REG=1 -DENHANCE_RX=1 -DZD1211B
src/zd1205.o src/zdasocsvc.o src/zdauthreq.o src/zdauthrsp.o src/zdmmrx.o src/zdshared.o src/zdhci.o src/zdglobal.o src/zdencrypt.o src/zdpmfilter.o src/zdpsmon.o src/zdsynch.o src/zdbuf.o src/zd1205_proc.o src/zdhw.o src/zddebug.o src/zdtkipseed.o src/zdmic.o src/zdusb.o src/zd1211.o
make -C /opt/linux-2.6.13-hzh SUBDIRS=/home/sunzh/trunk modules
make[1]: Entering directory `/opt/linux-2.6.13-hzh'
CC [M] /home/sunzh/trunk/src/zd1205.o
{standard input}: Assembler messages:
{standard input}:7685: Error: .err encountered
make[2]: *** [/home/sunzh/trunk/src/zd1205.o] 错误 1
make[1]: *** [_module_/home/sunzh/trunk] 错误 2
make[1]: Leaving directory `/opt/linux-2.6.13-hzh'
make: *** [all] 错误 2
/*******************End******************************************/
有谁能帮我啊!
{standard input}: Assembler messages:
{standard input}:7685: Error: .err encountered
这种错误以前没碰见过,不知所措! |
|