CFLAGS= -I/usr/include/ -O LDFLAGS= -lglut sources= C_3DObject.cpp \ C_Hand.cpp \ C_MatchBloxEngine.cpp \ C_Block.cpp \ C_Log.cpp \ bitmap.cpp \ C_Environment.cpp \ C_Box.cpp \ main.cpp objects= $(sources:.cpp=.o) all: MatchBloxEngine MatchBloxEngine: $(objects) $(CC) $(LDFLAGS) -o $@ $(objects) #automatically generate targets with their dependencies %.d: %.cpp @set -e; rm -f $@; \ $(CC) -M $(CFLAGS) $< > $@.$$$$; \ sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ #include the automatically generated targets include $(sources:.cpp=.d) clean: -rm MatchBloxEngine $(objects) *.d *.d.*