-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (27 loc) · 815 Bytes
/
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
OBJS=$(patsubst %.cc, %.o, $(wildcard *.cc))
DEPS=$(patsubst %.cc, %.d, $(wildcard *.cc))
CXX=g++
CXXFLAGS=-Wall -O3 -std=c++11 -flto
TARGET=flocc
MANPAGE=$(TARGET).1
INSTALL_DIR ?= /usr/local/
BIN_DIR ?= $(INSTALL_DIR)/bin/
MAN_DIR ?= $(INSTALL_DIR)/man/
RELEASE=0.1
all: $(DEPS) $(TARGET) $(MANPAGE)
version.h: Makefile
./gen-version-h.sh $(RELEASE)
-include $(DEPS)
$(TARGET): $(OBJS)
$(CXX) -flto -o $@ $+ -lstdc++fs -lgit2
%.d: %.cc version.h
g++ -MM -c $(CXXFLAGS) $< > $@
$(MANPAGE): flocc.pod
pod2man -c "Development Tools" -n $(TARGET) -r "$(TARGET) version $(RELEASE)" $+ > $@
install: $(TARGET)
install -D -s -m 755 $(TARGET) $(BIN_DIR)
install -D -m 644 $(MANPAGE) $(MAN_DIR)/man1/
userinstall:
install -m 755 $(TARGET) ~/bin/
clean:
rm -f $(TARGET) $(OBJS) $(MANPAGE) $(DEPS)