1 # options -------------------------------------------------
3 # ---------------------------------------------------------
5 src = $(wildcard src/*.c)
9 ifeq ($(vrbuild), true)
12 vr_cflags = -DBUILD_VR
17 warn = -pedantic -Wall -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast
21 CFLAGS = $(warn) $(dbg) $(opt) `pkg-config --cflags sdl2 freetype2` $(vr_cflags)
22 LDFLAGS = $(libsys) -ldrawtext $(libgl) `pkg-config --libs sdl2 freetype2` \
23 $(vr_ldflags) -limago -lpng -lz -ljpeg -lpthread -lm
25 sys ?= $(shell uname -s | sed 's/MINGW.*/mingw/')
28 obj = $(src:.c=.w32.o)
33 libgl = -lopengl32 -lglu32 -lglew32
34 libsys = -lmingw32 -lSDL2main -lwinmm -mconsole
36 else ifeq ($(sys), Darwin)
37 libgl = -framework OpenGL -lGLEW
40 libgl = -lGL -lGLU -lGLEW
45 $(CC) -o $@ $(obj) $(LDFLAGS)
51 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
54 $(CC) -o $@ $(CFLAGS) -c $<
58 $(MAKE) CC=i686-w64-mingw32-gcc sys=mingw
62 $(MAKE) CC=i686-w64-mingw32-gcc sys=mingw clean
66 cp $< /alien/vrtris/$<
67 for i in `tools/dlldepends | grep -v '++'`; do echo $$i; rsync $$i /alien/vrtris; done
78 install: $(bin) $(data)
79 mkdir -p $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/share/vrtris
80 cp $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin)
81 cp $(data) $(DESTDIR)$(PREFIX)/share/vrtris
85 rm -f $(DESTDIR)$(PREFIX)/bin/$(bin)
86 for i in $(data); do rm -f $(DESTDIR)$(PREFIX)/share/vrtris/$i; done
87 rmdir $(DESTDIR)$(PREFIX)/share/vrtris