Try something extremely basic like:
Code:
clean :
$(RM) src/*.o
However, I'm a bit surprised that your Makefile does not have an alias for the object files that you want removed. Here's a real simple Makefile (for a C project) where the source code is in the src/ directory:
Code:
APP = myapp
SRCS = $(wildcard src/*.c)
OBJS = $(SRCS:.c=.o)
CFLAGS = -Wall -pedantic -c
LDFLAGS =
.PHONY: all clean distclean
all : $(APP)
$(APP) : $(OBJS)
$(CC) $^ $(LDFLAGS) -o $@
%.o : %.c
$(CC) $(CFLAGS) $^ -o $@
clean :
$(RM) $(OBJS)
distclean : clean
$(RM) $(APP)