erebus

view Makefile @ 44:a2afaf8af09b

helpful comment
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 18 Sep 2015 06:47:41 +0300
parents 2c768a49e86e
children
line source
1 csrc = $(wildcard src/*.c)
2 ccsrc = $(wildcard src/*.cc)
3 obj = $(csrc:.c=.o) $(ccsrc:.cc=.o)
4 bin = erebus
6 export opt = -O3 -ffast-math
7 export dbg = -g
8 export warn = -Wall
10 CFLAGS = -pedantic $(warn) $(opt) $(dbg) -Iliberebus/src
11 CXXFLAGS = -std=c++11 $(CFLAGS)
12 LDFLAGS = -Lliberebus $(rpath) $(libgl_$(sys)) -lm -lerebus -lvmath -limago -ldrawtext
14 libgl_unix = -lGL -lGLU -lglut -lGLEW
15 libgl_mac = -framework OpenGL -framework GLUT -lGLEW
16 libgl_win = -lopengl32 -lglu32 -lglut32 -lglew32
18 $(bin): $(obj) liberebus
19 $(CXX) -o $@ $(obj) $(LDFLAGS)
21 .PHONY: liberebus
22 liberebus:
23 $(MAKE) -C liberebus
25 .PHONY: liberebus-clean
26 liberebus-clean:
27 $(MAKE) -C liberebus clean
29 .PHONY: clean
30 clean:
31 rm -f $(obj) $(bin)
33 .PHONY: cleanall
34 cleanall: clean liberebus-clean
36 uname = $(shell uname -s)
37 ifeq ($(uname), Darwin)
38 sys = mac
39 warn += -Wno-deprecated-declarations
40 else ifeq ($(findstring MINGW, $(uname)), MINGW)
41 sys = win
42 else
43 sys = unix
44 rpath = -Wl,-rpath=liberebus
45 endif