Difference between revisions of "Makefile"

From Linuxintro
imported>ThorstenStaerk
imported>ThorstenStaerk
Line 1: Line 1:
 
<pre>
 
<pre>
duffman:~/hello # cat main.c  
+
cat >main.c <<EOF
 
#include <stdio.h>
 
#include <stdio.h>
  
Line 7: Line 7:
 
   printf("hello world");
 
   printf("hello world");
 
}
 
}
duffman:~/hello # cat Makefile  
+
EOF
 +
cat >Makefile <<EOF
 
all:hello
 
all:hello
  
 
hello: main.c
 
hello: main.c
 
         gcc main.c -o hello
 
         gcc main.c -o hello
 +
EOF
 
</pre>
 
</pre>
  

Revision as of 15:20, 6 February 2011

cat >main.c <<EOF
#include <stdio.h>

int main()
{
  printf("hello world");
}
EOF
cat >Makefile <<EOF
all:hello

hello: main.c
        gcc main.c -o hello
EOF

See also

todo