From: Steinar H. Gunderson Date: Fri, 16 Aug 2013 09:44:51 +0000 (+0200) Subject: Provide an install target in the Makefile. X-Git-Tag: 1.0.0~20 X-Git-Url: https://git.sesse.net/?p=cubemap;a=commitdiff_plain;h=7fc0fc6a973713c4082181aceb3c03d99ef3297f Provide an install target in the Makefile. Based on a patch from Philipp Kern. --- 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: