libgoatvr
view Makefile.in @ 17:3de7339841d0
option for the null module fallback presentation to show one or both eye views
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 25 Sep 2014 17:14:04 +0300 |
parents | d12592558809 |
children | 5136dfcea7b1 |
line source
1 src = $(wildcard src/*.c)
2 obj = $(src:.c=.o)
3 dep = $(obj:.o=.d)
4 name = goatvr
5 so_major = 0
6 so_minor = 1
8 ifdef use_libovr
9 mod_cflags += -DUSE_LIBOVR
10 mod_libs += -lovr
11 endif
12 ifdef use_openhmd
13 mod_cflags += -DUSE_OPENHMD
14 mod_libs += -lopenhmd
15 endif
17 CFLAGS = -pedantic -Wall $(dbg) $(opt) $(pic) $(mod_cflags)
18 LDFLAGS = $(mod_libs) $(libgl)
20 lib_a = lib$(name).a
21 ifeq ($(shell uname -s), Darwin)
22 lib_so = lib$(name).dylib
23 shared = -dynamiclib
24 libgl = -framework OpenGL
26 ifdef use_libovr
27 mod_libs += -framework Cocoa -framework IOKit
28 endif
29 else
30 ldname = lib$(name).so
31 soname = lib$(name).so.$(so_major)
32 lib_so = lib$(name).so.$(so_major).$(so_minor)
33 shared = -shared -Wl,-soname=$(soname)
34 pic = -fPIC
35 libgl = -lGL -lGLU
36 endif
38 .PHONY: all
39 all: $(lib_so) $(lib_a) $(soname) $(ldname)
41 $(lib_so): $(obj)
42 $(CXX) -o $@ $(shared) $(obj) $(LDFLAGS)
44 $(soname): $(lib_so)
45 ln -sf $< $@
47 $(ldname): $(soname)
48 ln -sf $< $@
50 $(lib_a): $(obj)
51 $(AR) rcs $@ $(obj)
53 -include $(dep)
55 %.d: %.c
56 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
58 .PHONY: clean
59 clean:
60 rm -f $(obj) $(lib_so) $(lib_a) $(soname) $(ldname)
62 .PHONY: cleandep
63 cleandep: clean
64 rm -f $(dep)
66 .PHONY: install
67 install: $(lib_so) $(lib_a)
68 mkdir -p $(DESTDIR)$(PREFIX)/include $(DESTDIR)$(PREFIX)/lib
69 cp src/vr.h $(DESTDIR)$(PREFIX)/include/goatvr.h
70 cp $(lib_a) $(DESTDIR)$(PREFIX)/lib/$(lib_a)
71 cp $(lib_so) $(DESTDIR)$(PREFIX)/lib/$(lib_so)
72 [ -n "$(soname)" ] && \
73 cp -d $(soname) $(ldname) $(DESTDIR)$(PREFIX)/lib || \
74 true
76 .PHONY: uninstall
77 uninstall:
78 rm -f $(DESTDIR)$(PREFIX)/include/goatvr.h
79 rm -f $(DESTDIR)$(PREFIX)/lib/$(lib_a)
80 rm -f $(DESTDIR)$(PREFIX)/lib/$(lib_so)
81 [ -n "$(soname)" ] && \
82 rm -f $(DESTDIR)$(PREFIX)/lib/$(soname) && \
83 rm -f $(DESTDIR)$(PREFIX)/lib/$(ldname) || \
84 true