I have received an error when i launched "make"
I didn't know where is the problem.
I guess in the makefile.
Can you help me !Thanks :)
make: Circular src/amqp_consommateur.c <- obj/amqp_consommateur.o
dependency dropped. make: Circular src/amqp_producteur.c <-
obj/amqp_consommateur.o dependency dropped. make: Circular
src/amqp_producteur.c <- obj/amqp_producteur.o dependency dropped. gcc
obj/amqp_consommateur.o obj/amqp_producteur.o -o amqp_consommateur
amqp_producteur -L. -lamqp gcc: error: obj/amqp_consommateur.o: No
such file or directory gcc: error: obj/amqp_producteur.o: No such file
or directory gcc: error: amqp_producteur: No such file or directory
make: *** [src/amqp_producteur.c] Error 1
CC := gcc
CFLAGS := -Wall -Werror -g
SRCDIR := src
OBJDIR := obj
LDFLAGS :=
LIBS := -L. -lamqp
PROG := amqp_consommateur amqp_producteur
SRCS_RAW := amqp_consommateur.c amqp_producteur.c
#addprefix : src/amqp_consommateur obj/amqp_consommateur.o
SRCS := $(addprefix $(SRCDIR)/,$(SRCS_RAW))
OBJS := $(addprefix $(OBJDIR)/,$(SRCS_RAW:.c=.o))
.PHONY: all
all: $(OBJS)
@echo "$(MAKE) : Tout est généré"
$(SRCS) : $(OBJS)
$(CC) $(OBJS) -o $(PROG) $(LIBS)
#rule to create object directory if it doesnt exist
$(OBJDIR):
mkdir $(OBJDIR)
#define implicit rule to build objects in their own directory
#(note -- order only dependency on object directory)
$(OBJS): $(OBJDIR)/%.o: $(SRCDIR)/%.c | $(OBJDIR)
$(CC) $(CFLAGS) -c $<
.PHONY: clean
clean:
$(RM) *~ $(EXEC)
$(RM) -r $(OBJDIR)
question from:
https://stackoverflow.com/questions/65915701/gcc-no-such-file-or-directory 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…