peak driver 8.6.0 linux : no rule to make targget pcan_main

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
vebe78
Posts: 3
Joined: Thu 18. Oct 2018, 17:31

peak driver 8.6.0 linux : no rule to make targget pcan_main

Post by vebe78 » Thu 18. Oct 2018, 17:37

Hi,

I am trying to compile the driver on ubuntu 16.04 64bits.

I get the following error:

---
make[1]: Entering directory '/home/administrator/rt-preempt/peak-linux-driver-8.6.0/driver'
make[1]: Nothing to be done for 'depend'.
make[1]: Leaving directory '/home/administrator/rt-preempt/peak-linux-driver-8.6.0/driver'
make[1]: Entering directory '/home/administrator/rt-preempt/peak-linux-driver-8.6.0/driver'
***
*** Host machine kernel version=4.14.39-rt29
*** Driver kernel version=4.14.39-rt29 (4.14.39)
*** Path to kernel sources=/usr/src/linux-headers-4.14.39-rt29
*** use KBUILD=yes
*** cc version=5.4.0
***
make -C /usr/src/linux-headers-4.14.39-rt29 SUBDIRS=/home/administrator/rt-preempt/peak-linux-driver-8.6.0/driver EXTRA_CFLAGS="-I/home/administrator/rt-preempt/peak-linux-driver-8.6.0/driver -DNO_DEBUG -DMODVERSIONS -DPARPORT_SUBSYSTEM -DUSB_SUPPORT -DPCI_SUPPORT -DPCIEC_SUPPORT -DISA_SUPPORT -DDONGLE_SUPPORT -DPCCARD_SUPPORT -DNO_NETDEV_SUPPORT -DNO_RT -Wno-date-time" V=0 modules
make[2]: Entering directory '/usr/src/linux-headers-4.14.39-rt29'
make[3]: *** No rule to make target '/home/administrator/rt-preempt/peak-linux-driver-8.6.0/driver/src/pcan_main.o', needed by '/home/administrator/rt-preempt/peak-linux-driver-8.6.0/driver/pcan.o'. Stop.
Makefile:1528: recipe for target '_module_/home/administrator/rt-preempt/peak-linux-driver-8.6.0/driver' failed
make[2]: *** [_module_/home/administrator/rt-preempt/peak-linux-driver-8.6.0/driver] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-4.14.39-rt29'
Makefile:452: recipe for target 'all' failed
make[1]: *** [all] Error 2
---

Anything I am missing ?

I tried also with the previous version of the driver, and had the same result

(note sure if relevant: the kernel I am using has been patched for rt-preempt)

User avatar
S.Grosjean
Software Development
Software Development
Posts: 357
Joined: Wed 4. Jul 2012, 17:02

Re: peak driver 8.6.0 linux : no rule to make targget pcan_

Post by S.Grosjean » Fri 19. Oct 2018, 13:12

Hello,

Please uninstall then reinstall the linux-headers package.

Regards,
— Stéphane

vebe78
Posts: 3
Joined: Thu 18. Oct 2018, 17:31

Re: peak driver 8.6.0 linux : no rule to make targget pcan_

Post by vebe78 » Fri 19. Oct 2018, 15:16

Hi,

This did not seem to help ...

Just to make sure, here what I did:

dpkg --remove linux-headers-4.14.39-rt29
dpkg --i linux-headers-4.14.39-rt29_4.14.39-rt29-10.00.Custom_amd64.deb

User avatar
S.Grosjean
Software Development
Software Development
Posts: 357
Joined: Wed 4. Jul 2012, 17:02

Re: peak driver 8.6.0 linux : no rule to make targget pcan_

Post by S.Grosjean » Fri 19. Oct 2018, 15:34

Hi,

What you've done is to remove the extracted files from the host, then reinstall it from the downloaded .deb file.

Are you certain from this .deb file content? Where does it come from? Can you check if there is any Makefile file into /usr/src/linux-headers-4.14.39-rt29?

To be sure, you should do:

Code: Select all

# Purge (that is, unisntall files then remove .deb package)
$ sudo dpkg -P linux-headers-`uname -r`
# download the .dev file then install the files
$ sudo apt-get install linux-headers-`uname -r`
Verify if all files and directories of the pcan driver directory tree can be r/w/x by the user who do the "make".

FYI: the error displayed doesn't come from our Makefile.
— Stéphane

vebe78
Posts: 3
Joined: Thu 18. Oct 2018, 17:31

Re: peak driver 8.6.0 linux : no rule to make targget pcan_

Post by vebe78 » Fri 19. Oct 2018, 16:21

the deb file was generated by myself by compiling the kernel after patching it for rt preempt ...

So it may very well be I did do something wrong during an early stage.

Are there some configuration option I should be careful to set before compiling the kernel ?

jviereck
Posts: 1
Joined: Mon 22. Oct 2018, 16:32

Re: peak driver 8.6.0 linux : no rule to make targget pcan_

Post by jviereck » Mon 22. Oct 2018, 16:36

