make_tutorial

make_tutorial - Compiling programs Make Tutorial For : COP...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Make Tutorial For : COP 3330. Object oriented Programming (Using C++) http://www.compgeom.com/~piyush/teach/3330 Piyush Kumar Compiling programs | Single source file code: z g++ -g –Wall main.cpp –lm –o main | Multiple sources [a,b] z g++ -g –c –Wall a.cpp z g++ -g –c -Wall b.cpp z g++ -g –o main a.o b.o -lm Compiler flags | -c Separate compilation flag. Will produce a ``.o'' file only, without linking. | -g The application will have full debug capabilities, but almost no optimization will be performed on the application, leading to lower performance. | -Wall Enable all warnings. | -o filename Write output to file. For more options: “man g++” Compilation | Multi stage process z g++ -g main.cpp –lm –o main g++ -g -c main.cpp –o main.o g++ -g main.o main z Compiling and Linking Compilation : Produces object code ( main.o ) Linking : Produces executable by linking a collection of object files and libraries. A Typical Software Project | Has 10s to 100s of source files | Multiple directories | Multiple authors | Flags : Differ with compilation z Debugging flags ( - g ) z Optimization flags ( - O6 malign-double ) z Release Vs Test builds. | Make: A tool to automate the build process.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

make_tutorial - Compiling programs Make Tutorial For : COP...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online