Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
Python and Tcl - public course schedule [here]
Private courses on your site - see [here]
Please ask about maintenance training for Perl, PHP, Lua, etc
What is make? What is gcc?

Make is a tool which lets you define a whole series of commands you need to run to get from the basic data and program source files that you work on during development, or distribute to your technical customers into the final product / products that you need.

Typically and traditionally, make reads a file called makefile that takes a series of instructions on the commands that are used to make a "target" from a "dependency", and runs those instructions if (and only if) the target doesn't exist, or is older than any of its dependencies. The order of operations is taen into account, with some targets in a process being dependencies for the next stage of the process. Make is very clever in that it allows you to make a very limited number of changes in your sources, and will then only rerun the steps needed when your rebuild your final produt, skipping those unchanged. However, make is only the pilot and not the aircraft - it only controls the work rather than doing the hard work, and it's of no use without its tools of trade such as gcc

Gcc is the tool which converts your C or C++ (or other language) into binary 'object' files for your target processor and operating system, then connects these object files and standard libraries together into a final executable program file. There are a number of intermediate steps (usually run in an automatic sequence), and the gcc command bolts these steps together depending on command line options given to it, which can be long and complex. That's one of the reasons you need a script (or, better, a makefile) so you don't have to keep re-keying the steps at the keyboard.

Although "gcc" stood initially fot the "Gnu C Compiler", it's now the "Gnu Compiler Collection" and to it's no longer just C ... C++ is an obvious extension but it will handle other languages like Fortran and Java (via gcj) for example.

For the bash scripting course I ran last week, I provided a brief "hello world" intorduction to make and the compiler tools. Two program source files were provided - demo.c and more.c - the main program and subsidiary functions for a little C demonstration. I also provided a simple makefile to store / reuse / control the various invocations of gcc needed to build the final executable program.

Although the tradiational, and taught, use of make is in building executable programs, it can also be used for other jobs with similar characteistings - be it to build a website, documentation, a database. For example, the makefile that's distributed with the Apache httpd web server not only builds the executable, but also the documentation. And a separate make process can be used to go through the multisteps to install the executabela and documentation

Such a clever idea there are other tools that do something similar - you have ant for the Java world, and in Ruby you have rake which you'll typically use to rake over the results of one of your tests on a database and prepare for the next test - removing damaged tables and re-creating them from source data. It's not a compile, but it's very much a process of the same pattern.
(written 2015-11-28)

Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
A168 - Web Application Deployment - Compiler and development tools
  [4013] Web Frameworks - nested templates - (2013-02-22)
  [3666] Makefile variables - defined internally, from the command line and from the environment - (2012-03-22)
  [3658] Using Make for a distribution - (2012-03-17)
  [3652] A Complete makefile example - (2012-03-14)
  [3651] Makefile - some basics, and a demonstration - (2012-03-13)
  [3632] What is Make? - (2012-03-02)
  [3053] Make - automating the commands for building and installing - (2010-11-16)
  [2674] Make and makefiles - a commented example to help you learn - (2010-03-12)
  [1671] Compiling C programs with gcc - an overview - (2008-06-10)
  [694] Ant and Make - (2006-04-22)

Back to
Bash ... some new scripts to - handling user input
Previous and next
Horse's mouth home
Forward to
Extending your bash shell with aliases, functions and extra commands
Some other Articles
Principles or a GUI and their practical application using wxPthon
What teach you in a week stays with you for a decade
shell - bash. Writing conditional tests and statements - the options available
Extending your bash shell with aliases, functions and extra commands
What is make? What is gcc?
Bash ... some new scripts to - handling user input
Back in the saddle again - excellent open source course from Well House Consultants
A near-empty plate of pastries - sign of a breakfast enjoyed
Thin application, thick objects - keep you main code simple. Example in Ruby
Easy example - data record to object and object to data record mapping in Ruby
4759 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 at 50 posts per page

This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2019: 404 The Spa • Melksham, Wiltshire • United Kingdom • SN12 6QL
PH: 01225 708225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/mouth/4585_Wha ... -gcc-.html • PAGE BUILT: Sat May 27 16:49:10 2017 • BUILD SYSTEM: WomanWithCat