-
Notifications
You must be signed in to change notification settings - Fork 28
/
Makefile
38 lines (30 loc) · 1.18 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
CXXFLAGS = -O3 -Wall -Wextra -std=c++17 -march=native -s
INCLUDES = -Ithird-party/libtomcrypt/src/headers
LFLAGS = -Lthird-party/libtomcrypt
LIBS = -lrocksdb -ltomcrypt
SRCS = hashcobra.cpp
OBJS = $(SRCS:.cpp=.o)
PROJECT = hashcobra
PREFIX = /usr
SBINDIR = $(PREFIX)/bin
.PHONY: depend $(PROJECT) clean
all: $(PROJECT)
$(PROJECT): depend $(OBJS)
$(CXX) $(CXXFLAGS) $(INCLUDES) -o $(PROJECT) $(OBJS) $(LFLAGS) $(LIBS)
.cpp.o:
$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@
clean:
$(RM) *.o *~ $(PROJECT)
$(MAKE) -C third-party/libtomcrypt clean
depend:
$(MAKE) -C third-party/libtomcrypt
install: $(PROJECT)
install -Dm 755 $(PROJECT) $(DESTDIR)/$(SBINDIR)/$(PROJECT)
install -Dm 644 bash-completion/$(PROJECT) $(DESTDIR)/$(PREFIX)/share/bash-completion/completions/$(PROJECT)
install -Dm 644 -t $(DESTDIR)/$(PREFIX)/share/doc/$(PROJECT)/ README.md
install -Dm 644 LICENSE.md $(DESTDIR)/$(PREFIX)/share/licenses/$(PROJECT)/LICENSE.md
uninstall:
rm -f $(DESTDIR)/$(SBINDIR)/$(PROJECT)
rm -f $(DESTDIR)/$(PREFIX)/share/bash-completion/completions/$(PROJECT)
rm -f $(DESTDIR)/$(PREFIX)/share/doc/$(PROJECT)/README.md
rm -f $(DESTDIR)/$(PREFIX)/share/licenses/$(PROJECT)/LICENSE.md