-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (50 loc) · 1.64 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Author: Eric Claerhout, Henry Lin
# Student ID: 1532360, 1580649
# CMPUT 275 Winter 2019
#
# Final Project: Starbucks Simulator
# ##################################
# Compiler Settings
CC = g++
CFLAGS = -c -Wall -O2 -std=c++11
LFLAGS = -lncurses
# Directories
SRC_DIR = src
ALGS_DIR = algs
OBJ_DIR = obj
VPATH = $(SRC_DIR):$(SRC_DIR)/$(ALGS_DIR)
# Program and Objects
PROGRAM = starbucksSimulator
OBJS = starbucksSimulator.o ui.o uiHelper.o cpu.o strProcess.o levenshtein-distance.o soundex.o nysiis.o metaphone.o
###############
# BUILD RULES #
###############
$(PROGRAM): $(OBJ_DIR) $(addprefix $(OBJ_DIR)/,$(OBJS))
$(CC) $(addprefix $(OBJ_DIR)/,$(OBJS)) -o $(PROGRAM) $(LFLAGS)
$(OBJ_DIR)/starbucksSimulator.o: starbucksSimulator.cpp ui.h gameController.h
$(CC) $< -o $@ $(CFLAGS)
$(OBJ_DIR)/ui.o: ui.cpp ui.h uiHelper.h
$(CC) $< -o $@ $(CFLAGS)
$(OBJ_DIR)/uiHelper.o: uiHelper.cpp uiHelper.h
$(CC) $< -o $@ $(CFLAGS)
$(OBJ_DIR)/cpu.o: gameController.cpp gameController.h levenshtein-distance.h soundex.h nysiis.h metaphone.h
$(CC) $< -o $@ $(CFLAGS)
$(OBJ_DIR)/strProcess.o: strProcess.cpp strProcess.h
$(CC) $< -o $@ $(CFLAGS)
$(OBJ_DIR)/levenshtein-distance.o: levenshtein-distance.cpp levenshtein-distance.h strProcess.h
$(CC) $< -o $@ $(CFLAGS)
$(OBJ_DIR)/soundex.o: soundex.cpp soundex.h strProcess.h
$(CC) $< -o $@ $(CFLAGS)
$(OBJ_DIR)/nysiis.o: nysiis.cpp nysiis.h strProcess.h
$(CC) $< -o $@ $(CFLAGS)
$(OBJ_DIR)/metaphone.o: metaphone.cpp metaphone.h
$(CC) $< -o $@ $(CFLAGS)
################
# HELPER RULES #
################
$(OBJ_DIR):
@mkdir -p $(OBJ_DIR)
.PHONY: clean
clean:
@rm -f $(addprefix $(OBJ_DIR)/,$(OBJS))
@rm -f $(PROGRAM)