5 CXXFLAGS=-Wall -O2 -g -pthread $(shell getconf LFS_CFLAGS)
6 LDLIBS=-lprotobuf -pthread -lrt
8 OBJS=main.o client.o server.o stream.o udpstream.o serverpool.o mutexlock.o input.o input_stats.o httpinput.o udpinput.o parse.o config.o acceptor.o stats.o accesslog.o thread.o util.o log.o metacube2.o sa_compare.o state.pb.o
12 %.pb.cc %.pb.h : %.proto
13 $(PROTOC) --cpp_out=. $<
16 $(CXX) -MMD -MP $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
18 $(CXX) -MMD -MP $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
20 $(CXX) -o cubemap $(OBJS) $(LDLIBS) $(LDFLAGS)
26 $(RM) cubemap $(OBJS) $(DEPS) state.pb.h state.pb.cc
32 $(INSTALL) -m 755 -o root -g root -d \
33 $(DESTDIR)$(PREFIX)/bin \
34 $(DESTDIR)$(PREFIX)/share/man/man1 \
35 $(DESTDIR)$(SYSCONFDIR) \
36 $(DESTDIR)$(LOCALSTATEDIR)/lib/cubemap \
37 $(DESTDIR)$(LOCALSTATEDIR)/log/cubemap \
38 $(DESTDIR)$(PREFIX)/share/munin/plugins \
39 $(DESTDIR)$(PREFIX)/lib/systemd/system
40 $(INSTALL) -m 755 -o root -g root cubemap $(DESTDIR)$(PREFIX)/bin/cubemap
41 $(INSTALL) -m 755 -o root -g root munin/cubemap munin/cubemap_input $(DESTDIR)$(PREFIX)/share/munin/plugins/
42 gzip -c cubemap.1 > $(DESTDIR)$(PREFIX)/share/man/man1/cubemap.1.gz
44 -e "s,@prefix@,$(PREFIX),g" \
45 -e "s,@sysconfdir@,$(SYSCONFDIR),g" \
46 cubemap.service.in > $(DESTDIR)$(PREFIX)/lib/systemd/system/cubemap.service
47 # Make sure we don't overwrite an existing configuration.
48 test ! -f $(DESTDIR)$(SYSCONFDIR)/cubemap.config
50 -e "s,cubemap\.stats,$(LOCALSTATEDIR)/lib/cubemap/\0,g" \
51 -e "s,cubemap-input\.stats,$(LOCALSTATEDIR)/lib/cubemap/\0,g" \
52 -e "s,access\.log,$(LOCALSTATEDIR)/log/cubemap/\0,g" \
53 -e "s,cubemap\.log,$(LOCALSTATEDIR)/log/cubemap/\0,g" \
54 -e 's,^stream,#\0,g' \
55 -e 's,^udpstream,#\0,g' \
56 cubemap.config.sample > $(DESTDIR)$(SYSCONFDIR)/cubemap.config