-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
40 lines (29 loc) · 1.08 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
DESTDIR=/
PREFIX=$(DESTDIR)/usr/local
DEPDIR=.deps
LIBS = $(shell pkg-config libcap_utils-0.7 libcap_filter-0.7 --libs) -lqd -lcurl
bin_PROGRAMS = bitrate pktrate timescale wavelet
.PHONY: clean env-check
all: $(bin_PROGRAMS) env-check
bitrate: bitrate.o extract.o http.o
$(CXX) $(LDFLAGS) $^ $(LIBS) -o $@
pktrate: pktrate.o extract.o
$(CXX) $(LDFLAGS) $^ $(LIBS) -o $@
timescale: timescale.o extract.o
$(CXX) $(LDFLAGS) $^ $(LIBS) -o $@
wavelet: wavelet.o extract.o
$(CXX) $(LDFLAGS) $^ $(LIBS) -o $@
env-check:
@pkg-config libcap_utils-0.7 --atleast-version=0.7.14 || (echo "libcap_utils must be at least version 0.7.14, please update"; exit 1)
clean:
rm -rf *.o $(bin_PROGRAMS) $(DEPDIR)
$(DEPDIR):
mkdir -p $@
%.o: %.cpp Makefile $(DEPDIR)
$(CXX) -Wall -std=c++0x -DHAVE_CONFIG_H $(CFLAGS) $(shell pkg-config libcap_utils-0.7 --cflags) -c $< -MD -MF $(DEPDIR)/$(@:.o=.d) -o $@
install: all
install -m 0755 bitrate $(PREFIX)/bin
install -m 0755 pktrate $(PREFIX)/bin
install -m 0755 timescale $(PREFIX)/bin
install -m 0755 wavelet $(PREFIX)/bin
-include $(wildcard $(DEPDIR)/*.d)