-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (33 loc) · 1.1 KB
/
Makefile
File metadata and controls
42 lines (33 loc) · 1.1 KB
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
# @author Michael E. Cotterell <mepcott@uga.edu>
#
# If you decide to modify the examples in place, then please consider the
# following... This Makefile makes the following assumptions about each example:
#
# 1. Is self-contained inside of its source (.cpp) file.
# 2. Source file contains a main function.
# 3. Source file does not include any non-standard headers.
# 4. If the source file is called %.cpp, then the target executable is %.
#
#
#DISCLAIMER: We have used Cotterell's system calls makefiles for our project because it best suited our needs.
#Signed: John Michael Kovachi and Joshua Anickat
CC = g++
DEBUG = -g -Wall -O0 -pedantic-errors
CFLAGS=-std=c++14
LFLAGS=-std=c++14
COMPILE=$(CC) $(DEBUG) $(CFLAGS) -c
LINK=$(CC) $(DEBUG) $(LFLAGS)
RM=rm -f
SRC=$(wildcard *.cpp)
OBJ=$(SRC:%.cpp=%.o)
EXE=$(OBJ:%.o=%)
.SUFFIXES: .cpp .o
.PHONY: clean all
all: $(EXE)
$(filter %.o, $(OBJ)): %.o: %.cpp
$(COMPILE) $<
$(filter %, $(EXE)): %: %.o
$(LINK) -o $@ $<
clean:
@$(foreach exe, $(EXE), echo $(RM) $(exe); ($(RM) $(exe)) || exit;)
@$(foreach obj, $(OBJ), echo $(RM) $(obj); ($(RM) $(obj)) || exit;)