Error in makefile (“no input files”)

前端 未结 2 1952
故里飘歌
故里飘歌 2021-01-28 07:38

This is my absolute first time ever making a makefile, and I\'m really trying to understand the process.

I\'m trying to create a very simple makefile for a C++ project w

2条回答
  •  青春惊慌失措
    2021-01-28 08:17

    IDIR=include .
    

    is the first problem. Replace it by:

    IDIR=include
    

    With your code CFLAGS is expanded as:

    -Iinclude .
    

    It does not make sense, I'm afraid. The second problem is:

    DEPS=$(patsubst %,$(IDIR)/,%(_DEPS))
    

    which should probably be:

    DEPS=$(patsubst %,$(IDIR)/%,$(_DEPS))
    

    and would expand as:

    DEPS=include/hello.h
    

    if you fix the first problem, else as:

    DEPS=include ./hello.h
    

    which does not make sense neither. The cumulated effect of these two errors are strange recipes (I didn't try to expand them by hand) that probably trigger a make implicit rule with wrong parameters.

提交回复
热议问题