I have the following project structure (using eclipse)
project/
|____ inc/
| |___ config_prog.h
| |___ prog_lib.h
|
|____ data/
| |___ img.bmp
|
|__ prog_lib.c
|__ main.c
|__ makefile
And i made the following makefile :
CC=gcc
CFLAGS= -O0 -c -Wall -mavx2 -mfma
LDFLAGS=
SOURCES=$ main.c inc/prog_lib.c
OBJECTS=$(SOURCES:.c=.o)
EXECUTABLE=main
all: $(TASKMAP) $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) -o $@ -lm
.c.o:
$(CC) $(CFLAGS) $< -lm -o $@
clean:
rm -fr $(OBJECTS) $(EXECUTABLE)
but when i try to build the project i get the following error:make: *** No rule to make target 'inc/prog_lib.c', needed by 'all'. Stop.
Could someone tell me the problem?
See Question&Answers more detail:os