carbidecpp22devenv/configuration/org.eclipse.osgi/bundles/309/1/.cp/getting_started/cdt_w_newmake.htm
author cawthron
Fri, 04 Dec 2009 10:01:33 -0600
changeset 5 684bf18fdedf
permissions -rw-r--r--
add files for RCL_2_2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     2
<html lang="en">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     3
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     4
<head>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     5
	<meta http-equiv="Content-Language" content="en-us">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     6
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     7
	<title>Creating your makefile</title>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     8
	<link rel="stylesheet" type="text/css" href="../help.css">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     9
<script language="JavaScript">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    10
function newWin(url) {
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    11
	window.open(url, 'install_cdt', 'width=750, height=700, menubar=no, toolbar=no, status=no, resizable=yes, location=no, scrollbars=yes');
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    12
}
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    13
</script>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    14
</head>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    15
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    16
<body>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    17
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    18
<h1>Creating a makefile</h1>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    19
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    20
<p>For the purpose of this tutorial, you were instructed to create a C++ Project which requires you to create a makefile.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    21
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    22
<p>To create a makefile:</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    23
<ol>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    24
  <li>In the <b>Project Explorer</b> view, right-click the <b>HelloWorld</b> project 
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    25
  folder and select <b>New &gt; File</b>.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    26
  <li>In the <b>File name</b> box, type <b>makefile</b>.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    27
  <li>Click <b>Finish</b>.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    28
  <li>Type the gnu make instructions below in the editor. Lines are 
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    29
  indented with tab characters, not with spaces.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    30
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    31
<blockquote>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    32
  <p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    33
  <br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    34
  all: hello.exe<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    35
  <br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    36
  clean:<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    37
&nbsp;&nbsp;&nbsp; rm main.o hello.exe<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    38
  <br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    39
  hello.exe: main.o<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    40
&nbsp;&nbsp;&nbsp; g++ -g -o hello main.o<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    41
  <br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    42
  main.o:<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    43
&nbsp;&nbsp;&nbsp; g++ -c -g main.cpp<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    44
&nbsp;</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    45
</blockquote>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    46
  <li>Click <b>File &gt; 
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    47
  Save</b>.</li></ol>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    48
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    49
<p>Your new makefile, along with your main.cpp file are 
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    50
displayed in the Project Explorer view. Your project now 
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    51
contains main.cpp and makefile. You can now build your HelloWorld project.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    52
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    53
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    54
<p>NEW <a href="javascript:void(0)" onClick="newWin('../images/cdt_w_newmake02.png')">Click here to see an illustration</a>.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    55
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    56
<p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    57
<a href="cdt_w_build.htm" style="text-decoration: none">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    58
  <img border="0" src="../images/ngnext.gif" width="16" height="16" alt="Next icon"></a>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    59
  <b><a href="cdt_w_build.htm">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    60
  Next: Building your project</a><a href="cdt_w_build.htm" style="text-decoration: none"> </a>  </b>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    61
</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    62
<p align="left">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    63
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    64
<a href="cdt_w_newcpp.htm">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    65
<img border="0" src="../images/ngback.gif" width="16" height="16" alt="Back icon"></a> <b><a href="cdt_w_newcpp.htm">Back: Creating your C++ file</a></b> </p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    66
<p><img border="0" src="../images/ngconcepts.gif" ALT="Related concepts" width="143" height="21">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    67
<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    68
<a href="../concepts/cdt_o_projects.htm">Project</a><br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    69
<a href="../concepts/cdt_o_code_entry.htm">Code entry</a></p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    70
<p><img border="0" src="../images/ngtasks.gif" ALT="Related tasks" width="143" height="21">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    71
<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    72
<a href="../tasks/cdt_o_proj_files.htm">Working with C/C++ project files</a><br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    73
<a href="../tasks/cdt_o_write_code.htm">Writing code</a></p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    74
<p><img border="0" src="../images/ngref.gif" ALT="Related reference" width="143" height="21">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    75
<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    76
<a href="../reference/cdt_o_proj_prop_pages.htm">C/C++ Projects view</a></p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    77
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    78
<p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    79
<img src="../images/ng00_04a.gif" ALT="IBM Copyright Statement" >
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    80
</body>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    81
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    82
</html>