Makefile Error: No such file or directory, no input files

前端 未结 1 500
情话喂你
情话喂你 2021-01-27 13:06

I\'m having some issues with the makefile I made:

CC=gcc                         # Compiler variable
CFLAGS=-Wall -m32    # Options passed to the compiler
DEPS =         


        
相关标签:
1条回答
  • 2021-01-27 13:34

    Here:

    source1.o: source1.c
            $(CC) -o source1 source1.c $(CFLAGS)
    

    You have specified the output file as source1 when you meant source1.o. This should be:

    source1.o: source1.c
            $(CC) -c -o source1.o source1.c $(CFLAGS)
    

    You can use automatic variables like $@ (for the target) and $< (for the first prerequisite) to avoid silly typos like that.

    0 讨论(0)
提交回复
热议问题