forked from aaronbloomfield/pdr
-
Notifications
You must be signed in to change notification settings - Fork 228
/
Copy pathMakefile.html
42 lines (35 loc) · 2 KB
/
Makefile.html
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
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="GNU source-highlight
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite">
<title>Makefile</title>
</head>
<body style="background-color:white">
<pre><i><span style="color:#9A1900"># Makefile for CS 2150 pre-lab 8</span></i>
<i><span style="color:#9A1900"># This Makefile shows how to link assembly with C/C++</span></i>
<i><span style="color:#9A1900"># Defines the C++ compiler we'll be using</span></i>
<span style="color:#009900">CXX =</span> clang<span style="color:#990000">++</span>
<i><span style="color:#9A1900"># Defines the flags we'll be passing to the C++ compiler</span></i>
<span style="color:#009900">CXXFLAGS =</span> -Wall -g
<i><span style="color:#9A1900"># Defines the assembler</span></i>
<span style="color:#009900">AS =</span> nasm
<i><span style="color:#9A1900"># Defines the flags for the assembler</span></i>
<span style="color:#009900">ASFLAGS =</span> -f elf64 -g
<i><span style="color:#9A1900"># All of the .o files for our program</span></i>
<span style="color:#009900">OBJECTS =</span> vecsum.o main.o
<i><span style="color:#9A1900"># Compile our files into a.out</span></i>
<span style="color:#990000">a.out:</span> <span style="color:#009900">$(OBJECTS)</span>
<span style="color:#009900">$(CXX)</span> <span style="color:#009900">$(CXXFLAGS)</span> <span style="color:#009900">$(OBJECTS)</span>
<i><span style="color:#9A1900"># This will clean up (remove) all our object files. The -f option</span></i>
<i><span style="color:#9A1900"># tells rm to forcily remove the files (i.e. don't ask if they should</span></i>
<i><span style="color:#9A1900"># be removed or not). This removes object files (*.o) and Emacs</span></i>
<i><span style="color:#9A1900"># backup files (*~)</span></i>
<span style="color:#990000">clean:</span>
-rm -f <span style="color:#990000">*</span>.o <span style="color:#990000">*~</span>
</pre>
</body>
</html>