forked from aaronbloomfield/pdr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (30 loc) · 1.17 KB
/
Makefile
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
# Makefile for CS 2150 pre-lab 8
# This Makefile shows how to link assembly with C/C++
# Defines the C++ compiler we'll be using
CXX = g++ -m32
# Defines the flags we'll be passing to the C++ compiler
CXXFLAGS = -Wall -g
# Defines the assembler
AS = nasm
# Defines the flags for the assembler
ASFLAGS = -f elf -g
# All of the .o files for our program
OFILES = vecsum.o main.o
# This tells make to create a .o file from a .cpp file, using the
# defaults above (i.e. the CXX and CXXFLAGS macros)
.SUFFIXES: .o .cpp
# This tells make to create a .o file from a .s file, using the
# defaults above (i.e. the AS and ASFLAGS macros)
.SUFFIXES: .o .s
# How to compile our final program. Note that we do NOT specify an
# output executable name -- in order for this to work with the grading
# system, the file needs to be a.out (a.exe in Cygwin).
main: $(OFILES)
$(CXX) $(CXXFLAGS) $(OFILES)
# This will clean up (remove) all our object files. The -f option
# tells rm to forcily remove the files (i.e. don't ask if they should
# be removed or not). This removes object files (*.o) and Emacs
# backup files (*~)
clean:
/bin/rm -f *.o *~
# We don't have any dependencies for this small program