From 7fc0fc6a973713c4082181aceb3c03d99ef3297f Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Fri, 16 Aug 2013 11:44:51 +0200 Subject: [PATCH 1/1] Provide an install target in the Makefile. Based on a patch from Philipp Kern. --- Makefile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f08d8c0..3552fe4 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ CC=gcc CXX=g++ +INSTALL=install PROTOC=protoc CXXFLAGS=-Wall -O2 -g -pthread LDLIBS=-lprotobuf -pthread @@ -24,5 +25,18 @@ DEPS=$(OBJS:.o=.d) clean: $(RM) cubemap $(OBJS) $(DEPS) state.pb.h state.pb.cc -.PHONY: clean +PREFIX=/usr +install: + $(INSTALL) -m 755 -o root -g root -d $(DESTDIR)$(PREFIX)/bin $(DESTDIR)/etc $(DESTDIR)/var/lib/cubemap $(DESTDIR)/var/log/cubemap + $(INSTALL) -m 755 -o root -g root cubemap $(DESTDIR)$(PREFIX)/bin/cubemap + sed \ + -e 's,cubemap\.stats,/var/lib/cubemap/\0,g' \ + -e 's,cubemap-input\.stats,/var/lib/cubemap/\0,g' \ + -e 's,access\.log,/var/log/cubemap/\0,g' \ + -e 's,cubemap\.log,/var/log/cubemap/\0,g' \ + -e 's,^stream,#\0,g' \ + -e 's,^udpstream,#\0,g' \ + cubemap.config.sample > $(DESTDIR)/etc/cubemap.config + +.PHONY: clean install .SUFFIXES: -- 2.39.2