Common Errors of make

Source: Internet
Author: User

Errors generated during make execution are not fatal, especially when "-" exists before the command line, or make uses the "-k" option for execution. All fatal errors in the make Execution Process contain the prefix "***". All error messages have prefixes. One is the execution program name as the error prefix (usually "make "); in addition, when the makefile itself has a syntax error and cannot be parsed and executed by make, the prefix contains the MAKEFILE file name and the wrong row number.


The common prefix is omitted in the following error list:


[Foo] Error NN

[Foo] signal description

Such errors are not true for make. It indicates that make detects that the program called by make returns a non-zero state (error NN) as the program that executes the command, or the command program exits abnormally (carrying a certain signal ), for more information, see the error section in the 5.4 command.

If the "***" string is not appended to the error message, the sub-process call fails. If the makefile command has the prefix "-", make ignores this error.



Missing separator. Stop.

Missing separator (Did you mean tab instead of 8 spaces ?). Stop.

For unrecognized command lines, make cannot parse the content contained in makefile. GNU make identifies each line of makefile based on various separators (:, =, [Tab] characters) when reading makefile. These errors mean that make cannot find a valid separator.

The possible cause of this error message is that (maybe the editor, mostly the MS-Windows Editor) 4 (or 8) are used before the commands in makefile) A space replaces the [Tab] character. In this case, an error message is generated in the second form. Note that all command lines should start with the [Tab] character.


Commands commence before first target.
Stop.

Missing rule before commands. Stop.

Makefile may start with a command line: It starts with a [Tab] character, but is not a legal command line (for example, a variable value assignment ). The command line must correspond to rules one by one.

The cause of the second error may be that the first non-null character in a row is a semicolon. Make will consider that the rule's "target: prerequisite" section is missing.



No rule to make target 'xxx '.

No rule to make target 'xxx', needed by 'yyy '.

It is impossible to find appropriate rules for the reconstruction target "XXX", including clear rules and implicit rules.

To correct this error, add a rule in makefile to recreate the target. Other possible causes of these errors are the spelling of the file name in makefile, or the source file tree is damaged (a file cannot be rebuilt, but it may be due to a file dependency problem ).



No targets specified and no makefile found. Stop.

No targets. Stop.

The first error indicates that the target to be rebuilt is not specified in the command line, and make cannot read any makefile. The second error indicates that the MAKEFILE file can be found, but there is no ultimate goal or the target to be rebuilt is not indicated in the command line. In this case, make does nothing. Refer to Chapter 9 to execute make



Makefile 'xxx' was not found.

Included makefile 'xxx' was not found.

If "-F" is not used to specify the makefile, make cannot find the default makefile (makefile or gnumakefile) in the current directory ). Use "-F" to specify the file, but cannot read the specified makefile.



Warning: overriding commands for target 'xxx'

Warning: ignoring old commands for target 'xxx'

There is more than one reconstruction command for the same target "XXX. GNU make stipulates that when the same file serves as the target of multiple rules, only one rule can be defined to recreate its command (except for the dual-colon rule ). If the same or different commands are specified for a target multiple times, the first alarm is generated. The second alarm indicates that the new command overwrites the previous one.



Circular XXX <-yyy dependency dropped.

The dependency of the rule generates a loop: The dependency file of the target "XXX" is "yyy", and the dependency list of the dependency "yyy" contains "XXX ".



Recursive variable 'xxx' references itself (eventually). Stop.

