-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
103 lines (79 loc) · 1.82 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
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
CXX = g++ -O2 --std=c++11
HC = ghc --make
LIBS = -lboost_math_tr1
DISTDIR = dist
TEX = pdflatex
TEXLOG = latex.log
.PHONY: all test cli doc
default: cli
# -------------
# Main targets.
# -------------
xfiles: xfiles.cpp
$(CXX) -o xfiles xfiles.cpp
all: test cli doc
./check.sh
./loc.sh
test: aggr_test histogram_test
cli: aggr histogram groupby pivot
cp aggr $(DISTDIR)/
cp histogram $(DISTDIR)/
cp groupby $(DISTDIR)/
cp pivot $(DISTDIR)/
cp LICENSE $(DISTDIR)/
doc: manual
# --------------
# Clean targets.
# --------------
clean: clean_test clean_cli clean_doc
clean_test:
rm -f aggr_test
rm -f histogram_test
clean_cli:
rm -f $(DISTDIR)/aggr
rm -f $(DISTDIR)/histogram
rm -f $(DISTDIR)/groupby
rm -f $(DISTDIR)/pivot
rm -f $(DISTDIR)/LICENSE
rm -f aggr
rm -f histogram
rm -f groupby
rm -f pivot
rm -f xfiles
rm -f *.o *.hi
clean_doc:
rm -f $(DISTDIR)/manual.pdf
rm -f $(DISTDIR)/FDL
rm -f manual.aux
rm -f manual.toc
rm -f manual.log
rm -f manual.pdf
# ---------------------------------
# The command line interface tools.
# ---------------------------------
aggr: aggr.cpp aggr.h
$(CXX) $(LIBS) -o aggr aggr.cpp
histogram: histogram.cpp histogram.h
$(CXX) $(LIBS) -o histogram histogram.cpp
groupby: groupby.cpp groupby.h aggr.h util.h
$(CXX) $(LIBS) -o groupby groupby.cpp
pivot: pivot.cpp util.h groupby.h aggr.h
$(CXX) $(LIBS) -o pivot pivot.cpp
# ------
# Tests.
# ------
aggr_test: aggr_test.cpp aggr.h
$(CXX) -o aggr_test aggr_test.cpp $(LIBS) -lUnitTest++
./aggr_test
histogram_test: histogram_test.cpp histogram.h
$(CXX) -o histogram_test histogram_test.cpp $(LIBS) -lUnitTest++
./histogram_test
# --------------
# Documentation.
# --------------
manual: manual.tex
rm -f $(TEXLOG)
$(TEX) manual.tex > $(TEXLOG)
$(TEX) manual.tex > $(TEXLOG)
cp manual.pdf $(DISTDIR)/
cp FDL $(DISTDIR)/