]> git.sesse.net Git - cubemap/blobdiff - Makefile
Provide an install target in the Makefile.
[cubemap] / Makefile
index bc3511a7edc4fabee7a226f7cfa1fe49ce8447a3..3552fe44bad0a63d4f52f09eeb2ddc7d56884f69 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,11 @@
 CC=gcc
 CXX=g++
+INSTALL=install
 PROTOC=protoc
-CXXFLAGS=-Wall -O2 -g
-LDLIBS=-lpthread -lprotobuf
+CXXFLAGS=-Wall -O2 -g -pthread
+LDLIBS=-lprotobuf -pthread
 
-OBJS=main.o server.o serverpool.o mutexlock.o input.o httpinput.o udpinput.o parse.o markpool.o acceptor.o stats.o thread.o state.pb.o
+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 markpool.o acceptor.o stats.o accesslog.o thread.o util.o log.o state.pb.o
 
 all: cubemap
 
@@ -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: