Do not ignore a precondition that does not exist.

make continues to build and says that everything is relevant when the dependency files say that the object depends on the moved header file.

If you run make -dto fix the score, I see:

Considering target file `../build/out/src/manager.o'.
     Looking for an implicit rule for `../build/out/src/manager.o'.
     No implicit rule found for `../build/out/src/manager.o'.
      Pruning file `../product/build/config/product.conf'.
      Pruning file `../build/out/opt_cc.txt'.
      Considering target file `../mem/src/manager.c'.
       Looking for an implicit rule for `../mem/src/manager.c'.
       No implicit rule found for `../mem/src/manager.c'.
       Finished prerequisites of target file `../mem/src/manager.c'.
      No need to remake target `../mem/src/manager.c'.
      Pruning file `../mem/mem.h'.
     Finished prerequisites of target file `../build/out/src/manager.o'.
     Prerequisite `../product/build/config/product.conf' is older than target `../build/out/src/manager.o'.
     Prerequisite `../build/out/opt_cc.txt' is older than target `../build/out/src/manager.o'.
     Prerequisite `../mem/src/manager.c' is older than target `../build/out/src/manager.o'.
     Prerequisite `../mem/mem.h' of target `../build/out/src/manager.o' does not exist.
../build/out/src/manager.o'.
     Prerequisite `../mem/mem_in.h' is older than target `../build/out/src/manager.o'.
    No need to remake target `../build/out/src/manager.o'.

So, make knows that the file is needed and does not exist, but does not try to create it from the rule or not execute.

Prerequisite `../mem/mem.h' of target `../build/out/src/manager.o' does not exist.

Why is this and how can I make make not ignore this rule?

+4
source share
2 answers

, , make , , . makefile:

foo: foo.h ; @echo make $@ from $^

foo.h, make :

$ make
make: **** No rule to make target 'foo.h', needed by 'foo'.  Stop.

make :

foo: foo.h ; @echo make $@ from $^
foo.h:

:

$ make
make foo from foo.h

, : make , .

, - , , (, ).

+6

, , . :

%.o : %.c
    *recipe here*

, :

$(OBJECTS): %.o: %.c
    *recipe here*

OBJECTS make ( ), :

OBJECTS := src/fileA.c src/fileB.c src/fileC.c

, make . , $(wildcard pattern), $(addsuffix) ..

makefile, , . make, , make -d " ", make .

, make 90 , . make , .

:

  • . , make , .

  • ( ) , , . (, , ... 100 .)

  • , make , .

  • make -r .

, , , .

, , , () , . , , make - , . , make , .

- ​​ make. , , , make.

: (16 2016 .). , make , . make " ", , " ", , make , , make .

( ), , , , " ", , .

, , .SECONDARY - . , - , make , .

+3

Source: https://habr.com/ru/post/1542718/


All Articles