I get a similar error when trying to compile the 4.14 custom-patched rt-preempt kernel on my machine.

Code: Select all

 driver$ make
***
*** Host machine kernel version=4.14.71-rt44-preempt-rt
*** Driver kernel version=4.14.71-rt44-preempt-rt (4.14.71)
*** Path to kernel sources=/usr/src/linux-headers-4.14.71-rt44-preempt-rt
*** use KBUILD=yes
*** cc version=5.4.0
***
make -C /usr/src/linux-headers-4.14.71-rt44-preempt-rt
SUBDIRS=/home/jviereck/Downloads/peak-linux-driver-8.6.0/driver
EXTRA_CFLAGS="-I/home/jviereck/Downloads/peak-linux-driver-8.6.0/driver
-DNO_DEBUG -DMODVERSIONS -DPARPORT_SUBSYSTEM -DUSB_SUPPORT -DPCI_SUPPORT -DPCIEC_SUPPORT -DISA_SUPPORT -DDONGLE_SUPPORT -DPCCARD_SUPPORT -DNO_NETDEV_SUPPORT -DNO_RT  -Wno-date-time" V=0 modules
make[1]: Entering directory '/usr/src/linux-headers-4.14.71-rt44-preempt-rt'
make[2]: *** No rule to make target
'/home/jviereck/Downloads/peak-linux-driver-8.6.0/driver/src/pcan_main.o',
needed by
'/home/jviereck/Downloads/peak-linux-driver-8.6.0/driver/pcan.o'. Stop.
Makefile:1527: recipe for target
'_module_/home/jviereck/Downloads/peak-linux-driver-8.6.0/driver' failed
make[1]: ***
[_module_/home/jviereck/Downloads/peak-linux-driver-8.6.0/driver] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.14.71-rt44-preempt-rt'
Makefile:452: recipe for target 'all' failed
make: *** [all] Error 2

User avatar
S.Grosjean
Software Development
Software Development
Posts: 357
Joined: Wed 4. Jul 2012, 17:02

Re: peak driver 8.6.0 linux : no rule to make targget pcan_

Post by S.Grosjean » Tue 23. Oct 2018, 10:49

Hi,

FYI we have no problem building everything in the driver with RT patched kernel 4.13:

Code: Select all

peak@linux-dev:/tmp/peak-linux-driver-8.6.0$ make
make[1]: Entering directory '/tmp/peak-linux-driver-8.6.0/driver'
make[1]: Nothing to be done for 'depend'.
make[1]: Leaving directory '/tmp/peak-linux-driver-8.6.0/driver'
make[1]: Entering directory '/tmp/peak-linux-driver-8.6.0/driver'
***
*** Host machine kernel version=4.13.13-rt5
*** Driver kernel version=4.13.13-rt5 (4.13.13)
*** Path to kernel sources=/usr/src/linux-headers-4.13.13-rt5
*** use KBUILD=yes
*** cc version=7
***
make -C /usr/src/linux-headers-4.13.13-rt5  SUBDIRS=/tmp/peak-linux-driver-8.6.0/driver        EXTRA_CFLAGS="-I/tmp/peak-linux-driver-8.6.0/driver        -DNO_DEBUG -DMODVERSIONS -DPARPORT_SUBSYSTEM -DUSB_SUPPORT -DPCI_SUPPORT -DPCIEC_SUPPORT -DISA_SUPPORT -DDONGLE_SUPPORT -DPCCARD_SUPPORT -DNO_NETDEV_SUPPORT -DNO_RT  -Wno-date-time" V=0 modules
make[2]: Entering directory '/usr/src/linux-headers-4.13.13-rt5'
  CC [M]  /tmp/peak-linux-driver-8.6.0/driver/src/pcan_main.o
  CC [M]  /tmp/peak-linux-driver-8.6.0/driver/src/pcan_fops.o
  CC [M]  /tmp/peak-linux-driver-8.6.0/driver/src/pcan_fifo.o
  CC [M]  /tmp/peak-linux-driver-8.6.0/driver/src/pcan_filter.o
  CC [M]  /tmp/peak-linux-driver-8.6.0/driver/src/pcan_parse.o
  CC [M]  /tmp/peak-linux-driver-8.6.0/driver/src/pcan_sja1000.o
  CC [M]  /tmp/peak-linux-driver-8.6.0/driver/src/pcan_common.o
  CC [M]  /tmp/peak-linux-driver-8.6.0/driver/src/pcan_timing.o
  CC [M]  /tmp/peak-linux-driver-8.6.0/driver/src/pcanfd_core.o
  CC [M]  /tmp/peak-linux-driver-8.6.0/driver/src/pcanfd_ucan.o
  CC [M]  /tmp/peak-linux-driver-8.6.0/driver/src/pcan_pci.o
  CC [M]  /tmp/peak-linux-driver-8.6.0/driver/src/pcanfd_pci.o
  CC [M]  /tmp/peak-linux-driver-8.6.0/driver/src/pcan_pciec.o
  CC [M]  /tmp/peak-linux-driver-8.6.0/driver/src/pcan_isa.o
  CC [M]  /tmp/peak-linux-driver-8.6.0/driver/src/pcan_dongle.o
  CC [M]  /tmp/peak-linux-driver-8.6.0/driver/src/pcan_pccard_core.o
  CC [M]  /tmp/peak-linux-driver-8.6.0/driver/src/pcan_pccard.o
  CC [M]  /tmp/peak-linux-driver-8.6.0/driver/src/pcan_usb_core.o
  CC [M]  /tmp/peak-linux-driver-8.6.0/driver/src/pcan_usb.o
  CC [M]  /tmp/peak-linux-driver-8.6.0/driver/src/pcan_usbpro.o
  CC [M]  /tmp/peak-linux-driver-8.6.0/driver/src/pcanfd_usb.o
  LD [M]  /tmp/peak-linux-driver-8.6.0/driver/pcan.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/peak-linux-driver-8.6.0/driver/pcan.mod.o
  LD [M]  /tmp/peak-linux-driver-8.6.0/driver/pcan.ko
