# Configuration section ------------------------------------------------------- outputName := connectfive # Filename to give to final executable cppExtension := .cpp # File extension of source files CPPFLAGS += -I /usr/local/include # List flags to pass to C/C++ preprocessor CXXFLAGS += -Wall -O0 -g # List flags to pass to C++ compiler LDFLAGS += -L /usr/local/lib -L /usr/X11R6/lib # List flags to pass to linker LDLIBS += -lGLU32 -lOPENGL32 `sdl-config --libs` # List additional system libraries to link with default : incremental # Generate intermediates variables and files ---------------------------------- CXXFLAGS += -MMD # update the makefiles on every compilation # Create a lists of object and .d files to create - one for each source file in the directory allCppMakes := ${patsubst %${strip ${cppExtension}},%.d,${wildcard *${cppExtension}}} allCppObjects = ${allCppMakes:.d=.o} # make any non-existant make files (using the g++ preprocessor) ${allCppMakes} : %.d : %${cppExtension} ${CXX} ${CPPFLAGS} -MM $< > $@ ifneq (${MAKECMDGOALS},clean) include ${allCppMakes} # include the generated make files, which make the object files endif # Final targets --------------------------------------------------------------- .PHONY : clean incremental full full : clean incremental incremental : ${outputName} clean : rm -f *.o *~ *.d ${outputName} : ${allCppObjects} g++ -o $@ $^ ${LDFLAGS} ${LOADLIBES} ${LDLIBS}