6 CXXFLAGS=-Wall @CXXFLAGS@ @protobuf_CFLAGS@ @libsystemd_CFLAGS@
8 LIBS=@LIBS@ @protobuf_LIBS@ @libsystemd_LIBS@
10 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 timespec.o state.pb.o
14 %.pb.cc %.pb.h : %.proto
15 $(PROTOC) --cpp_out=. $<
18 $(CXX) -MMD -MP $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
20 $(CXX) -MMD -MP $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
22 $(CXX) -o cubemap $(OBJS) $(LIBS) $(LDFLAGS)
28 $(RM) cubemap $(OBJS) $(DEPS) state.pb.h state.pb.cc
31 SYSCONFDIR=@sysconfdir@
32 LOCALSTATEDIR=@localstatedir@
34 $(INSTALL) -m 755 -o root -g root -d \
35 $(DESTDIR)$(PREFIX)/bin \
36 $(DESTDIR)$(PREFIX)/share/man/man1 \
37 $(DESTDIR)$(SYSCONFDIR) \
38 $(DESTDIR)$(LOCALSTATEDIR)/lib/cubemap \
39 $(DESTDIR)$(LOCALSTATEDIR)/log/cubemap \
40 $(DESTDIR)$(PREFIX)/share/munin/plugins \
41 $(DESTDIR)$(PREFIX)/lib/systemd/system
42 $(INSTALL) -m 755 -o root -g root cubemap $(DESTDIR)$(PREFIX)/bin/cubemap
43 $(INSTALL) -m 755 -o root -g root munin/cubemap munin/cubemap_input $(DESTDIR)$(PREFIX)/share/munin/plugins/
44 gzip -c cubemap.1 > $(DESTDIR)$(PREFIX)/share/man/man1/cubemap.1.gz
46 -e "s,@prefix[@],$(PREFIX),g" \
47 -e "s,@sysconfdir[@],$(SYSCONFDIR),g" \
48 cubemap.service.in > $(DESTDIR)$(PREFIX)/lib/systemd/system/cubemap.service
49 # Make sure we don't overwrite an existing configuration.
50 test ! -f $(DESTDIR)$(SYSCONFDIR)/cubemap.config
52 -e "s,cubemap\.stats,$(LOCALSTATEDIR)/lib/cubemap/\0,g" \
53 -e "s,cubemap-input\.stats,$(LOCALSTATEDIR)/lib/cubemap/\0,g" \
54 -e "s,access\.log,$(LOCALSTATEDIR)/log/cubemap/\0,g" \
55 -e "s,cubemap\.log,$(LOCALSTATEDIR)/log/cubemap/\0,g" \
56 -e 's,^stream,#\0,g' \
57 -e 's,^udpstream,#\0,g' \
58 cubemap.config.sample > $(DESTDIR)$(SYSCONFDIR)/cubemap.config