-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.in
125 lines (85 loc) · 3.21 KB
/
Makefile.in
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
SHELL = /bin/sh
BIN = bin
SOURCE = $(wildcard src/chapter*/*.cpp)
INCLUDE = include
LIBS = lib
BUILD = .build
OBJS = $(SOURCE:.cpp=.o)
DEPS = $(OBJS:.o=.d)
CFLAGS = -Wall -g
CC = g++ ${CFLAGS}
LDFLAGS =
.PHONY: clean cleandeps cleanall prep
all: chapter0 chapter1 chapter2 chapter3 chapter4 chapter6 chapter7 chapter10 chapter11 chapter12 chapter13 chapter14 chapter15
chapter0: prep hello_world
chapter1: prep working_with_strings
chapter2: prep my_framing_program framing_program
chapter3: prep simple_grade
chapter4: prep grading_program
chapter6: prep example_algorithms grading_comparison
chapter7: prep word_count gen_sentences find_xref
chapter10: prep example_array example_echo example_function_pointer example_letter_grades example_memory example_predicate example_pointer
chapter11: prep example_vec
chapter12: prep example_str
chapter13: prep university_grading
chapter14:
chapter15:
hello_world: src/chapter0/hello_world.cpp
$(CC) $? -o $(BIN)/$@
working_with_strings: src/chapter1/working_with_strings.cpp
$(CC) $? -o $(BIN)/$@
my_framing_program: src/chapter2/my_framing_program.cpp
$(CC) $? -o $(BIN)/$@
framing_program: src/chapter2/framing_program.cpp
$(CC) $? -o $(BIN)/$@
simple_grade: src/chapter3/grade.cpp
$(CC) $? -o $(BIN)/$@
grading_program: src/chapter4/grade_calc.cpp src/chapter4/median.o src/chapter4/grades.o src/chapter4/student.o
$(CC) $? -o $(BIN)/$@
example_algorithms: src/chapter6/algorithm_test.cpp src/chapter6/more_algorithms.o
$(CC) $? -o $(BIN)/$@
grading_comparison: src/chapter6/grade_analysis.cpp src/chapter6/more_algorithms.o src/chapter6/analysis_algorithm.o src/chapter4/median.o src/chapter4/grades.o src/chapter4/student.o
$(CC) $? -o $(BIN)/$@
word_count: src/chapter7/associative_arrays.cpp
$(CC) $? -o $(BIN)/$@
gen_sentences: src/chapter7/generate_sentences.cpp src/chapter6/more_algorithms.o
$(CC) $? -o $(BIN)/$@
find_xref: src/chapter7/xref.cpp src/chapter6/more_algorithms.o
$(CC) $? -o $(BIN)/$@
example_array: src/chapter10/arrays.cpp
$(CC) $? -o $(BIN)/$@
example_echo: src/chapter10/echo.cpp
$(CC) $? -o $(BIN)/$@
example_function_pointer: src/chapter10/function_pointers.cpp
$(CC) $? -o $(BIN)/$@
example_letter_grades: src/chapter10/letter_grades.cpp
$(CC) $? -o $(BIN)/$@
example_memory: src/chapter10/memory.cpp
$(CC) $? -o $(BIN)/$@
example_predicate: src/chapter10/predicate_functions.cpp
$(CC) $? -o $(BIN)/$@
example_pointer: src/chapter10/simple_pointers.cpp
$(CC) $? -o $(BIN)/$@
example_vec: src/chapter11/main.cpp src/chapter11/vec.h
$(CC) $? -o $(BIN)/$@
example_str: src/chapter12/main.cpp src/chapter12/str.h src/chapter11/vec.h
$(CC) $? -o $(BIN)/$@
university_grading: src/chapter13/main.cpp src/chapter13/student.o src/chapter13/core.cpp src/chapter13/grad.o src/chapter4/grades.o src/chapter4/median.o
$(CC) $? -o $(BIN)/$@
prep:
-mkdir -p bin .build src
install:
@echo "There is nothing worth installing"
uninstall:
@echo "Since nothing got installed, there is no point in uninstalling..."
-include $(DEPS)
%.d: %.cpp
@$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) > $@
clean:
-rm -f $(wildcard src/**/*.h.gch)
-rm -f $(OBJS)
-rm -rf $(BUILD)/*
-rm -rf $(BIN)/*
cleandeps:
-rm -f $(DEPS)
cleanall: cleandeps clean