I'm quite new to Linux Kernel Development, and I have an issue trying to build my device drivers so that I can test them and run the strace command on them. However, for some reason, in any directory (within the staging directory, such as greybus or netlogic), when I run the command make, I always get the same error. I'm using this tutorial (header: Compiling only part of the kernel) which details the compiling process.

make: *** No targets. Stop.

I have no idea why this is showing up. Just, as an example, there is a Makefile in the greybus directory and it does have targets. This is the Makefile:

# Greybus core
greybus-y :=    core.o          \
                debugfs.o       \
                hd.o            \
                manifest.o      \
                module.o        \
                interface.o     \
                bundle.o        \
                connection.o    \
                control.o       \
                svc.o           \
                svc_watchdog.o  \

obj-$(CONFIG_GREYBUS)           += greybus.o

# needed for trace events
ccflags-y += -I$(src)

# Greybus Host controller drivers
gb-es2-y := es2.o
  • I see no targets in that Makefile. A target is a line saying something: followed by target dependencies on the same line. Then there are lines with actions for building the target that are indented by tabs. This Makefile fragment is probably included by another Makefile somewhere else. – Kusalananda Aug 23 '17 at 17:45
  • Ah okay, I thought that the target was the greybus-y:.... part. Would that mean that I would have to compile one of its parent directories? – Eames Aug 23 '17 at 18:05
  • 1
    You need to stay in the top directory of the kernel (where you have subdirectories like kernel and drivers), and say for example make path/file.o, where path is the directory in which you found the above partial makefile. – meuh Aug 23 '17 at 18:11
  • No, those are variable assignments. I'm not familiar with the Linux kernel sources, so I can unfortunately not guide you to the correct way of doing what you want, but looking one level up or more may be needed, yes. – Kusalananda Aug 23 '17 at 18:12
  • You want to do the build at the top level, probably after you have run make menuconfig to enable the greybus driver. Once you have done all this and installed the kernel you still will not be able to run strace on the driver. Strace shows the calls that userspace makes to the kernel, but the driver is in kernel space. – icarus Aug 23 '17 at 18:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.