Instead you could write a file called makefile like this: That would work, but it doesn’t scale well to a substantial piece of software (like DOGS which takes more than 15 minutes to compile from the ground up on my MacBook). Of course, you could just run all three commands every time. (BTW– the particulars of the command lines exhibited here depend on our software environment. Phew! What a hassle! There is a lot to remember and several chances to make mistakes. Check if tool.o is newer than tool, and if so run a command like g -g tool.o support.o -L/sw/lib/root -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint \ -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lz -L/sw/lib -lfreetype -lz -Wl,-framework,CoreServices \ -Wl,-framework,ApplicationServices -pthread -Wl,-rpath,/sw/lib/root -lm -ldl.Check if either support.hh or are newer than tool.o, and if so run a command like g -g -c -pthread -I/sw/include/root.Check if either or support.hh is newer than support.o, and if so run a command like g -g -c -pthread -I/sw/include/root.Suppose that you have a directory containing: tool tool.o support.hh, and support.o which depend on root and are supposed to be compiled into a program called tool, and suppose that you’ve been hacking on the source files (which means the existing tool is now out of date) and want to compile the program. That is, it takes care of knowing what commands need to be executed in what order to take your software project from a collection of source files, object files, libraries, headers, etc., etc.-some of which may have changed recently-and turning them into a correct up-to-date version of the program.Īctually, you can use Make for other things too, but I’m not going to talk about that. The tool called Make is a build dependency manager. ![]() Or You Never Forget The First Time You Got MadeĪn introductory discussion of make, and how to write a simple makefile That’s just a detail related to the original audience for this document. One thing to note is that root-config is a utility which provides the right compilation and linking flags and the right libraries for building applications against root. Since this is for Unix, the executables don’t have any extensions.
0 Comments
Leave a Reply. |