-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
89 lines (67 loc) · 1.71 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
# name of the library
LIBRARY = thimble
# compiler
CCC = g++
# C++ compiler flags
CCFLAGS = -Wall -Wwrite-strings -ansi -pedantic -O2 -std=c++17
# Local stuff for compilation
INCLUDEFLAGS = -I./include/
LIBRARYFLAGS= -L./
LINKFLAGS = -l$(LIBRARY) -lm
# Global directories for installation
INCDIR = /usr/local/include/
LIBDIR = /usr/local/lib/
# library source files.
SRCS = $(wildcard ./src/*.cpp)
# binary source files
BSRC = $(wildcard ./*.cpp)
# library source files
OBJS = $(SRCS:.cpp=.o)
# binary source files
BINS = $(BSRC:.cpp=)
all: $(OBJS) $(BOBJS)
ar rcs lib$(LIBRARY).a $(OBJS)
make binaries
.cpp.o:
$(CCC) $(INCLUDEFLAGS) $(CCFLAGS) -c $< -o $@
binaries: $(BINS)
.cpp:
$(CCC) $(CCFLAGS) $(INCLUDEFLAGS) $(LIBRARYFLAGS) $< -o $@ $(LINKFLAGS)
doxy:
doxygen ./doc/doxy.cfg
install:
mkdir -p -m 755 $(INCDIR)
rm -rf $(INCDIR)/$(LIBRARY)
mkdir -m 755 $(INCDIR)/$(LIBRARY)
cp -r ./include/$(LIBRARY) $(INCDIR)
- chmod -R a+r $(INCDIR)/$(LIBRARY)
mkdir -p -m 755 $(LIBDIR)
cp -p lib$(LIBRARY).a $(LIBDIR)/lib$(LIBRARY).a
- chmod a+r $(LIBDIR)/lib$(LIBRARY).a
uninstall:
rm -f $(LIBDIR)/lib$(LIBRARY).a
rm -rf $(INCDIR)/$(LIBRARY)
clean:
rm -f $(OBJS)
rm -f lib$(LIBRARY).a
rm -f $(BINS)
rm -f ./include/*~
rm -f ./include/thimble/*~
rm -f ./include/thimble/ecc/*~
rm -f ./include/thimble/finger/*~
rm -f ./include/thimble/image/*~
rm -f ./include/thimble/math/*~
rm -f ./include/thimble/math/linalg/*~
rm -f ./include/thimble/math/numbertheory/*~
rm -f ./include/thimble/math/numerical/*~
rm -f ./include/thimble/misc/*~
rm -f ./include/thimble/security/*~
rm -f ./src/*~
rm -f ./doc/*~
rm -f *~
deldoxy:
rm -f -r ./doc/html
rm -f -r ./doc/latex
clobber:
make clean
make deldoxy