More Related Content
Similar to "make" system(20)
More from Anil Kumar Pugalia
More from Anil Kumar Pugalia(9)
"make" system
- 2. What to Expect?
What is 'make' & its System?
Learning 'make' by Examples
© 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 2
All Rights Reserved.
- 3. What is 'make'?
Tool to automatically execute commands
Any number, Any length
Based on complete dependency chains
Typically based on time (of change)
Majorly replacing the manual process
Effectively saving time & manual errors
Typical usages
Project build system (compilation, etc)
Packaging files (binaries, documentation, source code)
Installations (of Systems, Packages, ...)
Anything that can be automated based on dependencies
© 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 3
All Rights Reserved.
- 4. Usage of 'make'
Initiated by the command 'make'
Controlled by its configuration files
Containing rules to execute various commands
Based on various target dependencies
Default configuration files
GNUmakefile, makefile, Makefile (in that order)
Other configuration file using -f
Assisted by many in-built rules & variables
© 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 4
All Rights Reserved.
- 6. Sample Makefile
xyz: abc
cp abc xyz
abc: pqr
cp pqr abc
pqr:
touch pqr
© 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 6
All Rights Reserved.
- 7. Let's create a Makefile
for
Automatically compiling a C program
© 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 7
All Rights Reserved.
- 8. Extending the Makefile
Build an executable from many C files
Build a project with 10,000 C files
Add the user's header file dependencies
Automatic header dependency generation
© 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 8
All Rights Reserved.
- 9. What all have we learnt?
'make' & its benefits
Usage of 'make'
Examples of using 'make'
© 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 9
All Rights Reserved.