dungeon_crawler

annotate prototype/Makefile @ 1:96de911d05d4

started a rough prototype
author John Tsiombikas <nuclear@mutantstargoat.com>
date Thu, 28 Jun 2012 06:05:50 +0300
parents
children 252a00508411
rev   line source
nuclear@1 1 csrc = $(wildcard src/*.c) $(wildcard vmath/*.c)
nuclear@1 2 ccsrc = $(wildcard src/*.cc) $(wildcard vmath/*.cc)
nuclear@1 3 obj = $(csrc:.c=.o) $(ccsrc:.cc=.o)
nuclear@1 4 dep = $(obj:.o=.d)
nuclear@1 5 bin = proto
nuclear@1 6
nuclear@1 7 CFLAGS = -pedantic -Wall -g -Ivmath
nuclear@1 8 CXXFLAGS = $(CFLAGS)
nuclear@1 9 LDFLAGS = $(libgl) -lm
nuclear@1 10
nuclear@1 11 ifeq ($(shell uname -s), Darwin)
nuclear@1 12 libgl = -framework OpenGL -framework GLUT -lglew
nuclear@1 13 else
nuclear@1 14 libgl = -lGL -lGLU -lglut -lGLEW
nuclear@1 15 endif
nuclear@1 16
nuclear@1 17 $(bin): $(obj)
nuclear@1 18 $(CXX) -o $@ $(obj) $(LDFLAGS)
nuclear@1 19
nuclear@1 20 -include $(dep)
nuclear@1 21
nuclear@1 22 %.d: %.c
nuclear@1 23 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@1 24
nuclear@1 25 %.d: %.cc
nuclear@1 26 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@1 27
nuclear@1 28 .PHONY: clean
nuclear@1 29 clean:
nuclear@1 30 rm -f $(obj) $(bin) $(dep)