Basic Kernel Program Compilation problem

Discussion in 'Kernel Questions' started by jana05, Jan 28, 2008.

  1. jana05

    jana05 New Member

    Hello all,

    I am a newbie and have got FC6 up and running. I am using the hello.c (just the hello world on init and goodbye cruel world on exit) of LDD 3rd ed (Al Rub, et al...). Now I compiled this file with a Makefile containing just obj-m := hello.o and the command I gave was just make. The error was
    make: *** No targets. Stop

    Searching I found that my system does have the source. What is the procedure to install and make the source usable? How do I make this sample module work?

    Thanks in advance.
  2. KenJackson

    KenJackson New Member

    If I understand, you have a file, hello.c, which you want to compile with make.

    The error message is telling you that your 'Makefile' does not have any targets. To solve this, add a target. Try this Makefile:
    hello: hello.c
    <tab>gcc $^ -o $@
    The first line has a target (the hello executable) followed by the dependents after ':'. The second line (use a real TAB character) has the command to compile it, where '$^' stands for all the dependents, and '$@' stands for the target.

Share This Page