conworlds
annotate Makefile @ 20:782ff06817fb
merged ...
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Tue, 26 Aug 2014 18:42:53 +0300 |
parents | 283cdfa7dda2 |
children | 2da585428507 |
rev | line source |
---|---|
nuclear@4 | 1 csrc = $(wildcard src/*.c) $(wildcard src/vr/*.c) |
nuclear@1 | 2 ccsrc = $(wildcard src/*.cc) |
nuclear@1 | 3 obj = $(csrc:.c=.o) $(ccsrc:.cc=.o) |
nuclear@1 | 4 dep = $(obj:.o=.d) |
nuclear@13 | 5 bin = conworlds |
nuclear@1 | 6 |
nuclear@6 | 7 # comment out to disable LibOVR (oculus sdk) |
nuclear@6 | 8 #ovr_cflags = -DUSE_LIBOVR |
nuclear@6 | 9 #ovr_libs = -lovr |
nuclear@10 | 10 # comment out to disable OpenHMD |
nuclear@10 | 11 ohmd_cflags = -DUSE_OPENHMD |
nuclear@10 | 12 ohmd_libs = -lopenhmd |
nuclear@6 | 13 |
nuclear@17 | 14 CFLAGS = -pedantic -Wall -g $(ovr_cflags) `pkg-config --cflags sdl2` |
nuclear@1 | 15 CXXFLAGS = -std=c++11 $(CFLAGS) |
nuclear@17 | 16 LDFLAGS = $(libgl_$(sys)) -lm -lvmath -limago -lanim $(ovr_libs) `pkg-config --libs sdl2` |
nuclear@1 | 17 |
nuclear@17 | 18 libgl_unix = -lGL -lGLU -lGLEW |
nuclear@17 | 19 libgl_mac = -framework OpenGL -lGLEW |
nuclear@17 | 20 libgl_win = -lopengl32 -lglu32 -lglew32 |
nuclear@1 | 21 |
nuclear@1 | 22 $(bin): $(obj) |
nuclear@1 | 23 $(CXX) -o $@ $(obj) $(LDFLAGS) |
nuclear@1 | 24 |
nuclear@1 | 25 -include $(dep) |
nuclear@1 | 26 |
nuclear@1 | 27 %.d: %.c |
nuclear@1 | 28 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@1 | 29 |
nuclear@1 | 30 %.d: %.cc |
nuclear@1 | 31 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@1 | 32 |
nuclear@1 | 33 .PHONY: clean |
nuclear@1 | 34 clean: |
nuclear@1 | 35 rm -f $(obj) $(bin) |
nuclear@1 | 36 |
nuclear@1 | 37 # os detection |
nuclear@1 | 38 uname = $(shell uname -s) |
nuclear@1 | 39 ifeq ($(sys), Darwin) |
nuclear@1 | 40 sys = mac |
nuclear@1 | 41 else ifeq ($(findstring MINGW, $(sys)), MINGW) |
nuclear@1 | 42 sys = win |
nuclear@1 | 43 else |
nuclear@1 | 44 sys = unix |
nuclear@1 | 45 endif |