tavli

view Makefile @ 24:0aadb519b5ee

correct highlighting
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 08 Jul 2015 15:11:58 +0300
parents a0d30f6f20d4
children
line source
1 PREFIX ?= /usr/local
3 src = $(wildcard src/*.cc)
4 csrc = $(wildcard src/*.c)
5 obj = $(src:.cc=.o) $(csrc:.c=.o)
6 dep = $(obj:.o=.d)
8 bin = tavli
10 CFLAGS = -pedantic -Wall -g
11 CXXFLAGS = -pedantic -Wall -g
12 LDFLAGS = $(libgl) -lvmath -limago -lm -lpthread
14 ifeq ($(shell uname -s), Darwin)
15 libgl = -framework OpenGL -framework GLUT -lGLEW
16 else
17 libgl = -lGL -lGLU -lglut -lGLEW
18 endif
20 $(bin): $(obj)
21 $(CXX) -o $@ $(obj) $(LDFLAGS)
23 -include $(dep)
25 %.d: %.c
26 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
28 %.d: %.cc
29 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
31 .PHONY: clean
32 clean:
33 rm -f $(obj) $(bin)
35 .PHONY: cleandep
36 cleandep:
37 rm -f $(dep)
39 .PHONY: install
40 install: $(bin)
41 mkdir -p $(PREFIX)/bin
42 cp $(bin) $(PREFIX)/bin/$(bin)
44 .PHONY: uninstall
45 uninstall:
46 rm -f $(PREFIX)/bin/$(bin)