2
votes

I got the following error

make: *** No rule to make target `stretchy_buffer.o', needed by `tsh'.  Stop

Trying to make this makefile

SRCS = stretchy_buffer.c def.c tsh_builtin_commands.c tsh_jobs.c tsh_main.c tsh_routines.c tsh_signals.c
OBJS = $(SRCS:.c=.o)

tsh: $(OBJS)
    gcc -Wall -g -o tsh $(OBJS)
1

1 Answers

8
votes

You need to add following rule in your makefile:

CFLAGS = -Wall -g

%.o:%.c
    gcc $(CFLAGS) $< -o $@

In your existing makefile, there is no rule specified for obtaining *.o from *.c files and, hence, the error is reported.