CROSS= CC=g++ CFLAGS=-g -Wall $(CROSS) LFLAGS=$(CROSS) OBJS=Square.o Magic.o # rule for building the executable Magic: $(OBJS) $(CC) -o Magic $(LFLAGS) $(OBJS) default: Magic all: Magic # list of file dependencies Magic.o: Magic.cpp Square.o: Square.cpp Square.h # the following rule is used to compile .cpp files to .o .cpp.o: $(CC) $(CFLAGS) -c $< # the following removes all .o files, but leaves the executable clean: rm -f *.o