-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
44 lines (35 loc) · 979 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
37
38
39
40
41
42
43
44
#
# Author: Divye Kapoor (divyekapoor@gmail.com)
#
# Typical usage:
# $ ./configure && make && make test
# $ sudo make install
#
# Change the INSTALLPATH below if you want to install the binaries to a new location.
#
SOURCES=$(wildcard *.cc)
HEADERS=$(wildcard *.h)
OBJECTS=$(SOURCES:.cc=.o)
BINS=$(SOURCES:.cc=)
DEPS=$(OBJECTS:.o=.d)
INSTALLPATH=/usr/local/bin
CXXFLAGS+=-std=c++11 -Wall -g -O3 -MMD -MP -MF $(DEPS) -I ./PEGTL/ -I ./gflags/build/include
LDFLAGS=
LDLIBS=./gflags/build/lib/libgflags.a -lpthread
# Pattern rule for compilation of CC files.
%: %.cc
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(filter %.cc,$^) $(LDLIBS) -o $@
all: $(BINS)
test: $(BINS) run_tests.sh
./run_tests.sh
install: $(BINS)
@echo Installing to $(INSTALLPATH)
install $(BINS) $(INSTALLPATH)
install $(BINS) $(INSTALLPATH)/ugrep
uninstall:
rm $(INSTALLPATH)/$(BINS)
rm $(INSTALLPATH)/ugrep
.PHONY: all clean test install uninstall
clean:
$(RM) $(OBJECTS) $(BINS) $(DEPS)
-include $(DEPS)