fixed scale in VR
[vrfileman] / Makefile
1 # ---- options ----
2 PREFIX = /usr/local
3 opt = -O0
4 dbg = -g
5 # -----------------
6
7 src = $(wildcard src/*.cc)
8 csrc = $(wildcard src/*.c)
9 obj = $(src:.cc=.o) $(csrc:.c=.o)
10 dep = $(obj:.o=.d)
11 bin = vrfileman
12
13 warn = -pedantic -Wall
14
15 CFLAGS = $(warn) $(opt) $(dbg) $(inc) `pkg-config --cflags sdl2`
16 CXXFLAGS = -std=c++11 $(warn) $(opt) $(dbg) $(inc) `pkg-config --cflags sdl2`
17 LDFLAGS = $(libgl) -lgmath -limago -lgoatvr -loptcfg -ldrawtext `pkg-config --libs sdl2`
18
19
20 ifeq ($(shell uname -s), Darwin)
21         libgl = -framework OpenGL -lGLEW
22 else
23         libgl = -lGL -lGLEW
24 endif
25
26
27 $(bin): $(obj)
28         $(CXX) -o $@ $(obj) $(LDFLAGS)
29
30 -include $(dep)
31
32 %.d: %.c
33         @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
34
35 %.d: %.cc
36         @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
37
38 .PHONY: clean
39 clean:
40         rm -f $(obj) $(bin)
41
42 .PHONY: cleandep
43 cleandep:
44         rm -f $(dep)
45
46 .PHONY: install
47 install: $(bin)
48         mkdir -p $(DESTDIR)$(PREFIX)/bin
49         cp $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin)
50
51 .PHONY: uninstall
52 uninstall:
53         rm -f $(DESTDIR)$(PREFIX)/bin/$(bin)