File: Makefile

package info (click to toggle)
cubemap 1.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 380 kB
  • ctags: 398
  • sloc: cpp: 3,895; sh: 114; perl: 86; makefile: 61
file content (59 lines) | stat: -rw-r--r-- 2,028 bytes parent folder | download | duplicates (2)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
CC=gcc
CXX=g++
INSTALL=install
PROTOC=protoc
CXXFLAGS=-Wall -O2 -g -pthread $(shell getconf LFS_CFLAGS)
LDLIBS=-lprotobuf -pthread -lrt

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

all: cubemap

%.pb.cc %.pb.h : %.proto
	$(PROTOC) --cpp_out=. $<

%.o: %.cpp state.pb.h
	$(CXX) -MMD -MP $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
%.pb.o: %.pb.cc
	$(CXX) -MMD -MP $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
cubemap: $(OBJS)
	$(CXX) -o cubemap $(OBJS) $(LDLIBS) $(LDFLAGS)

DEPS=$(OBJS:.o=.d)
-include $(DEPS)

clean:
	$(RM) cubemap $(OBJS) $(DEPS) state.pb.h state.pb.cc

PREFIX=/usr/local
SYSCONFDIR=/etc
LOCALSTATEDIR=/var
install:
	$(INSTALL) -m 755 -o root -g root -d \
		$(DESTDIR)$(PREFIX)/bin \
		$(DESTDIR)$(PREFIX)/share/man/man1 \
		$(DESTDIR)$(SYSCONFDIR) \
		$(DESTDIR)$(LOCALSTATEDIR)/lib/cubemap \
		$(DESTDIR)$(LOCALSTATEDIR)/log/cubemap \
		$(DESTDIR)$(PREFIX)/share/munin/plugins \
		$(DESTDIR)$(PREFIX)/lib/systemd/system
	$(INSTALL) -m 755 -o root -g root cubemap $(DESTDIR)$(PREFIX)/bin/cubemap
	$(INSTALL) -m 755 -o root -g root munin/cubemap munin/cubemap_input $(DESTDIR)$(PREFIX)/share/munin/plugins/
	gzip -c cubemap.1 > $(DESTDIR)$(PREFIX)/share/man/man1/cubemap.1.gz
	sed \
		-e "s,@prefix@,$(PREFIX),g" \
		-e "s,@sysconfdir@,$(SYSCONFDIR),g" \
		cubemap.service.in > $(DESTDIR)$(PREFIX)/lib/systemd/system/cubemap.service
	# Make sure we don't overwrite an existing configuration.
	test ! -f $(DESTDIR)$(SYSCONFDIR)/cubemap.config
	sed \
		-e "s,cubemap\.stats,$(LOCALSTATEDIR)/lib/cubemap/\0,g" \
		-e "s,cubemap-input\.stats,$(LOCALSTATEDIR)/lib/cubemap/\0,g" \
		-e "s,access\.log,$(LOCALSTATEDIR)/log/cubemap/\0,g" \
		-e "s,cubemap\.log,$(LOCALSTATEDIR)/log/cubemap/\0,g" \
		-e 's,^stream,#\0,g' \
		-e 's,^udpstream,#\0,g' \
		cubemap.config.sample > $(DESTDIR)$(SYSCONFDIR)/cubemap.config

.PHONY: clean install
.SUFFIXES: