Tutorial by Examples

Consider writing a "hello world!" program in c. Lets say our source code is in a file called source.c, now in order to run our program we need to compile it, typically on Linux (using gcc) we would need to type $> gcc source.c -o output where output is the name of the executable to be g...
Quick start A rule describes when and how certain files (rule's targets) are created. It can also serve to update a target file if any of the files required for its creation (target's prerequisites) are newer than the target. Rules follow the syntax below: (Note that commands following a rule are ...
if a directory contain 2 files: $ ls makefile example.txt and makefile contain the following text %.gz: % gzip $< then you can obtain example.txt.gz by typing in the shell $ make -f makefile example.txt.gz the makefile consist of only one rule that instruct make how to create a...
C:\makefile: helloWorld : [TAB]echo hello world run results: C:\>make echo hello world hello world Note: [TAB] should be replaced by an actual tab, stackoverflow replaces tabs with spaces, and spaces are not used the same as tabs in a makefile.

Page 1 of 1