make[2]: Leaving directory '/usr/src/linux-headers-4.13.13-rt5'
make[1]: Leaving directory '/tmp/peak-linux-driver-8.6.0/driver'
make[1]: Entering directory '/tmp/peak-linux-driver-8.6.0/lib'
cc -DNO_RT -I. -I../driver -fPIC -Wall -Wcast-align -Wredundant-decls  -DPCANFD_OLD_STYLE_API -c src/libpcan.c -o obj/libpcan.o
cc -shared -Wl,-soname,libpcan.so.0 -o lib/libpcan.so.0.6 obj/libpcan.o
cd lib/; ln -sf libpcan.so.0.6 libpcan.so
cc -DNO_RT -I. -I../driver -fPIC -Wall -Wcast-align -Wredundant-decls  -DPCANFD_OLD_STYLE_API -c src/libpcanfd.c -o obj/libpcanfd.o
cc -shared -Wl,-soname,libpcanfd.so.0 -o lib/libpcanfd.so.0.1 obj/libpcanfd.o
cd lib/; ln -sf libpcanfd.so.0.1 libpcanfd.so
ar rcs lib/libpcanfd.a obj/libpcanfd.o
cc -DNO_RT -I. -I../driver -fPIC -Wall -Wcast-align -Wredundant-decls  -m32  -DPCANFD_OLD_STYLE_API -c src/libpcan.c -o obj32/libpcan.o
cc -shared -Wl,-soname,libpcan.so.0 -o lib32/libpcan.so.0.6 obj32/libpcan.o  -m32
cd lib32/; ln -sf libpcan.so.0.6 libpcan.so
cc -DNO_RT -I. -I../driver -fPIC -Wall -Wcast-align -Wredundant-decls  -m32  -DPCANFD_OLD_STYLE_API -c src/libpcanfd.c -o obj32/libpcanfd.o
cc -shared -Wl,-soname,libpcanfd.so.0 -o lib32/libpcanfd.so.0.1 obj32/libpcanfd.o  -m32
cd lib32/; ln -sf libpcanfd.so.0.1 libpcanfd.so
ar rcs lib32/libpcanfd.a obj32/libpcanfd.o
make[1]: Leaving directory '/tmp/peak-linux-driver-8.6.0/lib'
make[1]: Entering directory '/tmp/peak-linux-driver-8.6.0/test'
cc -DNO_RT -g -I. -I../lib -I../driver    src/receivetest.c src/common.c -lpcanfd  -L../lib/lib   -o receivetest
cc -DNO_RT -g -I. -I../lib -I../driver    src/transmitest.cpp src/common.c src/parser.cpp -lpcanfd -lstdc++  -L../lib/lib   -o transmitest
cc -DNO_RT -g -I. -I../lib -I../driver    src/bitratetest.c src/common.c -lpcanfd  -L../lib/lib   -o bitratetest
cc -DNO_RT -g -I. -I../lib -I../driver    src/filtertest.cpp src/common.c -lpcanfd -lstdc++  -L../lib/lib   -o filtertest
cc -DNO_RT -g -I. -I../lib -I../driver    src/pcanfdtst.c -lpcanfd  -L../lib/lib   -o pcanfdtst
cc -DNO_RT -g -I. -I../lib -I../driver    src/pcan-settings.c -lpopt  -L../lib/lib   -g -o pcan-settings
make[1]: Leaving directory '/tmp/peak-linux-driver-8.6.0/test'
peak@linux-dev:/tmp/peak-linux-driver-8.6.0$
Hints:
- Can you try to upgrade to a more recent version of GCC (both of you use 5.4.0)?
- How did you build your debian packages, please?
- If you did build your own Kernel, then you don't need the kernel-headers package: only change the KERNEL_LOCATION variable in "peak-linux-driver-x.y.z/driver/Makefile" so that it contains the dir name in which you have built the Kernel.
— Stéphane

Post Reply