QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 571|回复: 1

make 后出现的问题,见里面

[复制链接]
发表于 2003-8-10 09:43:15 | 显示全部楼层 |阅读模式
[root@localhost dlkfet-4.24]# make install
/bin/sh: -W: invalid option
Usage:  /bin/sh [GNU long option] [option] ...
        /bin/sh [GNU long option] [option] script-file ...
GNU long options:
        --debug
        --dump-po-strings
        --dump-strings
        --help
        --init-file
        --login
        --noediting
        --noprofile
        --norc
        --posix
        --rcfile
        --rpm-requires
        --restricted
        --verbose
        --version
        --wordexp
Shell options:
        -irsD or -c command or -O shopt_option          (invocation only)
        -abefhkmnptuvxBCHP or -o option
/bin/sh: -W: invalid option
Usage:  /bin/sh [GNU long option] [option] ...
        /bin/sh [GNU long option] [option] script-file ...
GNU long options:
        --debug
        --dump-po-strings
        --dump-strings
        --help
        --init-file
        --login
        --noediting
        --noprofile
        --norc
        --posix
        --rcfile
        --rpm-requires
        --restricted
        --verbose
        --version
        --wordexp
Shell options:
        -irsD or -c command or -O shopt_option          (invocation only)
        -abefhkmnptuvxBCHP or -o option
Wall -DLINUX -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -D__NO_VERSION__ -O2 -pipe -I/lib/modules/2.4.20-8/build/include -I. -Wstrict-prototypes -fomit-frame-pointer -DMODVERSIONS -include /lib/modules/2.4.20-8/build/include/linux/modversions.h
-DVMNS   -c -o rhine_main.o rhine_main.c
make: Wall: Command not found
make: [rhine_main.o] Error 127 (ignored)
Wall -DLINUX -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -D__NO_VERSION__ -O2 -pipe -I/lib/modules/2.4.20-8/build/include -I. -Wstrict-prototypes -fomit-frame-pointer -DMODVERSIONS -include /lib/modules/2.4.20-8/build/include/linux/modversions.h
-DVMNS   -c -o rhine_proc.o rhine_proc.c
make: Wall: Command not found
make: [rhine_proc.o] Error 127 (ignored)
Wall -DLINUX -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -D__NO_VERSION__ -O2 -pipe -I/lib/modules/2.4.20-8/build/include -I. -Wstrict-prototypes -fomit-frame-pointer -DMODVERSIONS -include /lib/modules/2.4.20-8/build/include/linux/modversions.h
-DVMNS   -c -o rhine_wol.o rhine_wol.c
make: Wall: Command not found
make: [rhine_wol.o] Error 127 (ignored)
Wall -DLINUX -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -D__NO_VERSION__ -O2 -pipe -I/lib/modules/2.4.20-8/build/include -I. -Wstrict-prototypes -fomit-frame-pointer -DMODVERSIONS -include /lib/modules/2.4.20-8/build/include/linux/modversions.h
-DVMNS   -c -o rhine_vmns.o rhine_vmns.c
make: Wall: Command not found
make: [rhine_vmns.o] Error 127 (ignored)
ld: cannot open rhine_main.o: ?make: *** [rhinefet.o] Error 1




最后这点说找不到,怎么办啊???

这个文件的源码在下面





DEBUG        =        0

VMNS        =        1

OBJS        :=         rhine_main.o rhine_proc.o rhine_wol.o
SRC                =        rhine_main.c rhine_proc.c rhine_wol.c
TARGET        =        rhinefet.o

KSP :=  /lib/modules/$(shell uname -r)/build \
        /usr/src/linux-$(shell uname -r) \
        /usr/src/linux-$(shell uname -r | sed 's/-.*//') \
        /usr/src/kernel-headers-$(shell uname -r) \
        /usr/src/kernel-source-$(shell uname -r) \
        /usr/src/linux-$(shell uname -r | sed 's/\([0-9]*\.[0-9]*\)\..*/\1/') \
        /usr/src/linux

ifeq ($(VMNS),1)
OBJS+=rhine_vmns.o
SRC+=rhine_vmns.c
endif

test_dir = $(shell [ -e $(dir)/include/linux ] && echo $(dir))
KSP := $(foreach dir, $(KSP), $(test_dir))

KSRC := $(firstword $(KSP))
#KSRC :=/usr/src/ksrc/RedHat/7.2/linux-2.4.7-10alt-ent
ifeq (,$(KSRC))
  $(error Linux kernel source not found)
endif

VERSION_FILE := $(KSRC)/include/linux/version.h
CONFIG_FILE  := $(KSRC)/include/linux/config.h

ifeq (,$(wildcard $(VERSION_FILE)))
  $(error Linux kernel source not configured - missing version.h)
endif

ifeq (,$(wildcard $(CONFIG_FILE)))
  $(error Linux kernel source not configured - missing config.h)
endif

ifneq (,$(findstring egcs-2.91.66, $(shell cat /proc/version)))
  CC := kgcc gcc cc
else
  CC := gcc cc
endif

test_cc = $(shell which $(cc) > /dev/null 2>&1 && echo $(cc))
CC := $(foreach cc, $(CC), $(test_cc))
CC := $(firstword $(CC))

CFLAGS += -Wall -DLINUX -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -D__NO_VERSION__ -O2 -pipe
CFLAGS += -I$(KSRC)/include -I. -Wstrict-prototypes -fomit-frame-pointer
CFLAGS += $(shell [ -f $(KSRC)/include/linux/modversions.h ] && \
            echo "-DMODVERSIONS -include $(KSRC)/include/linux/modversions.h")

