Cosmetics
[rawv.git] / Makefile
bloba98f5b4dc9afea7a9c24dfdd87fc4c199044f407
1 PREFIX ?= /usr/local
3 CC := gcc
4 CXX := g++
5 CFLAGS := -g -O2 -fPIC -Wall $(shell pkg-config --cflags sdl)
6 CXXFLAGS:= $(CFLAGS)
7 LDLIBS := $(shell pkg-config --libs sdl)
9 MAJOR := 0
10 MINOR := 0
12 all : librawv.so rawv hrclock
14 librawv.so : ivideo.o view.o capture.o net.o misc.o sdlu.o
15 $(LINK.cpp) -shared -Wl,-no-undefined -Wl,-soname=$@.$(MAJOR) $^ $(LDLIBS) -o $@.$(MAJOR).$(MINOR)
16 /sbin/ldconfig -l $@.$(MAJOR).$(MINOR)
17 ln -sf $@.$(MAJOR) $@
19 rawv : rawv.o librawv.so
20 $(LINK.cpp) $^ -Wl,-rpath=\$$ORIGIN -o $@
22 hrclock : hrclock.o
23 $(LINK.cpp) $^ $(LDLIBS) -lSDL_ttf -o $@
26 .PHONY : clean
27 clean :
28 $(RM) *.o *.so *.so.* rawv hrclock
30 .PHONY : install
31 install : rawv.h librawv.so librawv.so.$(MAJOR) librawv.so.$(MAJOR).$(MINOR) rawv
32 mkdir -p $(DESTDIR)$(PREFIX)/{include,lib,bin}/
33 install -m 644 rawv.h $(DESTDIR)$(PREFIX)/include/
34 cp -d librawv.so librawv.so.$(MAJOR) librawv.so.$(MAJOR).$(MINOR) $(DESTDIR)$(PREFIX)/lib/
35 install rawv $(DESTDIR)$(PREFIX)/bin/