-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
94 lines (73 loc) · 2.42 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
#
# Makefile for BAF prototype
#
# author: t.j.
# version: 2013-09
#
# To compile with c++ 11
# BUILD CONFIGURATIONS -------------------------------------------------------
NAME=baf
CXX=g++
CXXFLAGS=\
-Wall\
-ggdb
CXXLIBS=\
-lpthread\
-lstdc++\
-std=c++0x
SRCDIR=./src
BINDIR=./bin
DOCDIR=./doc
DEVDIR=$(SRCDIR)/dev
ENCDIR=$(SRCDIR)/enc
DEP=\
main.o \
AbstractDevice.o \
AbstractEncoder.o \
CharacterDevice.o \
NumericEncoder.o \
XDevice.o\
shared.o
# BUILD OPTIONS --------------------------------------------------------------
.PHONY: quick
quick: $(DEP)
$(CXX) $(CXXFLAGS) -o $(BINDIR)/$(NAME) $(DEP) $(CXXLIBS)
.PHONY: tex
tex: $(DOCDIR)/tex/index.tex
pdflatex --file-line-error -output-directory=$(DOCDIR)/tex/ $(DOCDIR)/tex/index.tex
pdflatex -output-directory=$(DOCDIR)/tex/ $(DOCDIR)/tex/index.tex
rm texput.log
.PHONY: documentation
documentation:
doxygen doxy-1.7.6.1.conf
.PHONY: clean
clean:
clear
sudo rm *.o
sudo rm -r $(DOCDIR)/srcdoc/*
# sudo rm -r $(DOCDIR)/man/*
.PHONY: all
all: $(DEP)
make quick
doxygen doxy-1.7.6.1.conf
rm *.o
strip $(BINDIR)/$(NAME)
# BUILD OBJECTS --------------------------------------------------------------
main.o: $(SRCDIR)/main.cpp $(SRCDIR)/main.h
$(CXX) $(CXXFLAGS) -c $(SRCDIR)/main.cpp -o main.o $(CXXLIBS)
AbstractDevice.o: $(DEVDIR)/AbstractDevice.cpp $(DEVDIR)/AbstractDevice.h
$(CXX) $(CXXFLAGS) -c $(DEVDIR)/AbstractDevice.cpp -o AbstractDevice.o $(CXXLIBS)
AbstractEncoder.o: $(ENCDIR)/AbstractEncoder.cpp $(ENCDIR)/AbstractEncoder.h
$(CXX) $(CXXFLAGS) -c $(ENCDIR)/AbstractEncoder.cpp -o AbstractEncoder.o $(CXXLIBS)
# CONCRETE IMPLEMENTATIONS ---------------------------------------------------
## DEVICES
CharacterDevice.o: $(DEVDIR)/CharacterDevice.cpp $(DEVDIR)/CharacterDevice.h $(DEVDIR)/AbstractDevice.h
$(CXX) $(CXXFLAGS) -c $(DEVDIR)/CharacterDevice.cpp -o CharacterDevice.o $(CXXLIBS)
XDevice.o: $(DEVDIR)/XDevice.cpp $(DEVDIR)/XDevice.h $(DEVDIR)/CharacterDevice.h $(ENCDIR)/NumericEncoder.h
$(CXX) $(CXXFLAGS) -c $(DEVDIR)/XDevice.cpp -o XDevice.o $(CXXLIBS)
## ENCODER
NumericEncoder.o: $(ENCDIR)/NumericEncoder.cpp $(ENCDIR)/NumericEncoder.h $(ENCDIR)/AbstractEncoder.h
$(CXX) $(CXXFLAGS) -c $(ENCDIR)/NumericEncoder.cpp -o NumericEncoder.o $(CXXLIBS)
# SHARED LIBRARIES -----------------------------------------------------------
shared.o: $(SRCDIR)/shared.cpp $(SRCDIR)/shared.h
$(CXX) $(CXXFLAGS) -c $(SRCDIR)/shared.cpp -o shared.o $(CXXLIBS)