KVER := $(shell $(CC) $(CFLAGS) -E -dM $(VERSION_FILE) | grep UTS_RELEASE | \
          awk '{ print $$3 }' | sed 's/\"//g')

KERVER2=$(shell uname -r | cut -d. -f2)

.SILENT: $(TARGET) clean

ifeq ($(TARGET), rhinefet.o)
        ifneq ($(KVER),$(shell uname -r))
                $(warning ***)
                $(warning *** Warning: kernel source version ($(KVER)))
                $(warning *** does not match running kernel  ($(shell uname -r)))
                $(warning *** Continuing with build,)
                $(warning *** resulting driver may not be what you want)
                $(warning ***)
        endif
endif

INSTDIR := $(shell find /lib/modules/$(KVER) -name $(TARGET) -printf "%h\n" | sort | head -1)

ifeq (,$(INSTDIR))
        ifeq (,$(KERVER2))
                ifneq (,$(wildcard /lib/modules/$(KVER)/kernel))
                    INSTDIR := /lib/modules/$(KVER)/kernel/drivers/net
                else
                    INSTDIR := /lib/modules/$(KVER)/net
                  endif
        else
                ifneq ($(KERVER2),2)
                    INSTDIR := /lib/modules/$(KVER)/kernel/drivers/net
                else
                    INSTDIR := /lib/modules/$(KVER)/net
                  endif
        endif
endif

# look for SMP in config.h
SMP := $(shell $(CC) $(CFLAGS) -E -dM $(CONFIG_FILE) | \
         grep CONFIG_SMP | awk '{ print $$3 }')
ifneq ($(SMP),1)
  SMP := 0
endif

ifeq ($(VMNS), 1)
        CFLAGS +=        -DVMNS
endif

ifeq ($(DEBUG), 1)
        CFLAGS +=        -DRHINE_DBG
endif

ifeq ($(TARGET), rhinefet.o)
ifneq ($(SMP),$(shell uname -a | grep SMP > /dev/null 2>&1 && echo 1 || echo 0))
  $(warning ***)
ifeq ($(SMP),1)
  $(warning *** Warning: kernel source configuration (SMP))
  $(warning *** does not match running kernel (UP))
else
  $(warning *** Warning: kernel source configuration (UP))
  $(warning *** does not match running kernel (SMP))
endif
  $(warning *** Continuing with build,)
  $(warning *** resulting driver may not be what you want)
  $(warning ***)
endif
endif

ifeq ($(SMP), 1)
  CFLAGS += -D__SMP__
endif

$(TARGET): $(filter-out $(TARGET), $(SRC:.c=.o))
        $(LD) -r $^ -o $@
        echo; echo
        echo "**************************************************"
        echo "Build options:"
        echo "   VERSION    $(KVER)"
        echo -n "   SMP             "
        if [ "$(SMP)" = "1" ]; \
                then echo "Enabled"; else echo "Disabled"; fi
        echo -n "   VMNS            "
        if [ "$(VMNS)" = "1" ]; \
                then echo "Enabled"; else echo "Disabled"; fi
        echo "***************************************************"

install: clean $(TARGET)
        mkdir -p $(MOD_ROOT)$(INSTDIR)
        install -m 644 -o root $(TARGET) $(MOD_ROOT)$(INSTDIR)
        @if [ -f $(MOD_ROOT)$(INSTDIR)/via-rhine.o ] ; then \
                echo "*****  Move official driver via-rhine.o to via-rhine.o.backup" ; \
                echo "mv $(MOD_ROOT)$(INSTDIR)/via-rhine.o $(MOD_ROOT)$(INSTDIR)/via-rhine.o.backup";\
                mv $(MOD_ROOT)$(INSTDIR)/via-rhine.o $(MOD_ROOT)$(INSTDIR)/via-rhine.o.backup ; \
                echo ;\
        fi ;
        @if [ -f $(MOD_ROOT)$(INSTDIR)/linuxfet.o ] ; then \
                echo "*****  Move previous driver linuxfet.o to linuxfet.o.backup" ; \
                echo "mv $(MOD_ROOT)$(INSTDIR)/linuxfet.o $(MOD_ROOT)$(INSTDIR)/linuxfet.o.backup";\
                mv $(MOD_ROOT)$(INSTDIR)/linuxfet.o $(MOD_ROOT)$(INSTDIR)/linuxfet.o.backup ; \
                echo ;\
        fi ;

ifeq (,$(MOD_ROOT))
        /sbin/depmod -a || true
else
        /sbin/depmod -b $(MOD_ROOT) -a || true
endif

uninstall:
        rm -f $(INSTDIR)/$(TARGET)
        @if [ -f $(MOD_ROOT)$(INSTDIR)/via-rhine.o.backup ] ; then \
            echo "*****  Restore official driver vai-rhine.o from $(MOD_ROOT)$(INSTDIR)".; \
                echo "mv $(MOD_ROOT)$(INSTDIR)/via-rhine.o.backup $(MOD_ROOT)$(INSTDIR)/via-rhine.o";\
            mv $(MOD_ROOT)$(INSTDIR)/via-rhine.o.backup $(MOD_ROOT)$(INSTDIR)/via-rhine.o ;\
        fi
        /sbin/depmod -a


clean:
        rm -f $(TARGET) $(SRC:.c=.o) *~

-include .depend.mak
发表于 2003-8-10 11:35:00 | 显示全部楼层
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-19 09:14 , Processed in 0.070948 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表