Sunday, May 12, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 719  / 2 Years ago, sat, november 19, 2022, 5:36:06

I'm trying to build a driver for the Startech USB31000SW. A linux driver is included but it has to be compiled and installed. When running make I get the following errors:



make -C /lib/modules/3.2.0-52-generic-pae/build SUBDIRS=/home/lars/Hämtningar/usbnet/Linux/Kernel 2.6.x_3.x modules
make[1]: Går till katalogen "/usr/src/linux-headers-3.2.0-52-generic-pae"
make[1]: *** Ingen regel för att skapa målet "2.6.x_3.x". Stannar.
make[1]: Lämnar katalogen "/usr/src/linux-headers-3.2.0-52-generic-pae"
make: *** [default] Error 2


The third line translates to: No rule to create target



According to the read me file, the kernel source is needed, so I installed it from Synaptic.



This is the makefile:



CURRENT = $(shell uname -r)
TARGET = ax88179_178a
OBJS = ax88179_178a.o
MDIR = drivers/net/usb
KDIR = /lib/modules/$(CURRENT)/build
SUBLEVEL= $(shell uname -r | cut -d '.' -f 3 | cut -d '.' -f 1 | cut -d '-' -f 1 | cut -d '_' -f 1)
USBNET = $(shell find $(KDIR)/include/linux/usb/* -name usbnet.h)

ifneq (,$(filter $(SUBLEVEL),14 15 16 17 18 19 20 21))
MDIR = drivers/usb/net
#USBNET = $(shell find $(KDIR)/$(MDIR)/* -name usbnet.h)
endif

#ifneq (,$(filter $(SUBLEVEL),21 22 23 24))
#USBNET = $(shell find $(KDIR)/$(MDIR)/* -name usbnet.h)
#endif

#$(if $(USBNET),,$(error $(KDIR)/$(MDIR)/usbnet.h not found. please refer to readme file for the detailed description))

EXTRA_CFLAGS = -DEXPORT_SYMTAB
PWD = $(shell pwd)
DEST = /lib/modules/$(CURRENT)/kernel/$(MDIR)

obj-m := $(TARGET).o

default:
make -C $(KDIR) SUBDIRS=$(PWD) modules

$(TARGET).o: $(OBJS)
$(LD) $(LD_RFLAG) -r -o $@ $(OBJS)
pw
install:
su -c "cp -v $(TARGET).ko $(DEST) && /sbin/depmod -a"

clean:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean

.PHONY: modules clean

-include $(KDIR)/Rules.make


Any ideas would be welcome


More From » 12.04

 Answers
3

You can't have spaces in your directory names in this build directory tree. When you remove the space in the directory name /home/lars/Hämtningar/usbnet/Linux/Kernel 2.6.x_3.x (the space between "Kernel" and "2.6.x_3.x") it should work.



It's because the "make" command doesn't recognise the option "2.6.x_3.x". "Make" has to make (compile) "modules", but it tries to make "2.6.x_3.x" because of the spaces in the command.


[#29565] Saturday, November 19, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
enincroscope

Total Points: 252
Total Questions: 124
Total Answers: 104

Location: Tajikistan
Member since Thu, Apr 14, 2022
2 Years ago
;