Make variable "XXX" (recursive expansion) references itself when replacing expansion. This is not allowed for directly expanded variables (defined by: =) or append definitions (+ =.



Unterminated variable reference. Stop.

The variable or function reference syntax is incorrect. The complete brackets are not used (left or right parentheses are missing ).



Insufficient arguments to function 'xxx'. Stop.

The number of parameters referenced by the function "XXX" is incorrect. The function lacks parameters.



Missing target pattern. Stop.

Multiple Target patterns. Stop.
Target pattern contains no '%'. Stop. <= An error occurred when I compiled j_sim!

Mixed implicit and static pattern rules. Stop.

Incorrect static mode rules.

The first error occurs because the target segment of the static mode rule does not have a mode target;

The reason for the second error is that the target segment of the static mode rule has multiple mode targets;

The third cause of the error is: The target segment of the static mode rule does not contain the pattern character "% ";

The reason for the fourth error is that the three parts of the static mode rule contain the pattern character "% ". It is correct that only the last two characters can contain the pattern character "% ".



Warning:-JN forced in submake: disabling jobserver mode.

This alarm and the next alarm occur when make detects recursive make calls, and the sub-make processes that can communicate with each other encounter parallel processing errors. The "-JN" parameter (N value is greater than 1) exists in the command line parameters of recursive make. In some cases, this error may occur, for example: in makefile, the variable "make" is assigned "make-J2", and the variable "make" is used in the command line of recursive calling ". In this case, the called Make process cannot communicate with other make processes. It can only process two tasks in parallel ".


Warning: jobserver unavailable: Using-J1. add' + 'to parent make rule.

In order to communicate with the actual make process, the upper-layer make process will pass information to the sub-make process. This may occur during information transmission. The sub-make process is not an actual make process, but the upper-layer make process cannot determine whether the sub-process is a real make process. It only transmits all information. Upper-layer make uses normal algorithms to determine these. In this case, the child process only accepts some useful information transmitted by the parent process. The sub-process generates the warning information and then processes it in the built-in order.




I wrote a makefile to compile a module under linux2.4. Its content is as follows:

Includedir =/usr/src/linux-2.4/include

Debflags =-O2

Cc = gcc

Cflags =-d1_kernel _-dmodule-wall $ (debflags)

Cflags + =-I $ (includedir)
Target = ds1307

Objs = $ (target). o

Src = $ (target). c

$ (CC) $ (cflags)

When I execute make, the reported error is:

Makefile: 9: *** commands commence before first target. Stop

Excuse me, what is my mistake.


If no target is defined, add a row, which is like the following:

Dsl307:

$ (CC) $ (cflags)


I wrote a module named zariphix_modules_001.c. The content is as follows:

# Include <Linux/kernel. h>

# Include <Linux/module. h>


Int init_module (){

Printk ("Hello world! \ N ");

Return 0;

}


Void cleanup_module (){

Printk ("bye-bye! \ N ");

}


Then write a makefile with the following content:


Cc = gcc

Modflags: =-wall-dmodule-d1_kernel _-dlinux

Zariphix_modules_001.o: zariphix_modules_001.c/usr/include/Linux/version. h

$ (CC) $ (modflags)-C zariphix_modules_001.c


The following error is prompted during make:

Makefile: 5: *** the Delimiter is missing. Stop.

What are separators? Also, I cannot find the location of my kernel source code tree in the system, which is not found under/usr/src.

My system is Ubuntu 5.10.


$ (CC) $ (modflags)-C zariphix_modules_001.c

There must be a tab at the beginning of this line. It cannot be in the first column. Note that it is a tab, not a space,


Run $ sudo make

There is a series of error messages:

Reference:

Gcc-wall-dmodule-d1_kernel _-dlinux-C zariphix_modules_001.c

In file encoded ded from/usr/include/Linux/sched. h: 16,

From/usr/include/Linux/module. h: 9,

From zariphix_modules_001.c: 2:

/Usr/include/Linux/signal. h: 2: 2: Warning: # warning "You shoshould include <signal. h>. This time I will do it for you ."

In file encoded ded from/usr/include/Linux/resource. h: 4,

From/usr/include/Linux/sched. h: 79,

From/usr/include/Linux/module. h: 9,

From zariphix_modules_001.c: 2:

/Usr/include/Linux/time. h: 9: Error: 'struct timespec 'redefinition

/Usr/include/Linux/time. h: 15: Error: 'struct timeval' redefinition

/Usr/include/Linux/time. h: 20: Error: 'struct timezone 'redefinition

/Usr/include/Linux/time. h: 47: Error: 'struct itimerval' redefinition

In file encoded ded from zariphix_modules_001.c: 2:

/Usr/include/Linux/module. h: 41: error: the type of the field 'attr' is incomplete.

/Usr/include/Linux/module. h: 49: error: the type of the field 'kobj 'is incomplete.

Zariphix_modules_001.c: In the 'init _ module' function:

Zariphix_modules_001.c: 5: Warning: Implicit declaration function 'printk'
Make :***
[Zariphix_modules_001.o] Error 1

What's going on?

Solve this problem because my machine does not have the kernel source code tree.

I compiled a new kernel source code package, but it was not installed. Make again.

But a new problem occurs again. When I use insmod to load the module, the following message is displayed:

Insmod: Error inserting 'zariphix _ modules_001.ko ':-1 invalid module format

Depressed. I tried to use absolute and relative paths and modprobe for loading. errors are displayed. What is the problem?

And finally solved it ~~~

The compiled kernel is installed ~~ OK.



Address: http://blog.chinaunix.net/uid-22028566-id-1802957.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.