-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
74 lines (61 loc) · 2.54 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
68
69
70
71
72
73
74
#
# Makefile needed for Assignment 4: News Feed Aggregator
#
CXX = g++
# The CXXFLAGS variable sets compile flags for gcc:
# -g compile with debug information
# -Wall give all diagnostic warnings
# -pedantic require compliance with ANSI standard
# -O0 do not optimize generated code
# -std=c++0x go with the c++0x extensions for thread support, unordered maps, etc
# -D_GLIBCXX_USE_NANOSLEEP included for this_thread::sleep_for and this_thread::sleep_until support
# -D_GLIBCXX_USE_SCHED_YIELD included for this_thread::yield support
CXXFLAGS = -g -Wall -pedantic -O0 -std=c++0x -D_GLIBCXX_USE_NANOSLEEP -D_GLIBCXX_USE_SCHED_YIELD -I/usr/class/cs110/include/libxml2 -I/usr/class/cs110/local/include
# The LDFLAGS variable sets flags for linker
# -lm link in libm (math library)
# -lpthread link in libpthread (thread library) to back C++11 extensions
# -lrand link to simple random number generator
# -lthreads link to convenience functions layering over C++11 threads
# -lxml2 link in libxml2 (XML processing library)
LDFLAGS = -lm -lpthread -L/usr/class/cs110/local/lib -lrand -lthreads -L/usr/class/cs110/lib/libxml2 -lxml2
# In this section, you list the files that are part of the project.
# If you add/change names of header/source files, here is where you
# edit the Makefile.
SOURCES = \
news-aggregator.cc \
news-aggregator-utils.cc \
stream-tokenizer.cc \
rss-feed.cc \
rss-feed-list.cc \
html-document.cc \
rss-index.cc
HEADERS = \
article.h \
news-aggregator-utils.h \
stream-tokenizer.h \
rss-feed.h \
rss-feed-exception.h \
rss-feed-list.h \
rss-feed-list-exception.h \
html-document.h \
html-document-exception.h \
rss-index.h
OBJECTS = $(SOURCES:.cc=.o)
TARGETS = news-aggregator
default: $(TARGETS)
news-aggregator: $(OBJECTS)
$(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
# In make's default rules, a .o automatically depends on its .c file
# (so editing the .c will cause recompilation into its .o file).
# The line below creates additional dependencies, most notably that it
# will cause the .c to reocmpiled if any included .h file changes.
Makefile.dependencies:: $(SOURCES) $(HEADERS)
$(CXX) $(CXXFLAGS) -MM $(SOURCES) > Makefile.dependencies
-include Makefile.dependencies
# Phony means not a "real" target, it doesn't build anything
# The phony target "clean" that is used to remove all compiled object files.
.PHONY: clean spartan
clean:
@rm -f $(TARGETS) $(OBJECTS) core Makefile.dependencies
spartan: clean
@rm -f *~