4 <h1><a name=
"make" id=
"make">Make
</a></h1>
9 <a href=
"http://www.gnu.org/software/make/" class=
"urlextern" title=
"http://www.gnu.org/software/make/" rel=
"nofollow">Make
</a>:
<a href=
"http://en.wikipedia.org/wiki/Make_(software)" class=
"interwiki iw_wp" title=
"http://en.wikipedia.org/wiki/Make_(software)">Make
</a>
11 <div class=
"plugin_uparrow">
12 <a href=
"#" title=
"Back to top">
13 <img src=
"lib/plugins/uparrow/images/tango-small.png" alt=
"Back to top"/>
18 <!-- SECTION "Make" [1-93] -->
19 <h2><a name=
"smart_makefile" id=
"smart_makefile">Smart Makefile
</a></h2>
24 <a href=
"http://www-etud.iro.umontreal.ca/~petitg/cpp/makefile.html" class=
"urlextern" title=
"http://www-etud.iro.umontreal.ca/~petitg/cpp/makefile.html" rel=
"nofollow">Here
</a>.
26 <div class=
"plugin_uparrow">
27 <a href=
"#" title=
"Back to top">
28 <img src=
"lib/plugins/uparrow/images/tango-small.png" alt=
"Back to top"/>
33 <!-- SECTION "Smart Makefile" [94-191] -->
34 <h2><a name=
"simple_makefile" id=
"simple_makefile">Simple Makefile
</a></h2>
39 This assumes a program.cpp source file.
42 <dt><a href=
"/~kssilveira/site/doku.php?do=export_code&id=tools:make&codeblock=0" title=
"Download Snippet" class=
"mediafile mf_">makefile
</a></dt>
43 <dd><pre class=
"code file make">all
<span class=
"sy0">:
</span> program
44 <span class=
"sy0">./
</span><span class=
"re0">$
<</span>
45 touch
<span class=
"re0">$
<</span>
46 CXXFLAGS
<span class=
"sy0">=
</span> <span class=
"sy0">-
</span>Wall
</pre>
52 <pre class=
"code bash">$
<span class=
"kw2">ls
</span>
54 $
<span class=
"kw2">make
</span>
55 <span class=
"kw2">g++
</span> <span class=
"re5">-Wall
</span> <span class=
"re5">-o
</span> program program.cpp
56 .
<span class=
"sy0">/
</span>program
57 <span class=
"kw2">touch
</span> program
58 $
<span class=
"kw2">ls
</span>
59 program program.cpp makefile
60 $
<span class=
"kw2">make
</span>
61 .
<span class=
"sy0">/
</span>program
62 <span class=
"kw2">touch
</span> program
</pre>
63 <div class=
"plugin_uparrow">
64 <a href=
"#" title=
"Back to top">
65 <img src=
"lib/plugins/uparrow/images/tango-small.png" alt=
"Back to top"/>
70 <!-- SECTION "Simple Makefile" [192-521] -->
71 <h2><a name=
"how_to_do_a_programming_competition_makefile" id=
"how_to_do_a_programming_competition_makefile">How to do a Programming Competition Makefile
</a></h2>
74 <dt><a href=
"/~kssilveira/site/doku.php?do=export_code&id=tools:make&codeblock=2" title=
"Download Snippet" class=
"mediafile mf_">makefile
</a></dt>
75 <dd><pre class=
"code file make">PROG
<span class=
"sy0">=
</span> a
77 all
<span class=
"sy0">:
</span> <span class=
"sy0">$
</span><span class=
"br0">(</span><span class=
"re2">PROG
</span><span class=
"br0">)</span> <span class=
"sy0">$
</span><span class=
"br0">(</span><span class=
"re2">PROG
</span><span class=
"br0">)</span><span class=
"sy0">.
</span>in
78 <span class=
"sy0">./$
</span><span class=
"br0">(</span><span class=
"re2">PROG
</span><span class=
"br0">)</span> <span class=
"sy0"><</span> <span class=
"sy0">$
</span><span class=
"br0">(</span><span class=
"re2">PROG
</span><span class=
"br0">)</span><span class=
"sy0">.
</span>in
79 <span class=
"sy0">@
</span>touch
<span class=
"sy0">$
</span><span class=
"br0">(</span><span class=
"re2">PROG
</span><span class=
"br0">)</span>
81 <span class=
"sy0">$
</span><span class=
"br0">(</span><span class=
"re2">PROG
</span><span class=
"br0">)</span><span class=
"sy0">:
</span> <span class=
"sy0">$
</span><span class=
"br0">(</span><span class=
"re2">PROG
</span><span class=
"br0">)</span><span class=
"sy0">.
</span>cpp
82 g
<span class=
"sy0">++
</span> <span class=
"sy0">-
</span>o
<span class=
"sy0">$
</span><span class=
"br0">(</span><span class=
"re2">PROG
</span><span class=
"br0">)</span> <span class=
"sy0">$
</span><span class=
"br0">(</span><span class=
"re2">PROG
</span><span class=
"br0">)</span><span class=
"sy0">.
</span>cpp
<span class=
"sy0">-
</span>Wall
84 <span class=
"sy0">$
</span><span class=
"br0">(</span><span class=
"re2">PROG
</span><span class=
"br0">)</span><span class=
"sy0">.
</span>cpp
<span class=
"sy0">:
</span>
85 <span class=
"sy0">@
</span>touch
<span class=
"sy0">$
</span><span class=
"br0">(</span><span class=
"re2">PROG
</span><span class=
"br0">)</span><span class=
"sy0">.
</span>cpp
87 <span class=
"sy0">$
</span><span class=
"br0">(</span><span class=
"re2">PROG
</span><span class=
"br0">)</span><span class=
"sy0">.
</span>in
<span class=
"sy0">:
</span>
88 <span class=
"sy0">@
</span>touch
<span class=
"sy0">$
</span><span class=
"br0">(</span><span class=
"re2">PROG
</span><span class=
"br0">)</span><span class=
"sy0">.
</span>in
90 clean
<span class=
"sy0">:
</span>
91 rm
<span class=
"sy0">-
</span>f
<span class=
"sy0">*.
</span>o
<span class=
"sy0">*
</span>~
</pre>
93 <div class=
"plugin_uparrow">
94 <a href=
"#" title=
"Back to top">
95 <img src=
"lib/plugins/uparrow/images/tango-small.png" alt=
"Back to top"/>
100 <!-- SECTION "How to do a Programming Competition Makefile" [522-827] -->
101 <h2><a name=
"how_to_install_colormake" id=
"how_to_install_colormake">How to install colormake
</a></h2>
103 <pre class=
"code bash">$
<span class=
"kw2">sudo
</span> <span class=
"kw2">apt-get
</span> <span class=
"kw2">install
</span> colormake
104 $
<span class=
"kw3">cd
</span> <span class=
"sy0">/
</span>usr
<span class=
"sy0">/
</span>local
<span class=
"sy0">/
</span>bin
105 $
<span class=
"kw2">sudo
</span> <span class=
"kw2">ln
</span> <span class=
"re5">-s
</span> <span class=
"sy0">/
</span>usr
<span class=
"sy0">/
</span>bin
<span class=
"sy0">/
</span>colormake
<span class=
"kw2">make
</span></pre>
106 <div class=
"plugin_uparrow">
107 <a href=
"#" title=
"Back to top">
108 <img src=
"lib/plugins/uparrow/images/tango-small.png" alt=
"Back to top"/>
113 <!-- SECTION "How to install colormake" [828-976] -->
114 <h2><a name=
"how_to_access_an_index_of_a_list" id=
"how_to_access_an_index_of_a_list">How to access an index of a list
</a></h2>
116 <pre class=
"code make">all
<span class=
"sy0">:
</span> prog1 prog2
117 <span class=
"sy0">./
</span><span class=
"re0">$
<</span>
118 <span class=
"sy0">./$
</span><span class=
"br0">(</span><span class=
"re1">word
</span> 2<span class=
"sy0">,
</span> <span class=
"re0">$^
</span><span class=
"br0">)</span></pre>
119 <div class=
"plugin_uparrow">
120 <a href=
"#" title=
"Back to top">
121 <img src=
"lib/plugins/uparrow/images/tango-small.png" alt=
"Back to top"/>
126 <!-- SECTION "How to access an index of a list" [977-1085] -->
127 <h2><a name=
"how_to_make_latex_with_bibtex" id=
"how_to_make_latex_with_bibtex">How to make latex with bibtex
</a></h2>
129 <pre class=
"code make">DOC
<span class=
"sy0">=
</span> document_name
130 all
<span class=
"sy0">:
</span>
131 pdflatex
<span class=
"sy0">$
</span><span class=
"br0">(</span><span class=
"re2">DOC
</span><span class=
"br0">)</span><span class=
"sy0">.
</span>tex
132 bibtex
<span class=
"sy0">$
</span><span class=
"br0">(</span><span class=
"re2">DOC
</span><span class=
"br0">)</span>
133 pdflatex
<span class=
"sy0">$
</span><span class=
"br0">(</span><span class=
"re2">DOC
</span><span class=
"br0">)</span><span class=
"sy0">.
</span>tex
134 pdflatex
<span class=
"sy0">$
</span><span class=
"br0">(</span><span class=
"re2">DOC
</span><span class=
"br0">)</span><span class=
"sy0">.
</span>tex
136 clean
<span class=
"sy0">:
</span>
137 rm
<span class=
"sy0">-
</span>rf
<span class=
"sy0">*.
</span>aux
<span class=
"sy0">*.
</span>nav
<span class=
"sy0">*.
</span>out
<span class=
"sy0">*.
</span>log
<span class=
"sy0">*.
</span>snm
<span class=
"sy0">*.
</span>toc
<span class=
"sy0">*.
</span>vrb
<span class=
"sy0">*
</span>~
<span class=
"sy0">*.
</span>o
<span class=
"sy0">*.
</span>bbl
<span class=
"sy0">*.
</span>blg
<span class=
"sy0">*.
</span>lof
<span class=
"sy0">*.
</span>lot
</pre>
138 <div class=
"tags"><span>
139 <a href=
"/~kssilveira/site/doku.php?id=tag:programming&do=showtag&tag=tag%3Aprogramming" class=
"wikilink1" title=
"tag:programming" rel=
"tag">programming
</a>
141 <div class=
"plugin_uparrow">
142 <a href=
"#" title=
"Back to top">
143 <img src=
"lib/plugins/uparrow/images/tango-small.png" alt=
"Back to top"/>
148 <!-- SECTION "How to make latex with bibtex" [1086-] -->