CC = g++ LD = g++ RM = rm -f CFLAGS = EXECNAME = main SOURCES := $(wildcard *.cpp) OBJECTS := $(patsubst %.cpp,%.o, $(SOURCES)) all: main .o: $(CC) -c $(CFLAGS) $< $(EXECNAME): $(OBJECTS) $(CC) $(OBJECTS) -o $(EXECNAME) clean: $(RM) $(EXECNAME) distclean: clean $(RM) *.o