C/C++ make: don't know how to make src/%.c

vince66

Well-Known Member

Thanks: 10
Messages: 389

#1
Hello Guys !

I'm trying to compile a program, but the make gives me the error:

make: don't know how to make src/%.c. Stop

The makefile follow:

C:
CC=gcc
LDIR=src/libs
ODIR=src/objs
CFLAGS=-Wall -I$(LDIR)

$(ODIR)/%.o: src/%.c
    $(CC) $(CFLAGS) -c -o $@ $<

all: clean fat-util

fat-util: $(ODIR)/main.o $(ODIR)/fat.o $(ODIR)/commands.o
    ${CC} $(CFLAGS) -o fat-util $(ODIR)/*.o

clean:
    rm -f $(ODIR)/*.o *~ fat-util
Can you help me please to understand ?

Thanks in advance.
 
Top