CC = gcc LD = gcc RM = rm -f TARGET = main LFLAGS += -lstdc++ SRCS := $(wildcard *.cpp) OBJS := $(patsubst %.cpp,%.o, $(SRCS)) all: main %.o: %.cpp $(CC) -c $(CFLAGS) $< -o $@ $(TARGET): $(OBJS) $(LD) $^ $(LFLAGS) -o $@ clean: $(RM) $(TARGET) $(OBJS) compile_commands: clean compiledb make