-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (45 loc) · 1.84 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
PROJDIRS := src include
SCRIPTDIR := scripts
AUXFILES := Readme
SRCFILES := $(shell find $(PROJDIRS) -type f -name "*.cpp")
HDRFILES := $(shell find $(PROJDIRS) -type f -name "*.hpp")
SCRIPTFS := $(shell find $(SCRIPTDIR) -type f -name "*")
OBJFILES := $(patsubst %.cpp,%.o,$(SRCFILES))
DEPFILES := $(patsubst %.cpp,%.d,$(SRCFILES))
TMPFILES := $(patsubst %.cpp,%.cpp~,$(SRCFILES)) $(patsubst %.hpp,%.hpp~,$(HDRFILES))
CODEFILES := $(SRCFILES) $(HDRFILES) $(AUXFILES)
ALLFILES := $(CODEFILES) Makefile
DISTFILES := $(ALLFILES) $(SCRIPTFS)
WARNINGS :=-Wall -Wextra -pedantic -Wdouble-promotion -Wuninitialized -Winit-self -Wignored-qualifiers -Wmissing-include-dirs -Wswitch-default \
-Wswitch-enum -Wunused-parameter -Wunused -Wunknown-pragmas -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-declarations \
-Wredundant-decls -Wno-long-long -Wconversion #-Winline
DEBUG := -g -pg
CXX := g++
CXXFLAGS := -std=gnu++0x -m64 -O3 $(WARNINGS)
IFLAGS := -I/usr/include/igraph
LDFLAGS := -L/usr/local/lib -ligraph -lgsl -lgslcblas -lm
.PHONY: all clean clean-temps dist todolist
all: main info
main: authcpp
-@echo "Congratulations, you've built the authcpp program."
clean: clean-temps
-@$(RM) $(OBJFILES) $(DEPFILES) main dist.tgz authcpp
clean-temps:
-@$(RM) *~
-@$(RM) $(TMPFILES)
dist:
@tar czf dist.tgz $(DISTFILES)
todolist:
-@for file in $(CODEFILES); do fgrep -H -e TODO -e FIXME $$file; done; true
authcpp: $(OBJFILES)
@$(CXX) $(CXXFLAGS) $(LDFLAGS) -MMD -MP $^ -o $@
-include $(DEPFILES)
%.o: %.cpp Makefile
@$(CXX) $(CXXFLAGS) $(IFLAGS) -MMD -MP -c $< -o $@
fresh: clean all
info: authcpp
-@echo ------------------------------
-@echo AUTHCPP, CC-BY-NC - some rights reserved. Rafael S. Calsaverini.
-@echo VERSIONING INFO:
-@git describe --tags
-@git log --pretty=format:'%H%n%aD %d' --abbrev-commit --date=short -1